public ExecutionContext(
            MatrixJob currentJob,
            BuildConfiguration buildConfiguration,
            IPipelineOutputter outputter,
            string repositoryDirectory,
            ExpandableString cloneDirectory)
        {
            if (currentJob == null)
            {
                throw new ArgumentNullException(nameof(currentJob));
            }
            if (buildConfiguration == null)
            {
                throw new ArgumentNullException(nameof(buildConfiguration));
            }
            if (outputter == null)
            {
                throw new ArgumentNullException(nameof(outputter));
            }
            if (repositoryDirectory == null)
            {
                throw new ArgumentNullException(nameof(repositoryDirectory));
            }

            CurrentJob          = currentJob;
            BuildConfiguration  = buildConfiguration;
            Outputter           = outputter;
            RepositoryDirectory = repositoryDirectory;
            CloneDirectory      = cloneDirectory;
        }
示例#2
0
        public void Expand()
        {
            ExpandableString str = "this a string $(VAR1) and also $(VAR2)";

            Environment.SetEnvironmentVariable("VAR1", "VAR1_VALUE1");
            Environment.SetEnvironmentVariable("VAR2", "VAR2_VALUE2");

            str.Should().Be("this a string VAR1_VALUE1 and also VAR2_VALUE2");
        }
示例#3
0
        public void DontExpandVariablesWithInvalidCharacters()
        {
            ExpandableString str = "this a string $(VAR 1) and also $(VAR2)";

            Environment.SetEnvironmentVariable("VAR1", "VAR1_VALUE1");
            Environment.SetEnvironmentVariable("VAR2", "VAR2_VALUE2");

            str.Should().Be("this a string $(VAR 1) and also VAR2_VALUE2");
        }
示例#4
0
        public void DontExpandVariablesWhenOpenButNotClosingBrace()
        {
            ExpandableString str = "this a string $(VAR1 and also $(VAR2";

            Environment.SetEnvironmentVariable("VAR1", "VAR1_VALUE1");
            Environment.SetEnvironmentVariable("VAR2", "VAR2_VALUE2");

            str.Should().Be("this a string $(VAR1 and also $(VAR2");
        }
示例#5
0
文件: Build.cs 项目: kauktus/appveyor
 public Build(
     bool isAutomaticBuildOff,
     bool isParallel,
     ExpandableString solutionFile,
     BuildVerbosity verbosity)
 {
     IsAutomaticBuildOff = isAutomaticBuildOff;
     IsParallel          = isParallel;
     SolutionFile        = solutionFile;
     Verbosity           = verbosity;
 }
示例#6
0
 public AssemblyInfo(
     bool patch,
     ExpandableString file,
     ExpandableString assemblyVersion,
     ExpandableString assemblyFileVersion,
     ExpandableString assemblyInformationalVersion)
 {
     Patch                        = patch;
     File                         = file;
     AssemblyVersion              = assemblyVersion;
     AssemblyFileVersion          = assemblyFileVersion;
     AssemblyInformationalVersion = assemblyInformationalVersion;
 }
示例#7
0
 public ExecutionContext(
     MatrixJob currentJob,
     BuildConfiguration buildConfiguration,
     IPipelineOutputter outputter,
     string repositoryDirectory,
     ExpandableString cloneDirectory,
     IFileSystem fileSystem)
 {
     CurrentJob          = currentJob ?? throw new ArgumentNullException(nameof(currentJob));
     BuildConfiguration  = buildConfiguration ?? throw new ArgumentNullException(nameof(buildConfiguration));
     Outputter           = outputter ?? throw new ArgumentNullException(nameof(outputter));
     RepositoryDirectory = repositoryDirectory ?? throw new ArgumentNullException(nameof(repositoryDirectory));
     CloneDirectory      = cloneDirectory;
     FileSystem          = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));
 }
示例#8
0
 /// <summary>
 /// Initialise properties
 /// </summary>
 public void Init()
 {
     File             = new ExpandableString(@"%SystemRoot%\System32\winevt\Logs\" + LogName + ".evtx");
     EventMessageFile = new ExpandableString(@"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\EventLogMessages.dll"); // TODO: make this less hardcoded-hackier
 }