示例#1
0
        private static bool OnExecute(IEnumerable<string> files, IEnumerable<NuGetFramework> frameworks, BuildCommandApp args)
        {
            var builderCommandApp = args;
            var graphCollector = new ProjectGraphCollector(
                !builderCommandApp.ShouldSkipDependencies,
                (project, target) => args.Workspace.GetProjectContext(project, target));

            IEnumerable<ProjectContext> contexts;
            using (PerfTrace.Current.CaptureTiming(string.Empty, nameof(ResolveRootContexts)))
            {
                contexts = ResolveRootContexts(files, frameworks, args);
            }

            ProjectGraphNode[] graph;
            using (PerfTrace.Current.CaptureTiming(string.Empty, "Collect graph"))
            {
                graph = graphCollector.Collect(contexts).ToArray();
            }
            var builder = new DotNetProjectBuilder(builderCommandApp);
            return builder.Build(graph).ToArray().All(r => r != CompilationResult.Failure);
        }
示例#2
0
        private static bool OnExecute(IEnumerable <string> files, IEnumerable <NuGetFramework> frameworks, BuildCommandApp args)
        {
            var builderCommandApp = args;
            var graphCollector    = new ProjectGraphCollector(
                !builderCommandApp.ShouldSkipDependencies,
                (project, target) => args.Workspace.GetProjectContext(project, target));

            IEnumerable <ProjectContext> contexts;

            using (PerfTrace.Current.CaptureTiming(string.Empty, nameof(ResolveRootContexts)))
            {
                contexts = ResolveRootContexts(files, frameworks, args);
            }

            ProjectGraphNode[] graph;
            using (PerfTrace.Current.CaptureTiming(string.Empty, "Collect graph"))
            {
                graph = graphCollector.Collect(contexts).ToArray();
            }
            var builder = new DotNetProjectBuilder(builderCommandApp);

            return(builder.Build(graph).ToArray().All(r => r != CompilationResult.Failure));
        }