当前位置: 首页>>代码示例>>C#>>正文


C# ProjectManager.GetTargetFiles方法代码示例

本文整理汇总了C#中ProjectManager.GetTargetFiles方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectManager.GetTargetFiles方法的具体用法?C# ProjectManager.GetTargetFiles怎么用?C# ProjectManager.GetTargetFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProjectManager的用法示例。


在下文中一共展示了ProjectManager.GetTargetFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public override int Execute(string[] args)
        {
            bool parseSuccess = ParseArgs(args);
            if (!parseSuccess) {
                return -1;
            }

            if (!File.Exists(ProjectFile)) {
                Console.WriteLine("Error: file not found:");
                Console.WriteLine("    {0}", ProjectFile);
                return -1;
            }

            ProjectManager projectManager = new ProjectManager();
            Assembly assembly = projectManager.LoadProjectFile(ProjectFile, false);

            HashSet<Project> projects = projectManager.AddAllProjectsInAssembly(assembly, VariantString);

            BuildOptions buildOptions = new BuildOptions();
            buildOptions.MaxConcurrency = MaxConcurrency;
            buildOptions.ContinueOnError = ContinueOnError;
            buildOptions.FileDecider = new FileSizeDateDecider();
            buildOptions.ModuleNameRegex = ComputeModuleNameRegex(ModuleNameRegex, projects);
            ModifyOptions(buildOptions);

            HashSet<string> targetFiles;
            if (Targets.Count == 0) {
                var targets = projects.Select(project => project.DefaultTarget.Name).ToList();
                targetFiles = projectManager.GetTargetFiles(targets);
            }
            else {
                targetFiles = projectManager.GetTargetFiles(Targets);
            }

            BuildResults results = projectManager.BuildGraph.Execute(
                BuildAction,
                buildOptions,
                targetFiles,
                true);

            PrintBuildResults(buildOptions, results);
            return results.Success ? 0 : -1;
        }
开发者ID:fifoforlifo,项目名称:QRBuild,代码行数:43,代码来源:CLHandlerProject.cs

示例2: Execute

        // Override CLHandlerProject.Execute() with totally different implementation.
        public override int Execute(string[] args)
        {
            bool parseSuccess = ParseArgs(args);
            if (!parseSuccess) {
                return -1;
            }

            if (!File.Exists(ProjectFile)) {
                Console.WriteLine("Error: file not found:");
                Console.WriteLine("    {0}", ProjectFile);
                return -1;
            }

            ProjectManager projectManager = new ProjectManager();
            Assembly assembly = projectManager.LoadProjectFile(ProjectFile, false);

            HashSet<Project> projects = projectManager.AddAllProjectsInAssembly(assembly, VariantString);

            BuildOptions buildOptions = new BuildOptions();
            buildOptions.FileDecider = new FileSizeDateDecider();
            buildOptions.ModuleNameRegex = ComputeModuleNameRegex(
                ModuleNameRegex, projects);

            HashSet<string> targetPaths;
            if (Targets.Count == 0) {
                var targets = projects.Select(project => project.DefaultTarget.Name).ToList();
                targetPaths = projectManager.GetTargetFiles(targets);
            }
            else {
                targetPaths = projectManager.GetTargetFiles(Targets);
            }

            BuildProcess buildProcess =
                projectManager.BuildGraph.CreateBuildProcess(buildOptions, targetPaths);
            WriteSimpleDotFile(buildProcess);

            return 0;
        }
开发者ID:fifoforlifo,项目名称:QRBuild,代码行数:39,代码来源:CLHandlerGraphViz.cs

示例3: Execute

        // Override CLHandlerProject.Execute() with totally different implementation.
        public override int Execute(string[] args)
        {
            bool parseSuccess = ParseArgs(args);
            if (!parseSuccess) {
                return -1;
            }

            if (!File.Exists(ProjectFile)) {
                Console.WriteLine("Error: file not found:");
                Console.WriteLine("    {0}", ProjectFile);
                return -1;
            }

            ProjectManager projectManager = new ProjectManager();
            Assembly assembly = projectManager.LoadProjectFile(ProjectFile, false);

            HashSet<Project> projects = projectManager.AddAllProjectsInAssembly(assembly, VariantString);

            if (Verbosity >= 0) {
                Console.WriteLine("");

                string finalRegexString = ComputeModuleNameRegex(
                    ModuleNameRegex, projects);
                Regex moduleNameRegex = new Regex(finalRegexString);

                foreach (Project project in projects) {
                    bool isModuleMatch = moduleNameRegex.IsMatch(project.ModuleName);
                    if (!isModuleMatch && Verbosity < 1) {
                        continue;
                    }

                    Console.WriteLine("class {0}:", project.GetType().Name);
                    Console.WriteLine("  ModuleName          = {0}", project.ModuleName);
                    Console.WriteLine("  VariantStringFormat = {0}", project.Variant.GetVariantStringFormat());
                    Console.Write(project.Variant.GetVariantStringOptions("                        "));
                    Console.WriteLine("  DefaultTarget.Name  = {0}", project.DefaultTarget.Name);
                    int index = 0;
                    foreach (string subTarget in project.DefaultTarget.Targets) {
                        Console.WriteLine("    [{0,4}] = {1}", index, subTarget);
                        index++;
                    }
                }
            }

            if (Verbosity >= 1) {
                Console.WriteLine("");
                Console.WriteLine("All Target Files:");

                HashSet<string> targetFiles;
                if (Targets.Count == 0) {
                    var targets = projects.Select(project => project.DefaultTarget.Name).ToList();
                    targetFiles = projectManager.GetTargetFiles(targets);
                }
                else {
                    targetFiles = projectManager.GetTargetFiles(Targets);
                }
                int index = 0;
                foreach (string targetFile in targetFiles) {
                    Console.WriteLine("    [{0,4}] = {1}", index, targetFile);
                    index++;
                }
            }

            BuildOptions buildOptions = new BuildOptions();
            buildOptions.FileDecider = new FileSizeDateDecider();
            buildOptions.ModuleNameRegex = ComputeModuleNameRegex(
                ModuleNameRegex, projects);

            HashSet<string> targetPaths;
            if (Targets.Count == 0) {
                var targets = projects.Select(project => project.DefaultTarget.Name).ToList();
                targetPaths = projectManager.GetTargetFiles(targets);
            }
            else {
                targetPaths = projectManager.GetTargetFiles(Targets);
            }

            if (Verbosity >= 2) {
                HashSet<string> inputs, outputs;
                projectManager.BuildGraph.GetInputsAndOutputsForTargets(
                    buildOptions,
                    targetPaths,
                    out inputs,
                    out outputs);

                List<string> sortedInputs = new List<string>(inputs);
                sortedInputs.Sort();
                List<string> sortedOutputs = new List<string>(outputs);
                sortedOutputs.Sort();

                Console.WriteLine("");
                Console.WriteLine("Input Files:");
                int index = 0;
                foreach (string path in sortedInputs) {
                    Console.WriteLine("    [{0,4}] = {1}", index, path);
                    index++;
                }

                Console.WriteLine("");
//.........这里部分代码省略.........
开发者ID:fifoforlifo,项目名称:QRBuild,代码行数:101,代码来源:CLHandlerShow.cs


注:本文中的ProjectManager.GetTargetFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。