コード例 #1
0
        public override void Run(ICakeContext context)
        {
            CakeLicenseHeaderUpdaterSettings settings = new CakeLicenseHeaderUpdaterSettings
            {
                // Need the "my_" in front because otherwise Cake things its the dry run for *it*
                // not for us.
                DryRun        = context.Argument <bool>($"my_{nameof( CakeLicenseHeaderUpdaterSettings.DryRun )}", false),
                LicenseString = context.Argument(nameof(CakeLicenseHeaderUpdaterSettings.LicenseString), string.Empty),
                Threads       = 1,
                Verbosity     = Verbosity.Diagnostic
            };

            for (int i = 1; i <= MaximumRegexes; ++i)
            {
                string argName = $"{nameof( CakeLicenseHeaderUpdaterSettings.OldHeaderRegexPatterns )}_{i}";
                if (context.HasArgument(argName))
                {
                    settings.OldHeaderRegexPatterns.Add(context.Arguments.GetArgument(argName));
                }
            }

            string globPattern = context.Argument("files", string.Empty);

            if (string.IsNullOrWhiteSpace(globPattern))
            {
                throw new ArgumentException("'files' can not be empty");
            }

            context.UpdateLicenseHeaders(context.GetFiles(globPattern), settings);
        }
コード例 #2
0
ファイル: BuildConfig.cs プロジェクト: plcode7/AutoCake
    public static void Configure(ICakeContext context)
    {
        Context            = context;
        Configuration      = Context.Argument("configuration", "Release");
        UseXBuildOnWindows = Context.Argument("forcexbuild", false);
        var targetDir = Context.Argument <string>("targetdir", null);

        if (targetDir != null)
        {
            TargetDirectory = targetDir;
        }

        var platform = Context.Argument("platforms", Context.Argument <string>("platforms", null));

        if (platform != null)
        {
            var allPlatforms = platform.Split(';');
            foreach (var p in allPlatforms)
            {
                PlatformTarget parsed;
                if (Enum.TryParse(p, true, out parsed))
                {
                    Platforms.Add(parsed);
                }
                else
                {
                    var strings = Enum.GetNames(typeof(PlatformTarget));
                    throw new ArgumentException(
                              "Not a valid platform specifier. Valid values are " + string.Join(", ", strings) + ".",
                              "platform");
                }
            }
        }
    }
コード例 #3
0
    public BuildContext(ICakeContext context)
        : base(context)
    {
        BuildConfiguration = context.Argument("Configuration", "Release");
        SkipTests          = context.Argument("SkipTests", false);
        SkipSlowTests      = context.Argument("SkipSlowTests", false);

        RootDirectory       = new DirectoryPath(new DirectoryInfo(Directory.GetCurrentDirectory()).Parent.FullName);
        ArtifactsDirectory  = RootDirectory.Combine("artifacts");
        ToolsDirectory      = RootDirectory.Combine("tools");
        DocsDirectory       = RootDirectory.Combine("docs");
        DocfxDirectory      = ToolsDirectory.Combine("docfx");
        DocfxExeFile        = DocfxDirectory.CombineWithFilePath("docfx.exe");
        DocfxJsonFile       = DocsDirectory.CombineWithFilePath("docfx.json");
        TestOutputDirectory = RootDirectory.Combine("TestResults");

        ChangeLogDirectory    = RootDirectory.Combine("docs").Combine("changelog");
        ChangeLogGenDirectory = RootDirectory.Combine("docs").Combine("_changelog");

        SolutionFile         = RootDirectory.CombineWithFilePath("BenchmarkDotNet.sln");
        UnitTestsProjectFile = RootDirectory.Combine("tests").Combine("BenchmarkDotNet.Tests")
                               .CombineWithFilePath("BenchmarkDotNet.Tests.csproj");
        IntegrationTestsProjectFile = RootDirectory.Combine("tests").Combine("BenchmarkDotNet.IntegrationTests")
                                      .CombineWithFilePath("BenchmarkDotNet.IntegrationTests.csproj");
        TemplatesTestsProjectFile = RootDirectory.Combine("templates")
                                    .CombineWithFilePath("BenchmarkDotNet.Templates.csproj");
        AllPackableSrcProjects = new FilePathCollection(context.GetFiles(RootDirectory.FullPath + "/src/**/*.csproj")
                                                        .Where(p => !p.FullPath.Contains("Disassembler")));

        MsBuildSettings = new DotNetCoreMSBuildSettings
        {
            MaxCpuCount = 1
        };
        MsBuildSettings.WithProperty("UseSharedCompilation", "false");
    }
