Esempio n. 1
0
        /// <inheritdoc />
        public override void Run(BuildContext context)
        {
            var publishSettings = new DotNetPublishSettings
            {
                PublishTrimmed  = false,
                Runtime         = "linux-musl-x64",
                SelfContained   = true,
                Configuration   = context.BuildConfiguration,
                OutputDirectory = "./artifacts/publish/pgredis/"
            };

            context.DotNetPublish(
                "./src/simpleauth.authserverpgredis/simpleauth.authserverpgredis.csproj",
                publishSettings);
            var settings = new DockerImageBuildSettings
            {
                NoCache  = true,
                Pull     = true,
                Compress = true,
                File     = "./DockerfilePgRedis",
                ForceRm  = true,
                Rm       = true,
                Tag      = new[]
                {
                    "jjrdk/simpleauth:pgredis-canary", "jjrdk/simpleauth:" + context.BuildVersion + "-pgredis"
                }
            };

            context.DockerBuild(settings, "./");
        }
Esempio n. 2
0
    private static DirectoryPath PackPrepareNative(BuildContext context, string runtime)
    {
        var platform   = context.Environment.Platform.Family;
        var outputPath = Paths.Native.Combine(platform.ToString().ToLower()).Combine(runtime);

        var settings = new DotNetPublishSettings
        {
            Framework       = Constants.NetVersion60,
            Runtime         = runtime,
            NoRestore       = false,
            Configuration   = context.MsBuildConfiguration,
            OutputDirectory = outputPath,
            MSBuildSettings = context.MsBuildSettings,
            IncludeNativeLibrariesForSelfExtract = true,
            PublishSingleFile = true,
            SelfContained     = true
        };

        // workaround for https://github.com/dotnet/runtime/issues/49508
        if (runtime == "osx-arm64")
        {
            settings.ArgumentCustomization = arg => arg.Append("/p:OsxArm64=true");
        }

        context.DotNetPublish("./src/GitVersion.App/GitVersion.App.csproj", settings);

        return(outputPath);
    }
Esempio n. 3
0
        public void BuildNative()
        {
            AbsolutePath nativeProject = HactoolnetProject.Path.Parent / "hactoolnet_native.csproj";

            try
            {
                File.Copy(HactoolnetProject, nativeProject, true);
                DotNet("new nuget --force");

                XDocument doc = XDocument.Load(NugetConfig);
                doc.Element("configuration").Element("packageSources").Add(new XElement("add",
                                                                                        new XAttribute("key", "myget"), new XAttribute("value", DotNetFeedSource)));

                doc.Save(NugetConfig);

                DotNet($"add {nativeProject} package Microsoft.DotNet.ILCompiler --version 1.0.0-alpha-*");

                DotNetPublishSettings publishSettings = new DotNetPublishSettings()
                                                        .SetConfiguration(Configuration)
                                                        .SetProject(nativeProject)
                                                        .SetFramework("netcoreapp3.0")
                                                        .SetRuntime(NativeRuntime)
                                                        .SetOutput(CliNativeDir)
                                                        .SetProperties(VersionProps);

                if (!Untrimmed)
                {
                    publishSettings = publishSettings
                                      .AddProperty("RootAllApplicationAssemblies", false)
                                      .AddProperty("IlcGenerateCompleteTypeMetadata", false)
                                      .AddProperty("IlcGenerateStackTraceData", false)
                                      .AddProperty("IlcFoldIdenticalMethodBodies", true)
                    ;
                }

                DotNetPublish(publishSettings);

                if (EnvironmentInfo.IsUnix && !Untrimmed)
                {
                    ProcessTasks.StartProcess("strip", CliNativeExe).AssertZeroExitCode();
                }

                ZipFile(CliNativeZip, CliNativeExe, $"hactoolnet{NativeProgramExtension}");
                Logger.Normal($"Created {CliNativeZip}");

                if (Host == HostType.AppVeyor)
                {
                    PushArtifact(CliNativeZip);
                }
            }
            finally
            {
                File.Delete(nativeProject);
                File.Delete(NugetConfig);
            }
        }
Esempio n. 4
0
 DotNetPublishSettings ApplyBasePublishSettings(DotNetPublishSettings settings)
 {
     settings.SetProject(ApplicationCsproj);
     settings.SetConfiguration(Configuration);
     settings.SetAssemblyVersion(GitVersion.AssemblySemVer);
     settings.SetFileVersion(GitVersion.AssemblySemFileVer);
     settings.SetInformationalVersion(GitVersion.InformationalVersion);
     settings.EnableNoRestore();
     return(settings);
 }
Esempio n. 5
0
        /// <inheritdoc />
        public override void Run(BuildContext context)
        {
            var winPublishSettings = new DotNetPublishSettings
            {
                PublishTrimmed  = false,
                Runtime         = "win-x64",
                SelfContained   = true,
                Configuration   = context.BuildConfiguration,
                OutputDirectory = "./artifacts/publish/winx64/"
            };

            context.DotNetPublish("./src/simpleauth.authserver/simpleauth.authserver.csproj", winPublishSettings);
        }
    private static DirectoryPath PackPrepareNative(BuildContext context, string runtime)
    {
        var platform   = context.Environment.Platform.Family;
        var outputPath = Paths.Native.Combine(platform.ToString().ToLower()).Combine(runtime);

        var settings = new DotNetPublishSettings
        {
            Framework       = Constants.NetVersion60,
            Runtime         = runtime,
            NoRestore       = false,
            Configuration   = context.MsBuildConfiguration,
            OutputDirectory = outputPath,
            MSBuildSettings = context.MsBuildSettings,
            IncludeNativeLibrariesForSelfExtract = true,
            PublishSingleFile = true,
            SelfContained     = true
        };

        context.DotNetPublish("./src/GitVersion.App/GitVersion.App.csproj", settings);

        return(outputPath);
    }
 public static DotNetPublishSettings SetTargetPlatform(this DotNetPublishSettings settings, MSBuildTargetPlatform platform)
 {
     return(platform is null
         ? settings
         : settings.SetProperty("Platform", GetTargetPlatform(platform)));
 }
 public static DotNetPublishSettings SetTargetPlatformAnyCPU(this DotNetPublishSettings settings)
 => settings.SetTargetPlatform(MSBuildTargetPlatform.MSIL);
Esempio n. 9
0
 public static DotNetPublishSettings SetMopRuntime(this DotNetPublishSettings s, string runtime)
 {
     return(string.IsNullOrEmpty(runtime) ?
            s : s.SetRuntime(runtime));
 }