public void Execute() { MockBuild builder = new MockBuild(); MRefBuilder task = new MRefBuilder(); task.BuildEngine = builder; task.Assemblies = new TaskItem[] { new TaskItem(@"..\..\..\..\Libraries\ICSharpCode.SharpZipLib.dll") }; task.OutputFile = new TaskItem("reflection.org"); bool result = task.Execute(); Assert.IsTrue(result); }
//step 3 private bool Reflection() { Log.LogMessage("Creating reflection data."); ITaskItem reflectionItem = new TaskItem( Path.Combine(TopicStyleDirectory, "reflection.org")); MRefBuilder mref = new MRefBuilder(); CopyBuildEngine(mref); mref.Assemblies = WorkingAssemblies; mref.References = WorkingReferences; mref.OutputFile = reflectionItem; if (!mref.Execute()) return false; XslTransform xslt = new XslTransform(); CopyBuildEngine(xslt); xslt.XmlFile = reflectionItem; xslt.OutputFile = new TaskItem(ReflectionFile); if (TopicStyle == "prototype") { xslt.XsltFiles = new ITaskItem[] { new TaskItem(Path.Combine( SandcastleEnviroment.TransformsDirectory, "ApplyPrototypeDocModel.xsl")), new TaskItem(Path.Combine( SandcastleEnviroment.TransformsDirectory, "AddGuidFilenames.xsl")) }; } else { xslt.XsltFiles = new ITaskItem[] { new TaskItem(Path.Combine( SandcastleEnviroment.TransformsDirectory, "ApplyVSDocModel.xsl")), new TaskItem(Path.Combine( SandcastleEnviroment.TransformsDirectory, "AddFriendlyFilenames.xsl")) }; if (TopicStyle == "hana") xslt.Arguments = new string[] { "IncludeAllMembersTopic=false", "IncludeInheritedOverloadTopics=true" }; else xslt.Arguments = new string[] { "IncludeAllMembersTopic=true", "IncludeInheritedOverloadTopics=true" }; } return xslt.Execute(); }
//step 3 private bool Reflection() { Log.LogMessage("Creating reflection data."); ITaskItem reflectionItem = new TaskItem( Path.Combine(TopicStyleDirectory, "reflection.org")); MRefBuilder mref = new MRefBuilder(); CopyBuildEngine(mref); mref.Assemblies = WorkingAssemblies; mref.References = WorkingReferences; mref.OutputFile = reflectionItem; if (!mref.Execute()) { return(false); } XslTransform xslt = new XslTransform(); CopyBuildEngine(xslt); xslt.XmlFile = reflectionItem; xslt.OutputFile = new TaskItem(ReflectionFile); if (TopicStyle == "prototype") { xslt.XsltFiles = new ITaskItem[] { new TaskItem(Path.Combine( SandcastleEnviroment.TransformsDirectory, "ApplyPrototypeDocModel.xsl")), new TaskItem(Path.Combine( SandcastleEnviroment.TransformsDirectory, "AddGuidFilenames.xsl")) }; } else { xslt.XsltFiles = new ITaskItem[] { new TaskItem(Path.Combine( SandcastleEnviroment.TransformsDirectory, "ApplyVSDocModel.xsl")), new TaskItem(Path.Combine( SandcastleEnviroment.TransformsDirectory, "AddFriendlyFilenames.xsl")) }; if (TopicStyle == "hana") { xslt.Arguments = new string[] { "IncludeAllMembersTopic=false", "IncludeInheritedOverloadTopics=true" } } ; else { xslt.Arguments = new string[] { "IncludeAllMembersTopic=true", "IncludeInheritedOverloadTopics=true" } }; } return(xslt.Execute()); }