コード例 #4
0
 public static void Configure(ICakeContext context)
 {
     Context = context;
     StagingBranchPattern = "release-{0}";
     VersionTagPattern    = "v{0}";
     ReleaseTargetBranch  = context.Argument("release", "master");
     DevelopBranch        = context.Argument("dev", "develop");
     PushTarget           = context.Argument <string>("push", null);
 }
コード例 #5
0
ファイル: PublishActions.cs プロジェクト: plcode7/AutoCake
    public static void Configure(ICakeContext context)
    {
        Context    = context;
        Version    = Context.Argument("version", AutoConfigureVersion());
        ApiVersion = Context.Argument("api-version", AutoConfigureApiVersion());

        PushSettings.SymbolsApiKey = Context.Environment.GetEnvironmentVariable("NUGET_SYMBOLS_API_KEY");
        PushSettings.SymbolsSource = Context.Environment.GetEnvironmentVariable("NUGET_SYMBOLS_SOURCE");
        PushSettings.ApiKey        = Context.Environment.GetEnvironmentVariable("NUGET_API_KEY");
        PushSettings.Source        = Context.Environment.GetEnvironmentVariable("NUGET_SOURCE");
    }
コード例 #6
0
ファイル: build.cs プロジェクト: meadisu27/Dnn.Platform
    public Context(ICakeContext context)
        : base(context)
    {
        try
        {
            //////////////////////////////////////////////////////////////////////
            // ARGUMENTS
            //////////////////////////////////////////////////////////////////////

            this.target = context.Argument("target", "Default");
            context.Information($"Target: {target}");
            this.configuration = context.Argument("configuration", "Release");
            context.Information($"Configuration: {configuration}");

            //////////////////////////////////////////////////////////////////////
            // PREPARATION
            //////////////////////////////////////////////////////////////////////

            // Define directories.
            this.tempFolder = "./Temp/";
            this.tempDir    = context.Directory(tempFolder);
            context.Information($"TempDir: {tempDir}");

            this.artifactsFolder = "./Artifacts/";
            this.artifactsDir    = context.Directory(this.artifactsFolder);
            context.Information($"ArtifactsDir: {artifactsDir}");

            this.websiteFolder = "./Website/";
            this.websiteDir    = context.Directory(this.websiteFolder);
            context.Information($"WebsiteDir: {websiteDir}");

            // Global information variables
            this.isRunningInCI = false;

            this.dnnSolutionPath = "./DNN_Platform.sln";

            this.sqlDataProviderExists = false;

            var settingsFile = "../settings.local.json";
            this.Settings = this.LoadSettings(settingsFile);
            WriteSettings(settingsFile);

            this.buildId = context.EnvironmentVariable("BUILD_BUILDID") ?? "0";
            context.Information($"BuildId: {buildId}");
            this.buildNumber    = "";
            this.productVersion = "";
        }
        catch (Exception exc)
        {
            this.Error(exc);
            throw;
        }
    }
コード例 #7
0
ファイル: Context.cs プロジェクト: thabaum/Dnn.Platform
        /// <summary>Initializes a new instance of the <see cref="Context"/> class.</summary>
        /// <param name="context">The base context.</param>
        public Context(ICakeContext context)
            : base(context, RepositoryInfoProviderType.CakeGit)
        {
            try
            {
                //////////////////////////////////////////////////////////////////////
                // ARGUMENTS
                //////////////////////////////////////////////////////////////////////

                this.Target = context.Argument("target", "Default");
                context.Information($"Target: {this.Target}");
                this.BuildConfiguration = context.Argument("configuration", "Release");
                context.Information($"Configuration: {this.BuildConfiguration}");

                //////////////////////////////////////////////////////////////////////
                // PREPARATION
                //////////////////////////////////////////////////////////////////////

                // Define directories.
                this.TempFolder = "./Temp/";
                this.TempDir    = context.Directory(this.TempFolder);
                context.Information($"TempDir: {this.TempDir}");

                this.ArtifactsFolder = "./Artifacts/";
                this.ArtifactsDir    = context.Directory(this.ArtifactsFolder);
                context.Information($"ArtifactsDir: {this.ArtifactsDir}");

                this.WebsiteFolder = "./Website/";
                this.WebsiteDir    = context.Directory(this.WebsiteFolder);
                context.Information($"WebsiteDir: {this.WebsiteDir}");

                // Global information variables
                this.IsRunningInCI = false;

                this.DnnSolutionPath = "./DNN_Platform.sln";

                this.SqlDataProviderExists = false;

                const string settingsFile = "./settings.local.json";
                this.Settings = LoadSettings(context, settingsFile);
                this.WriteSettings(context, settingsFile);

                this.BuildId = context.EnvironmentVariable("BUILD_BUILDID") ?? "0";
                context.Information($"BuildId: {this.BuildId}");
                this.BuildNumber    = string.Empty;
                this.ProductVersion = string.Empty;
            }
            catch (Exception exc)
            {
                this.Error(exc);
                throw;
            }
        }
