/// <summary> /// MSBuild コンテンツ プロジェクトをメモリ内にロードします。 /// </summary> /// <param name="rootElement">コンテンツ プロジェクト ファイル。</param> void LoadBuildProject(ProjectRootElement rootElement) { this.rootElement = rootElement; project = new Project(rootElement); project.SetProperty("XNAContentPipelineTargetProfile", "HiDef"); // ---------- test start //var projectInstance = project.CreateProjectInstance(); //BuildManager.DefaultBuildManager.BeginBuild(buildParameters); //var request = new BuildRequestData(project.CreateProjectInstance(), new string[] { "GetReferenceAssemblyPaths" }); //var submission = BuildManager.DefaultBuildManager.PendBuildRequest(request); //submission.ExecuteAsync(null, null); //// ビルド終了までスレッドを待機します。 //submission.WaitHandle.WaitOne(); //BuildManager.DefaultBuildManager.EndBuild(); // ---------- test end foreach (var item in project.GetItems("Reference")) { var reference = new Reference(this, item.EvaluatedInclude, item.GetMetadataValue("HintPath")); AddReference(reference); } var pipelineAssemblyPath = ResolveAssemblyPath(new AssemblyName(pipelineAssembyName)); if (!File.Exists(pipelineAssemblyPath)) { throw new FileNotFoundException("XNA content pipeline assembly not found.", pipelineAssemblyPath); } var pipelineAssembly = Assembly.LoadFrom(pipelineAssemblyPath); importerInfoRegistry.Register(pipelineAssembly); foreach (var item in project.GetItems("ProjectReference")) { var projectReference = new ProjectReference(this, item.EvaluatedInclude, item.GetMetadataValue("Project"), item.GetMetadataValue("Name")); AddProjectReference(projectReference); } processorInfoRegistry.Register(pipelineAssembly); }
public ProjectReferenceEdit(ProjectReference projectReference) { path = projectReference.Path; guid = projectReference.Guid; name = projectReference.Name; }
public void AddProjectReference(ProjectReference projectReference) { projectReferences.Add(projectReference); importerInfoRegistry.Register(projectReference); processorInfoRegistry.Register(projectReference); }