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; }
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"); }
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"); }
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"); }
public Build( bool isAutomaticBuildOff, bool isParallel, ExpandableString solutionFile, BuildVerbosity verbosity) { IsAutomaticBuildOff = isAutomaticBuildOff; IsParallel = isParallel; SolutionFile = solutionFile; Verbosity = verbosity; }
public AssemblyInfo( bool patch, ExpandableString file, ExpandableString assemblyVersion, ExpandableString assemblyFileVersion, ExpandableString assemblyInformationalVersion) { Patch = patch; File = file; AssemblyVersion = assemblyVersion; AssemblyFileVersion = assemblyFileVersion; AssemblyInformationalVersion = assemblyInformationalVersion; }
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)); }
/// <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 }