コード例 #8
0
        private static string EvaluateVariable(ICakeContext context, string variableName, bool hasDefaultValue, string defaultValue)
        {
            string envVariablename = EnvNameFromVariableName(variableName);

            string value;

            if (context.HasArgument(variableName))
            {
                value = context.Argument <string>(variableName);
            }
            else if (context.HasEnvironmentVariable(envVariablename))
            {
                value = context.EnvironmentVariable(envVariablename);
            }
            else
            {
                if (hasDefaultValue)
                {
                    return(defaultValue);
                }
                else
                {
                    throw new ArgumentException($"No argument found with name {variableName} and no environment variable found with name {envVariablename}!");
                }
            }

            return(value);
        }
コード例 #9
0
    public Context(ICakeContext context)
        : base(context)
    {
        BuildConfiguration = context.Argument("configuration", "Release");
        Runtime            = context.Argument("runtime", RuntimeEnvironment.GetRuntimeIdentifier());
        VersionSuffix      = context.Argument("version-suffix", string.Empty);

        var distFormat = context.Argument("dist-format", "zip").ToLowerInvariant();

        switch (distFormat)
        {
        case "bz":
        case "bz2":
        case "bzip":
        case "bzip2":
            DistributeFormat = DistributeFormat.BZip2;
            break;

        case "gz":
        case "gzip":
            DistributeFormat = DistributeFormat.GZip;
            break;

        // "z"
        // "zip"
        default:
            if (!string.IsNullOrEmpty(distFormat) && !new[] { "z", "zip" }.Contains(distFormat))
            {
                context.Log.Warning($"Invalid \"dist-format\" parameter. Assuming the default value \"{DistributeFormat.Zip}\"");
            }
            DistributeFormat = DistributeFormat.Zip;
            break;
        }

        var path = SearchBuildConfigFile();

        ConfigFile = !string.IsNullOrWhiteSpace(path)
            ? LoadBuildConfigFromFile(path)
            : ConfigFile.Default;

        ConfigFile.Ensure();

        BasePath = BasePath ?? Directory.GetCurrentDirectory();
    }
コード例 #10
0
    public BuildContext(ICakeContext context)
        : base(context)
    {
        BuildConfiguration = context.Argument("Configuration", "Release");
        SkipTests          = context.Argument("SkipTests", false);
        SkipSlowTests      = context.Argument("SkipSlowTests", false);

        RootDirectory       = new DirectoryPath(new DirectoryInfo(Directory.GetCurrentDirectory()).Parent.FullName);
        ArtifactsDirectory  = RootDirectory.Combine("artifacts");
        ToolsDirectory      = RootDirectory.Combine("tools");
        DocsDirectory       = RootDirectory.Combine("docs");
        DocfxDirectory      = ToolsDirectory.Combine("docfx");
        DocfxExeFile        = DocfxDirectory.CombineWithFilePath("docfx.exe");
        DocfxJsonFile       = DocsDirectory.CombineWithFilePath("docfx.json");
        TestOutputDirectory = RootDirectory.Combine("TestResults");

        ChangeLogDirectory    = RootDirectory.Combine("docs").Combine("changelog");
        ChangeLogGenDirectory = RootDirectory.Combine("docs").Combine("_changelog");

        SolutionFile         = RootDirectory.CombineWithFilePath("BenchmarkDotNet.sln");
        UnitTestsProjectFile = RootDirectory.Combine("tests").Combine("BenchmarkDotNet.Tests")
                               .CombineWithFilePath("BenchmarkDotNet.Tests.csproj");
        IntegrationTestsProjectFile = RootDirectory.Combine("tests").Combine("BenchmarkDotNet.IntegrationTests")
                                      .CombineWithFilePath("BenchmarkDotNet.IntegrationTests.csproj");
        TemplatesTestsProjectFile = RootDirectory.Combine("templates")
                                    .CombineWithFilePath("BenchmarkDotNet.Templates.csproj");
        AllPackableSrcProjects = new FilePathCollection(context.GetFiles(RootDirectory.FullPath + "/src/**/*.csproj")
                                                        .Where(p => !p.FullPath.Contains("Disassembler")));

        MsBuildSettings = new DotNetCoreMSBuildSettings
        {
            MaxCpuCount = 1
        };
        MsBuildSettings.WithProperty("UseSharedCompilation", "false");

        // NativeAOT build requires VS C++ tools to be added to $path via vcvars64.bat
        // but once we do that, dotnet restore fails with:
        // "Please specify a valid solution configuration using the Configuration and Platform properties"
        if (context.IsRunningOnWindows())
        {
            MsBuildSettings.WithProperty("Platform", "Any CPU");
        }
    }
