本文整理汇总了C#中ProjectManager.LoadProjectFile方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectManager.LoadProjectFile方法的具体用法?C# ProjectManager.LoadProjectFile怎么用?C# ProjectManager.LoadProjectFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectManager
的用法示例。
在下文中一共展示了ProjectManager.LoadProjectFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
projectManager.LoadProjectFile(ProjectFile, true);
return 0;
}
示例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;
}
示例3: 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;
}
示例4: 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("");
//.........这里部分代码省略.........