private void CollectCompilerNamePreconditions(ProjectContext project, IncrementalPreconditions preconditions) { var projectCompiler = CompilerUtil.ResolveCompilerName(project); if (KnownCompilers.Any(knownCompiler => knownCompiler.Equals(projectCompiler, StringComparison.Ordinal))) { preconditions.AddUnknownCompilerPrecondition(project.ProjectName(), projectCompiler); } }
private void CollectCheckPathProbingPreconditions(ProjectContext project, IncrementalPreconditions preconditions) { var pathCommands = CompilerUtil.GetCommandsInvokedByCompile(project) .Select(commandName => Command.CreateDotNet(commandName, Enumerable.Empty <string>(), project.TargetFramework)) .Where(c => c.ResolutionStrategy.Equals(CommandResolutionStrategy.Path)); foreach (var pathCommand in pathCommands) { preconditions.AddPathProbingPrecondition(project.ProjectName(), pathCommand.CommandName); } }
private void CollectCheckPathProbingPreconditions(ProjectContext project, IncrementalPreconditions preconditions) { var pathCommands = CompilerUtil.GetCommandsInvokedByCompile(project) .Select(commandName => Command.CreateDotNet(commandName, Enumerable.Empty<string>(), project.TargetFramework)) .Where(c => c.ResolutionStrategy.Equals(CommandResolutionStrategy.Path)); foreach (var pathCommand in pathCommands) { preconditions.AddPathProbingPrecondition(project.ProjectName(), pathCommand.CommandName); } }
private void CheckPathProbing(ProjectContext project, IncrementalPreconditions preconditions) { var pathCommands = CompilerUtil.GetCommandsInvokedByCompile(project) .Select(commandName => Command.Create(commandName, "", project.TargetFramework)) .Where(c => Command.CommandResolutionStrategy.Path.Equals(c.ResolutionStrategy)); foreach (var pathCommand in pathCommands) { preconditions.AddPathProbingPrecondition(project.ProjectName(), pathCommand.CommandName); } }
private void CollectCompilerNamePreconditions(ProjectContext project, IncrementalPreconditions preconditions) { if (project.ProjectFile != null) { var projectCompiler = project.ProjectFile.CompilerName; if (!KnownCompilers.Any(knownCompiler => knownCompiler.Equals(projectCompiler, StringComparison.Ordinal))) { preconditions.AddUnknownCompilerPrecondition(project.ProjectName(), projectCompiler); } } }
private void CollectCompilerNamePreconditions(ProjectContext project, IncrementalPreconditions preconditions) { if (project.ProjectFile != null) { var compilerOptions = project.ProjectFile.GetCompilerOptions(project.TargetFramework, null); var projectCompiler = compilerOptions.CompilerName; if (!KnownCompilers.Any(knownCompiler => knownCompiler.Equals(projectCompiler, StringComparison.Ordinal))) { preconditions.AddUnknownCompilerPrecondition(project.ProjectName(), projectCompiler); } } }
public CompileContext(ProjectContext rootProject, BuilderCommandApp args) { _rootProject = rootProject; // Cleaner to clone the args and mutate the clone than have separate CompileContext fields for mutated args // and then reasoning which ones to get from args and which ones from fields. _args = (BuilderCommandApp)args.ShallowCopy(); // Set up dependencies _rootProjectDependencies = new ProjectDependenciesFacade(_rootProject, _args.ConfigValue); // gather preconditions _preconditions = GatherIncrementalPreconditions(); }
public CompileContext(ProjectContext rootProject, BuilderCommandApp args) { _rootProject = rootProject; // Cleaner to clone the args and mutate the clone than have separate CompileContext fields for mutated args // and then reasoning which ones to get from args and which ones from fields. _args = (BuilderCommandApp)args.ShallowCopy(); // Set up dependencies _rootProjectDependencies = new ProjectDependenciesFacade(_rootProject, _args.ConfigValue); // gather preconditions _preconditions = GatherIncrementalPreconditions(); }
private void CollectScriptPreconditions(ProjectContext project, IncrementalPreconditions preconditions) { var preCompileScripts = project.ProjectFile.Scripts.GetOrEmpty(ScriptNames.PreCompile); var postCompileScripts = project.ProjectFile.Scripts.GetOrEmpty(ScriptNames.PostCompile); if (preCompileScripts.Any()) { preconditions.AddPrePostScriptPrecondition(project.ProjectName(), ScriptNames.PreCompile); } if (postCompileScripts.Any()) { preconditions.AddPrePostScriptPrecondition(project.ProjectName(), ScriptNames.PostCompile); } }
private IncrementalPreconditions GatherIncrementalPreconditions() { var preconditions = new IncrementalPreconditions(_args.BuildProfileValue); var projectsToCheck = GetProjectsToCheck(); foreach (var project in projectsToCheck) { CollectScriptPreconditions(project, preconditions); CollectCompilerNamePreconditions(project, preconditions); CheckPathProbing(project, preconditions); } return(preconditions); }
public CompileContext(ProjectContext rootProject, BuilderCommandApp args) { _rootProject = rootProject; _args = args; // Set up Output Paths. They are unique per each CompileContext // Todo: clone args and mutate the clone so the rest of this class does not have special treatment for output paths _outputPath = _rootProject.GetOutputPath(_args.ConfigValue, _args.OutputValue); _intermediateOutputPath = _rootProject.GetIntermediateOutputPath(_args.ConfigValue, _args.IntermediateValue, _args.OutputValue); // Set up dependencies _dependencies = GetProjectDependenciesWithSources(_rootProject, _args.ConfigValue); //gather preconditions _preconditions = GatherIncrementalPreconditions(); }
public CompileContext(ProjectContext rootProject, BuilderCommandApp args) { _rootProject = rootProject; _args = args; // Set up Output Paths. They are unique per each CompileContext // Todo: clone args and mutate the clone so the rest of this class does not have special treatment for output paths _outputPath = _rootProject.GetOutputPath(_args.ConfigValue, _args.OutputValue); _intermediateOutputPath = _rootProject.GetIntermediateOutputPath(_args.ConfigValue, _args.IntermediateValue, _args.OutputValue); // Set up dependencies _dependencies = GetProjectDependenciesWithSources(_rootProject, _args.ConfigValue); //gather preconditions _preconditions = GatherIncrementalPreconditions(); }
private void CollectScriptPreconditions(ProjectContext project, IncrementalPreconditions preconditions) { if (project.ProjectFile != null) { var preCompileScripts = project.ProjectFile.Scripts.GetOrEmpty(ScriptNames.PreCompile); var postCompileScripts = project.ProjectFile.Scripts.GetOrEmpty(ScriptNames.PostCompile); if (preCompileScripts.Any()) { preconditions.AddPrePostScriptPrecondition(project.ProjectName(), ScriptNames.PreCompile); } if (postCompileScripts.Any()) { preconditions.AddPrePostScriptPrecondition(project.ProjectName(), ScriptNames.PostCompile); } } }
public CompileContext(ProjectContext rootProject, BuilderCommandApp args) { _rootProject = rootProject; // Cleaner to clone the args and mutate the clone than have separate CompileContext fields for mutated args // and then reasoning which ones to get from args and which ones from fields. _args = (BuilderCommandApp) args.ShallowCopy(); // Set up Output Paths. They are unique per each CompileContext _args.OutputValue = _rootProject.GetOutputPath(_args.ConfigValue, _args.OutputValue); _args.IntermediateValue = _rootProject.GetIntermediateOutputPath(_args.ConfigValue, _args.IntermediateValue, _args.OutputValue); // Set up dependencies _dependencies = new ProjectDependenciesFacade(_rootProject, _args.ConfigValue); // gather preconditions _preconditions = GatherIncrementalPreconditions(); }
public CompileContext(ProjectContext rootProject, BuilderCommandApp args) { _rootProject = rootProject; // Cleaner to clone the args and mutate the clone than have separate CompileContext fields for mutated args // and then reasoning which ones to get from args and which ones from fields. _args = (BuilderCommandApp)args.ShallowCopy(); // Set up Output Paths. They are unique per each CompileContext _args.OutputValue = _rootProject.GetOutputPath(_args.ConfigValue, _args.OutputValue); _args.IntermediateValue = _rootProject.GetIntermediateOutputPath(_args.ConfigValue, _args.IntermediateValue, _args.OutputValue); // Set up dependencies _dependencies = new ProjectDependenciesFacade(_rootProject, _args.ConfigValue); // gather preconditions _preconditions = GatherIncrementalPreconditions(); }
private IncrementalPreconditions GatherIncrementalPreconditions() { var preconditions = new IncrementalPreconditions(_args.ShouldPrintIncrementalPreconditions); if (_args.ShouldNotUseIncrementality) { preconditions.AddForceUnsafePrecondition(); } var projectsToCheck = GetProjectsToCheck(); foreach (var project in projectsToCheck) { CollectScriptPreconditions(project, preconditions); CollectCompilerNamePreconditions(project, preconditions); CollectCheckPathProbingPreconditions(project, preconditions); } return(preconditions); }
public IncrementalPreconditions GetIncrementalPreconditions(ProjectGraphNode projectNode) { IncrementalPreconditions preconditions; if (_preconditions.TryGetValue(projectNode.ProjectContext.Identity, out preconditions)) { return preconditions; } preconditions = new IncrementalPreconditions(_printPreconditions); if (_forceNonIncremental) { preconditions.AddForceUnsafePrecondition(); } var project = projectNode.ProjectContext; CollectScriptPreconditions(project, preconditions); CollectCompilerNamePreconditions(project, preconditions); CollectCheckPathProbingPreconditions(project, preconditions); _preconditions[projectNode.ProjectContext.Identity] = preconditions; return preconditions; }
public IncrementalPreconditions GetIncrementalPreconditions(ProjectGraphNode projectNode) { IncrementalPreconditions preconditions; if (_preconditions.TryGetValue(projectNode.ProjectContext.Identity, out preconditions)) { return(preconditions); } preconditions = new IncrementalPreconditions(_printPreconditions); if (_forceNonIncremental) { preconditions.AddForceUnsafePrecondition(); } var project = projectNode.ProjectContext; CollectScriptPreconditions(project, preconditions); CollectCompilerNamePreconditions(project, preconditions); CollectCheckPathProbingPreconditions(project, preconditions); _preconditions[projectNode.ProjectContext.Identity] = preconditions; return(preconditions); }
private IncrementalPreconditions GatherIncrementalPreconditions() { var preconditions = new IncrementalPreconditions(_args.BuildProfileValue); if (_args.ForceUnsafeValue) { preconditions.AddForceUnsafePrecondition(); } var projectsToCheck = GetProjectsToCheck(); foreach (var project in projectsToCheck) { CollectScriptPreconditions(project, preconditions); CollectCompilerNamePreconditions(project, preconditions); CollectCheckPathProbingPreconditions(project, preconditions); } return preconditions; }
private void CollectCompilerNamePreconditions(ProjectContext project, IncrementalPreconditions preconditions) { var projectCompiler = CompilerUtil.ResolveCompilerName(project); if (!KnownCompilers.Any(knownCompiler => knownCompiler.Equals(projectCompiler, StringComparison.Ordinal))) { preconditions.AddUnknownCompilerPrecondition(project.ProjectName(), projectCompiler); } }
private void CheckPathProbing(ProjectContext project, IncrementalPreconditions preconditions) { var pathCommands = CompilerUtil.GetCommandsInvokedByCompile(project) .Select(commandName => Command.Create(commandName, "", project.TargetFramework)) .Where(c => Command.CommandResolutionStrategy.Path.Equals(c.ResolutionStrategy)); foreach (var pathCommand in pathCommands) { preconditions.AddPathProbingPrecondition(project.ProjectName(), pathCommand.CommandName); } }