コード例 #11
0
 public BuildContext(ICakeContext context)
     : base(context)
 {
     BuildConfiguration = context.Argument <string>("configuration", "Debug");
     DoClean            = context.HasArgument("clean");
     RepoDir            = context.Directory(System.Environment.CurrentDirectory);
     BuildDir           = RepoDir + context.Directory("build");
     PublishDir         = RepoDir + context.Directory("publish");
     SolutionFile       = RepoDir + context.File("Textrude.sln");
     Solution           = context.ParseSolution(SolutionFile);
 }
コード例 #12
0
    private static string?GetEnvironmentValueOrArgument(this ICakeContext context, string environmentVariable,
                                                        string argumentName)
    {
        var arg = context.EnvironmentVariable(environmentVariable);

        if (string.IsNullOrWhiteSpace(arg))
        {
            arg = context.Argument <string?>(argumentName, null);
        }

        return(arg);
    }
コード例 #13
0
        /// <summary>
        /// Gets argument value from Cake commandline.
        /// </summary>
        /// <param name="arg">Command Argument</param>
        /// <param name="context">Cake Context</param>
        /// <returns>Value as string if defined. Empty string if not defined.</returns>
        /// <example>
        /// <code>
        /// var newArg = CommandHelper.AddArgument("test", "t", "Testing stuff");
        /// var argVal = newArg.GetArgumentValue(Context)
        /// </code>
        /// </example>
        public static string GetArgumentValue(this ICommandArgument arg, ICakeContext context)
        {
            if (arg == null)
            {
                throw new ArgumentNullException(nameof(arg));
            }

            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var longArgValue = context.Argument(arg.Name, string.Empty);

            if (!string.IsNullOrWhiteSpace(longArgValue))
            {
                return(longArgValue);
            }

            var shortArgValue = context.Argument(arg.Shortname, string.Empty);

            return(shortArgValue);
        }
コード例 #14
0
        public static string Prompt(this ICakeContext context, string message)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var interactive = context.HasArgument(InteractiveOption) ?
                              context.Argument <bool>(InteractiveOption) :
                              false;

            Console.Write("{0}", message);
            return(Console.ReadLine());
        }
コード例 #15
0
        public BuildContext(ICakeContext context) : base(context)
        {
            this.MsBuildConfiguration = context.Argument("configuration", "Release");

            // walk backwards until git directory found - that's root
            var dir = new DirectoryPath(".");

            while (!context.GitIsValidRepository(dir))
            {
                dir = new DirectoryPath(Directory.GetParent(dir.FullPath).FullName);
            }

            context.Environment.WorkingDirectory = dir;
            this.Branch = context.GitBranchCurrent(".");
        }
コード例 #16
0
ファイル: CakeBuilder.cs プロジェクト: manju1794/CakePractice
        public static void buildTasks(this ICakeContext context)
        {
            OctopusDeployUrl            = "https://deploy.hhaexchange.com";
            Target                      = context.Argument("target", "OctoRelease");
            BuildNumber                 = context.ArgumentOrEnvironmentVariable("build.number", "", "0.0.1-local.0");
            OctopusDeployApiKey         = context.ArgumentOrEnvironmentVariable("OctopusDeployApiKey", "");
            MsBuildLogger               = context.ArgumentOrEnvironmentVariable("MsBuildLogger", "", "");
            ProjectName                 = context.ArgumentOrEnvironmentVariable("ProjectName", "", "ENT");
            ProcessesProjectName        = context.ArgumentOrEnvironmentVariable("ProcessesProjectName", "", "ENT Processes");
            APIProjectName              = context.ArgumentOrEnvironmentVariable("APIProjectName", "", "ENT.Internal.API");
            DeploymentBranches          = context.ArgumentOrEnvironmentVariable("DeploymentBranches", "", " ");
            TeamCityBuildAgentDirectory = context.ArgumentOrEnvironmentVariable("teamcity.agent.home.dir", "", "c:\\BuildAgent");
            NodeBackupPath              = TeamCityBuildAgentDirectory + "\\node_backup\\ENTP\\node_modules";
            BranchName                  = null;
            tenant                      = null;


            TaskBuild(context);
        }
