public void Execute()
        {
            MockBuild builder = new MockBuild();
            SandcastleEnviroment sandcastle = new SandcastleEnviroment();

            XslTransform task = new XslTransform();
            task.BuildEngine = builder;
            task.OutputFile = new TaskItem("reflection.xml");
            
            task.XsltFiles = TaskUtility.StringArrayToItemArray(
                Path.Combine(sandcastle.TransformsDirectory, "ApplyVSDocModel.xsl"),
                Path.Combine(sandcastle.TransformsDirectory, "AddFriendlyFilenames.xsl"));

            task.XmlFile = new TaskItem("reflection.org");

            task.Arguments = new string[] {
                "IncludeAllMembersTopic=true", 
                "IncludeInheritedOverloadTopics=true"
            };
            
            bool result = task.Execute();

            Assert.IsTrue(result);
        }
Beispiel #2
0
        //step 9
        private bool CreateHx()
        {
            Log.LogMessage("Creating html help 2.0 files.");

            string hxsTemplate = Path.Combine(
                SandcastleEnviroment.PresentationDirectory,
                @"shared\HxsTemplate");

            DirectoryInfo source = new DirectoryInfo(hxsTemplate);
            FileInfo[] files = source.GetFiles();
            foreach (FileInfo file in files)
            {
                file.CopyTo(Path.Combine(
                    OutputDirectory,
                    file.Name.Replace("template", HxName)));
            }

            string projectFile = Path.Combine(OutputDirectory, HxName + ".HxC");

            XslTransform xslt = new XslTransform();
            CopyBuildEngine(xslt);

            xslt.XmlFile = new TaskItem(TocFile);
            xslt.OutputFile = new TaskItem(projectFile);
            xslt.XsltFiles = new ITaskItem[] {
                new TaskItem(Path.Combine(
                    SandcastleEnviroment.TransformsDirectory, 
                    "CreateHxc.xsl"))
            };
            xslt.Arguments = new string[] { "fileNamePrefix=" + HxName };

            if (!xslt.Execute())
                return false;

            xslt = new XslTransform();
            CopyBuildEngine(xslt);

            xslt.XmlFile = new TaskItem(TocFile);
            xslt.OutputFile = new TaskItem(
                Path.Combine(OutputDirectory, HxName + ".HxT"));
            xslt.XsltFiles = new ITaskItem[] {
                new TaskItem(Path.Combine(
                    SandcastleEnviroment.TransformsDirectory, 
                    "TocToHxSContents.xsl"))
            };

            if (!xslt.Execute())
                return false;

            Log.LogMessage("Compiling html help 2.0 project '{0}'.",
                Path.GetFileName(projectFile));

            HxCompiler hx = new HxCompiler();
            CopyBuildEngine(hx);

            hx.ProjectFile = new TaskItem(projectFile);
            return hx.Execute();
        }
Beispiel #3
0
        //step 7
        private bool Toc()
        {
            Log.LogMessage("Creating help table of contents.");

            XslTransform xslt = new XslTransform();
            CopyBuildEngine(xslt);

            xslt.XmlFile = new TaskItem(ReflectionFile);
            xslt.OutputFile = new TaskItem(TocFile);

            if (TopicStyle == "prototype")
            {
                xslt.XsltFiles = new ITaskItem[] {
                    new TaskItem(Path.Combine(
                        SandcastleEnviroment.TransformsDirectory, 
                        "createPrototypetoc.xsl"))
                };
            }
            else
            {
                xslt.XsltFiles = new ITaskItem[] {
                    new TaskItem(Path.Combine(
                        SandcastleEnviroment.TransformsDirectory, 
                        "createvstoc.xsl"))
                };
            }


            return xslt.Execute();
        }
Beispiel #4
0
        //step 5
        private bool Manifest()
        {
            Log.LogMessage("Creating manifest from reflection data.");

            XslTransform xslt = new XslTransform();
            CopyBuildEngine(xslt);

            xslt.XmlFile = new TaskItem(ReflectionFile);

            xslt.OutputFile = new TaskItem(ManifestFile);

            xslt.XsltFiles = new ITaskItem[] {
                new TaskItem(Path.Combine(
                    SandcastleEnviroment.TransformsDirectory, 
                    "ReflectionToManifest.xsl"))
            };

            return xslt.Execute();
        }
Beispiel #5
0
        //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();
        }
Beispiel #6
0
        //step 9
        private bool CreateHx()
        {
            Log.LogMessage("Creating html help 2.0 files.");

            string hxsTemplate = Path.Combine(
                SandcastleEnviroment.PresentationDirectory,
                @"shared\HxsTemplate");

            DirectoryInfo source = new DirectoryInfo(hxsTemplate);

            FileInfo[] files = source.GetFiles();
            foreach (FileInfo file in files)
            {
                file.CopyTo(Path.Combine(
                                OutputDirectory,
                                file.Name.Replace("template", HxName)));
            }

            string projectFile = Path.Combine(OutputDirectory, HxName + ".HxC");

            XslTransform xslt = new XslTransform();

            CopyBuildEngine(xslt);

            xslt.XmlFile    = new TaskItem(TocFile);
            xslt.OutputFile = new TaskItem(projectFile);
            xslt.XsltFiles  = new ITaskItem[] {
                new TaskItem(Path.Combine(
                                 SandcastleEnviroment.TransformsDirectory,
                                 "CreateHxc.xsl"))
            };
            xslt.Arguments = new string[] { "fileNamePrefix=" + HxName };

            if (!xslt.Execute())
            {
                return(false);
            }

            xslt = new XslTransform();
            CopyBuildEngine(xslt);

            xslt.XmlFile    = new TaskItem(TocFile);
            xslt.OutputFile = new TaskItem(
                Path.Combine(OutputDirectory, HxName + ".HxT"));
            xslt.XsltFiles = new ITaskItem[] {
                new TaskItem(Path.Combine(
                                 SandcastleEnviroment.TransformsDirectory,
                                 "TocToHxSContents.xsl"))
            };

            if (!xslt.Execute())
            {
                return(false);
            }

            Log.LogMessage("Compiling html help 2.0 project '{0}'.",
                           Path.GetFileName(projectFile));

            HxCompiler hx = new HxCompiler();

            CopyBuildEngine(hx);

            hx.ProjectFile = new TaskItem(projectFile);
            return(hx.Execute());
        }
Beispiel #7
0
        //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());
        }