コード例 #1
0
        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
ファイル: ExecutionContext.cs プロジェクト: kauktus/appveyor
 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));
 }
コード例 #3
0
        public bool AreConditionsMetForJob(MatrixJob job)
        {
            if (job == null)
            {
                return(false);
            }

            if (!string.IsNullOrEmpty(OperatingSystem))
            {
                if (OperatingSystem != job.OperatingSystem)
                {
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(Configuration))
            {
                if (Configuration != job.Configuration)
                {
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(Platform))
            {
                if (Platform != job.Platform)
                {
                    return(false);
                }
            }

            if (Variables.Count > 0)
            {
                if (!Variables.All(v => job.Variables.Contains(v)))
                {
                    return(false);
                }
            }

            return(true);
        }