コード例 #17
0
    public static string ArgOrEnv(this ICakeContext context, string prefix, string propertyName, string defaultValue = null)
    {
        var envName = _variableNameFormatter.FormatEnvironmentVariable(prefix, propertyName);
        var argName = _variableNameFormatter.FormatArgument(prefix, propertyName);

        if (context.HasEnvironmentVariable(envName))
        {
            return(context.EnvironmentVariable(envName));
        }
        if (context.HasArgument(argName))
        {
            return(context.Argument <string>(argName));
        }

        if (defaultValue == null)
        {
            throw new CakeException($"Could not find environment variable {envName} or argument {argName}");
        }

        return(defaultValue);
    }
コード例 #18
0
 public static DirectoryPath Coverage(this ICakeContext context)
 {
     return(DirectoryPath.FromString(context.Argument("coverage", "./coverage")).MakeAbsolute(context.Environment));
 }
コード例 #19
0
        public void Execute(IConfiguration configuration, StepType currentStep)
        {
            ICakeContext cake       = configuration.Context.CakeContext;
            CleanLevel   cleanLevel = CleanLevel.All;

            if (cake.HasArgument("no-clean"))
            {
                string   noCleanArgument = cake.Argument <string>("no-clean");
                string[] splitted        = noCleanArgument.ToLowerInvariant().Split('#');
                foreach (string s in splitted)
                {
                    switch (s)
                    {
                    case "binobj":
                        cleanLevel &= ~CleanLevel.BinObj;
                        break;

                    case "build":
                        cleanLevel &= ~CleanLevel.Build;
                        break;

                    case "artifacts":
                        cleanLevel &= ~CleanLevel.Artifacts;
                        break;

                    case "all":
                        cleanLevel &= ~CleanLevel.All;
                        break;

                    default:
                        configuration.Context.CakeContext.LogAndThrow($"no-clean option {s} is not supported, only binobj, build, artifacts and all are valid arguments");
                        break;
                    }
                }
            }

            if (cleanLevel.HasFlag(CleanLevel.Artifacts))
            {
                DirectoryPath directoryPath = configuration.GetSimple <DirectoryPath>(ConfigurationConstants.ARTIFACTS_PATH_KEY);
                cake.Log.Information($"Clean artifacts {directoryPath.FullPath}");
                if (cake.DirectoryExists(directoryPath))
                {
                    IDirectory directory = cake.FileSystem.GetDirectory(directoryPath);
                    directory.Delete(true);
                }
            }
            if (cleanLevel.HasFlag(CleanLevel.Build))
            {
                DirectoryPath directoryPath = configuration.GetSimple <DirectoryPath>(ConfigurationConstants.BUILD_PATH_KEY);
                cake.Log.Information($"Clean build {directoryPath.FullPath}");
                if (cake.DirectoryExists(directoryPath))
                {
                    IDirectory directory = cake.FileSystem.GetDirectory(directoryPath);
                    directory.Delete(true);
                }
            }
            if (cleanLevel.HasFlag(CleanLevel.BinObj))
            {
                DirectoryPath rootPath = configuration.GetSimple <DirectoryPath>(ConfigurationConstants.ROOT_PATH_KEY);
                cake.Log.Information($"Clean bin and obj in {rootPath.FullPath}");
                cake.DeleteDirectories(cake.GetDirectories(Path.Combine(rootPath.FullPath, "**/bin")), new DeleteDirectorySettings
                {
                    Force     = true,
                    Recursive = true
                });
                cake.DeleteDirectories(cake.GetDirectories(Path.Combine(rootPath.FullPath, "**/obj")), new DeleteDirectorySettings
                {
                    Force     = true,
                    Recursive = true
                });
            }
        }
コード例 #20
0
 public BuildContext(ICakeContext context)
     : base(context)
 {
     MsBuildConfiguration = context.Argument("configuration", "Release");
 }
