Exemple #1
0
        public DotNetProjectBuilder(BuildCommandApp args) : base(args.ShouldSkipDependencies)
        {
            _args = args;

            _preconditionManager = new IncrementalPreconditionManager(
                args.ShouldPrintIncrementalPreconditions,
                args.ShouldNotUseIncrementality,
                args.ShouldSkipDependencies);

            _compilerIOManager = new CompilerIOManager(
                args.ConfigValue,
                args.OutputValue,
                args.BuildBasePathValue,
                args.GetRuntimes(),
                args.Workspace
                );

            _incrementalManager = new IncrementalManager(
                this,
                _compilerIOManager,
                _preconditionManager,
                _args.ShouldSkipDependencies,
                _args.ConfigValue,
                _args.BuildBasePathValue,
                _args.OutputValue,
                BuildIncrementalArgumentList(_args)
                );

            _scriptRunner = new ScriptRunner();

            _commandFactory = new DotNetCommandFactory();
        }
Exemple #2
0
        private void MakeRunnable(ProjectGraphNode graphNode)
        {
            try
            {
                var runtimeContext = graphNode.ProjectContext.ProjectFile.HasRuntimeOutput(_args.ConfigValue) ?
                                     _args.Workspace.GetRuntimeContext(graphNode.ProjectContext, _args.GetRuntimes()) :
                                     graphNode.ProjectContext;

                var outputPaths     = runtimeContext.GetOutputPaths(_args.ConfigValue, _args.BuildBasePathValue, _args.OutputValue);
                var libraryExporter = runtimeContext.CreateExporter(_args.ConfigValue, _args.BuildBasePathValue);

                CopyCompilationOutput(outputPaths);

                var executable = new Executable(runtimeContext, outputPaths, libraryExporter, _args.ConfigValue);
                executable.MakeCompilationOutputRunnable();
            }
            catch (Exception e)
            {
                throw new Exception($"Failed to make the following project runnable: {graphNode.ProjectContext.GetDisplayName()} reason: {e.Message}", e);
            }
        }