コード例 #21
0
 public MyContext(ICakeContext context)
     : base(context)
 {
     //Force Release so Aero.Build can reference Aero.Cake and not a NuGet. context.Argument("configuration", "Release");
     BuildConfiguration = context.Argument(ArgumentNames.BuildConfiguration, "Release");
 }
コード例 #22
0
 public BuildContext(ICakeContext context)
     : base(context)
 {
     this.BuildConfiguration = context.Argument("configuration", "Release");
     this.BuildPlatform      = context.Argument("platform", "Any CPU");
 }
コード例 #23
0
ファイル: UnitTestActions.cs プロジェクト: plcode7/AutoCake
 public static void Configure(ICakeContext context)
 {
     Context   = context;
     SkipTests = Context.Argument("skiptests", false);
 }
コード例 #24
0
        public static void BuildConfigure(this ICakeContext context)
        {
            // Build args
            Build.Target =
                CoerceTarget(context.Argument("target", Build.Target));

            Build.Configuration =
                context.Argument("configuration", Build.Configuration);

            Build.Verbosity =
                context.Argument("verbosity", Build.Verbosity);

            Build.Local =
                context.Argument("local", Build.Local);

            // Check args
            Build.CheckStagedChanges =
                context.Argument("check-staged", Build.CheckStagedChanges);

            Build.CheckUncommittedChanges =
                context.Argument("check-uncommitted", Build.CheckUncommittedChanges);

            Build.CheckUntrackedFiles =
                context.Argument("check-untracked", Build.CheckUntrackedFiles);

            // Git args
            Build.GitRoot =
                context.GitFindRootFromPath(context.MakeAbsolute(context.Directory(".")));

            Build.GitUserName =
                context.Argument("git-username", Build.GitUserName);

            Build.GitEmail =
                context.Argument("git-email", Build.GitEmail);

            Build.GitRemoteName =
                context.Argument("git-remote", Build.GitRemoteName);

            Build.EnableCommits =
                context.Argument("enable-commits", Build.EnableCommits);

            Build.EnableTags =
                context.Argument("enable-tags", Build.EnableTags);

            Build.EnablePush =
                context.Argument("enable-push", Build.EnablePush);

            // NuGet args
            Build.NuGetSource =
                context.Argument(
                    "nuget-source",
                    context.EnvironmentVariable("NUGET_SOURCE") ?? Build.NuGetSource);

            Build.NuGetLocalSource =
                context.Argument(
                    "nuget-local-source",
                    context.EnvironmentVariable("NUGET_LOCAL_SOURCE") ?? Build.NuGetLocalSource);

            Build.NuGetApiKey =
                context.Argument("nuget-api-key", context.EnvironmentVariable("NUGET_API_KEY"));

            // Artefact args
            Build.ArtefactsRepository =
                context.Argument(
                    "artefacts-repo",
                    context.EnvironmentVariable("ARTEFACTS_REPO") ?? Build.ArtefactsRepository);

            Build.ArtefactsLocalRepository =
                context.Argument(
                    "artefacts-local-repo",
                    context.EnvironmentVariable("ARTEFACTS_LOCAL_REPO") ?? Build.ArtefactsLocalRepository);

            // Squirrel args
            Build.SquirrelCentralRepository =
                context.Argument(
                    "squirrel-repo",
                    context.EnvironmentVariable("SQUIRREL_REPO") ?? Build.SquirrelCentralRepository);

            Build.SquirrelLocalRepository =
                context.Argument(
                    "squirrel-local-repo",
                    context.EnvironmentVariable("SQUIRREL_LOCAL_REPO") ?? Build.SquirrelLocalRepository);
        }
コード例 #25
0
 public static string Configuration(this ICakeContext context)
 {
     return(context.Argument("configuration", "Debug"));
 }
コード例 #26
0
 public static string Target(this ICakeContext context)
 {
     return(context.Argument("target", "Build"));
 }
コード例 #27
0
 public static bool IsDryRun(this ICakeContext context)
 {
     return((context.Argument <bool?>("dryrun", false) ?? true) ||
            (context.Argument <bool?>("noop", false) ?? true) ||
            (context.Argument <bool?>("whatif", false) ?? true));
 }
コード例 #28
0
 public static DirectoryPath Artifacts(this ICakeContext context)
 {
     return(DirectoryPath.FromString(context.Argument("artifacts", "./artifacts")).MakeAbsolute(context.Environment));
 }