Skip to content

Commit

Permalink
VS2022 and .NET Core Build Support (#874)
Browse files Browse the repository at this point in the history
* Major overhaul to support both .NET Framework and .NET Core builds

Significant breaking changes were made to support both .NET Framework (MSBuild.exe) and .NET Core (dotnet.exe) builds.
- Updated all but the VSIX package and MPF projects to the new SDK project format.
- Made updates throughout the code base to fix code analysis issues and to use current language syntax features.
- Consolidated the SHFB and Sandcastle tools projects into a single solution file.  The VSIX package still has its own solution file for now.
- Consolidated the code into common namespaces and merged the SHFB build components into the main build components project.
- Updated all tool projects to target .NET 4.7.2 and .NETCoreApp 3.1.  The latter allows for builds using the dotnet.exe tool.  The core libraries, build components, plug-ins, and presentation styles target .NETStandard 2.0 so that they are universal.
- Restructured the tools folders to allow for the tool version and platform-specific code to be cleanly separated.
- Separated Windows platform-specific code out into separate assemblies.  The Sandcastle.Platform.Windows assembly contains the shared code.  Reworked all build components and plug-ins to separate the configuration UIs into separate Windows platform-specific assemblies.  This allows the components themselves to be used with both .NET Framework and .NET Core builds while allowing the IDEs to still configure them interactively.
- All build tasks were moved from SandcastleBuilder.Utils to their own assembly (SandcastleBuilder.MSBuild).
- The AddNamespaceGroups tool was removed.  The code was merged into the build engine under a new build step (BuildStep.AddNamespaceGroups).
- The standalone VersionBuilder tool was removed and the code from it was merged into the related plug-in were it runs directly now at build time.
- The XslTransform tool and the related production XSL transformations were removed.  The XSL transformation code was moved into the build engine in three new build steps.  BuildStep.ApplyDocumentModel handles the ApplyVsDocModel.xsl code, BuildStep.AddApiTopicFilenames handles the AddFilenames.xsl code, and BuildStep.GenerateApiTopicManifest handles the ReflectionToManifest.xsl code.  Along with BuildStep.AddNamespaceGroups, these new build steps replace BuildStep.TransformReflectionInfo which was removed.  The code in CreateVSToc.xsl is handled by new code in the build engine that runs under the existing build step BuildStep.GenerateIntermediateTableOfContents.  These changes should allow for better extensibility of the related build steps in the future.
- Updated all presentation styles to use the code-based interfaces for applying the document model to the reflection information file and generating the intermediate table of contents.  These replace the old properties that specified the related XSL transformations to use.  Custom presentation styles are free to use the default implementations or supply their own.  It is also now possible for plug-ins to replace them at runtime as long as the replacements meet the requirements of the presentation style.
- Removed the GenerateHelpFormatTableOfContents and GenerateHelpFileIndex build steps as they effectively did nothing anymore.
- Removed the BuildAssembler build components DisplayComponent, InheritDocumentationComponent, PlatformsComponent, SnippetComponent, TaskGrabberComponent, and ValidateComponent as they were never used.
- The AjaxDoc plug-in has been deprecated.  AjaxDoc itself has been deprecated in favor of JSDoc.  The plug-in is also dependent on Windows platform-specific features and cannot be used with .NET Core builds.
- All build component and plug-in configuration forms were updated to use WPF for better high DPI scaling support on 4K displays (#344).  The standalone GUI hosts all of the WPF controls and UI forms but is a Windows Forms application at its core.  That probably won't change anytime soon.

New folder structure under SHFBROOT:
- The root folder only contains the Sandcastle Help File Builder MSBuild targets file.
- Components - Contains build components, plug-ins, and presentation style related files.
- Data - Contains the framework reflection information files.
- Extras - Contains optional tools that are not part of Sandcastle or SHFB such as the HTML to MAML converter and the web project code providers.
- Help - Contains the Help 1 (CHM) help files.
- net472 - Contains the .NET Framework build tools for MSBuild.exe.
- netcoreapp3.1 - Contains the .NET Core build tools for dotnet.exe.
- Schemas - Contains the XML schemas for the reflection data file and the MAML topic files.
- Snippets - Contains Visual Studio snippet files used to insert common block and inline MAML elements.
- Templates - Contains template project files used by the build tools.
- Tools - Contains the Windows platform specific tools (reflection data manager, standalone GUI, SHFB project launcher, and help library manager launcher).

Current Known Issues and Limitations
- The Visual Studio project templates for components, plug-ins, and presentation styles need updating to match the new format that separates the platform-specific UI configuration code into its own assembly.  For now, they will not work at all if you create new projects from them.  You will need to manually fix them to separate the UI code and use the new structure.  Any existing build components, plug-ins, and presentation styles will also need updating to work with the new system.  Information on porting them will be provided at a later date.
- The XSL transform in the Completion Notification plug-in currently fails on .NET Core probably because script code is not supported.
- Data caches built using the .NET Framework ESent and SQL cached data components cannot be used by the .NET Core versions of the same components and vice versa due to differences in the serialized framework types.  May need to introduce separate caches based on the build type.
- The ESent cached data components are not currently working under .NET Core due to some non-serializable types.
- The SQL cached data components are not currently working under .NET Core due to System.Data.SqlClient not being supported.  It probably needs to be switched to Microsoft.Data.SqlClient.
- The help file is now out of date with regard to all of the above changes.  It will be updated at a later date to reflect the new functionality.

* Template project updates and NuGet support

- Updated all template projects so that they work with the updated build engine.
- Updated all template projects so that they use the new SDK format and generate their output as NuGet packages.  This makes them easier to find and use and no longer requires a common component path setting be used in the help file builder projects to locate them.
- Updated the standalone GUI and Visual Studio package to support adding package references to help file builder projects for build components, plug-ins, presentation styles, and syntax generators interactively with a search dialog box .  The component packages are shown in a separate node in the project/solution explorer tool window.
- Updated the build engine to search for build components, plug-ins, presentation styles, and syntax generators added to the project as NuGet packages by looking for their SHFBComponentPath items.

* Minor update

Minor update to package code to use more up to date APIs for main window handle and solution events.

* Minor updates to prepare for VS2022 support

* Changes to prepare for VS2022 support

* VS2022 support MPF project refactoring

- Moved the common MPF project code into a shared project.
- Added MPFProj_VS2022.

* VS2022 support VSIX project refactory

- Moved the common VSIX project code into a shared project.
- Added the SandcastleBuilderPackage_VS2022 project.

* Installer updates

- Updated the VSIX package to install the MAML schemas.
- Updated the guided installer to support the VS2022 package and VSIX MAML schemas.
- Added the HTML Help Workshop installer to the project for use by the guided installer as the official download seems to be permanently broken.

* Updates and fixes for test deployment

* Doc updates and minor fixes for issues found during testing

* Template project fixes

- Reworked how the project and project item template files are included in the package projects so that the VS2022 project can used linked items.
- Added a hack so that the root container added to the Add New Item dialog in VS2019 and VS2022 shows "Documentation" rather than "Token File".
- VS2022 is doing something odd with selected item icons.  As such, I modified the folder icons shown in the Solution Explorer so that they look a little better in VS2022 when selected in the Dark and Light themes.
- Fixed some spelling errors in the MAML schemas.

* Documentation updates

* Minor fixes and new visibility option and transform option

- Added a new visibility option to exclude internal members in other assemblies and private members of base types.
- Fixed F# parameter with a single quote causing BuildAssembler to crash.
- Fixed sitemap API content placement not working.
- Added a new logoUrl transform argument property to the VS2010 and VS2013 presentation styles.  This allows you to specify a URL to navigate to when the logo is clicked.

* Documentation updates

* Documentation updates
  • Loading branch information
EWSoftware committed Oct 30, 2021
1 parent 84082c3 commit 64ecc94
Show file tree
Hide file tree
Showing 1,537 changed files with 213,493 additions and 215,017 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -10,6 +10,7 @@ StyleCop.Cache
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
launchSettings.json

# Build results
[Dd]ebug/
Expand All @@ -18,6 +19,7 @@ _ReSharper*/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
Expand Down Expand Up @@ -65,6 +67,7 @@ UpgradeLog*.XML
UpgradeLog*.htm

# Non-distributable and private local stuff
Deployment/
NonDist/
/SHFB/Source/Setup/Temp/

Expand Down
25 changes: 15 additions & 10 deletions Deployment/InstallerConfiguration.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!-- This indicates the version of Sandcastle with which this installer is associated.-->
<sandcastle version="v2021.4.9.0" />
<!-- This indicates the tools version with which this installer is associated.-->
<tools version="2021.10.23.0" />

<!-- Define the installer pages. Third-party build tool and component providers can add new pages that
they have created to install their own products as well. -->
Expand All @@ -13,24 +13,29 @@
<page type="Sandcastle.Installer.InstallerPages.WelcomePage" />

<page type="Sandcastle.Installer.InstallerPages.WhatsNewPage">
<whatsNew url="https://EWSoftware.github.io/SHFB/html/52c2409d-0a0a-4b6e-bd0a-5d2b03d1d332.htm"
description="Sandcastle Help File Builder and Tools v2021.4.9.0 Release Notes" />
<whatsNew url="https://EWSoftware.github.io/SHFB/html/003c85ec-45ad-4123-a31d-fd63a695b1f3.htm"
description="Current Version Release Notes" />
<whatsNew url="https://EWSoftware.github.io/SHFB/html/bc933f8f-e792-45bf-afec-62aa2c46aa3b.htm"
description="Third-Party Component Migration Support" />
</page>

<page type="Sandcastle.Installer.InstallerPages.HelpFileFormatsPage">
<page type="Sandcastle.Installer.InstallerPages.Help1CompilerPage" />
</page>

<page type="Sandcastle.Installer.InstallerPages.SandcastleHelpFileBuilderPage"
shfbVersion="2021.4.9.0" installerName="SandcastleHelpFileBuilder.msi"/>
installerName="SandcastleHelpFileBuilder.msi"/>

<page type="Sandcastle.Installer.InstallerPages.SHFBVisualStudioPackagePage"
packageGuid="c997d569-ee8e-4947-a46f-9a0717ce39a0">
<package name="SHFBVisualStudioPackage_VS2017AndLater.vsix" supportedVersions="15,16" />
<page type="Sandcastle.Installer.InstallerPages.SHFBVisualStudioPackagePage">
<package name="SHFBVisualStudioPackage_VS2017AndLater.vsix"
id="c997d569-ee8e-4947-a46f-9a0717ce39a0" supportedVersions="15,16" />
<package name="SHFBVisualStudioPackage_VS2022AndLater.vsix"
id="SHFB.A8C96335-DAF7-4D30-89E2-B004400E4525" supportedVersions="17" />

<page type="Sandcastle.Installer.InstallerPages.MamlIntelliSensePage" supportedVersions="15,16,17" />
<page type="Sandcastle.Installer.InstallerPages.MamlSnippetsPage" supportedVersions="15,16,17" />
</page>

<page type="Sandcastle.Installer.InstallerPages.MamlIntelliSensePage" supportedVersions="15,16" />
<page type="Sandcastle.Installer.InstallerPages.MamlSnippetsPage" supportedVersions="15,16" />
<page type="Sandcastle.Installer.InstallerPages.VisualStudioSpellCheckerPage" />
<page type="Sandcastle.Installer.InstallerPages.ExtendedDocCommentsProviderPage" />
<page type="Sandcastle.Installer.InstallerPages.CompletionPage" />
Expand Down
8 changes: 2 additions & 6 deletions Documentation/AllDocumentation.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2003
# Visual Studio Version 16
VisualStudioVersion = 16.0.31424.327
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{21CF8CF5-DA35-41C6-B04F-B307C0CA80B1}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -24,8 +24,6 @@ Project("{7CF6DF6D-3B04-46F8-A40B-537D21BCA0B4}") = "EWSoftwareCodeDom", "..\SHF
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLCommentsExamples", "..\SHFB\Source\XMLCommentsExamples\XMLCommentsExamples.csproj", "{46157C34-C925-4733-8682-957F3D97345A}"
EndProject
Project("{7CF6DF6D-3B04-46F8-A40B-537D21BCA0B4}") = "ReferenceLinks", "SandcastleBuilder\ReferenceLinks.shfbproj", "{F3891797-F0B5-4B49-95F0-03F0D292A399}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -56,8 +54,6 @@ Global
{46157C34-C925-4733-8682-957F3D97345A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46157C34-C925-4733-8682-957F3D97345A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46157C34-C925-4733-8682-957F3D97345A}.Release|Any CPU.Build.0 = Release|Any CPU
{F3891797-F0B5-4B49-95F0-03F0D292A399}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3891797-F0B5-4B49-95F0-03F0D292A399}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 2 additions & 0 deletions Documentation/AllDocumentation.sln.vsspell
Expand Up @@ -15,6 +15,7 @@
<Ignore>ctor</Ignore>
<Ignore>ddue</Ignore>
<Ignore>de</Ignore>
<Ignore>dotnet</Ignore>
<Ignore>endregion</Ignore>
<Ignore>filterpriority</Ignore>
<Ignore>inheritdoc</Ignore>
Expand All @@ -32,4 +33,5 @@
<InheritExclusionExpressions>True</InheritExclusionExpressions>
<InheritIgnoredFilePatterns>True</InheritIgnoredFilePatterns>
<InheritXmlSettings>True</InheritXmlSettings>
<IgnoredWordsFile></IgnoredWordsFile>
</SpellCheckerConfiguration>
2 changes: 1 addition & 1 deletion Documentation/SandcastleBuilder/CommonTokens.tokens
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<content xml:space="preserve" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<item id="BuildDate">{@BuildDate:MMMM d, yyyy}</item>
<item id="SandcastleVersion">v2021.4.9.0</item>
<item id="SHFB"><ddue:externalLink xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5">
<ddue:linkText>Sandcastle Help File Builder</ddue:linkText>
<ddue:linkUri>https://GitHub.com/EWSoftware/SHFB</ddue:linkUri>
<ddue:linkTarget>_blank</ddue:linkTarget>
</ddue:externalLink></item>
<item id="SandcastleVersion">v2021.10.23.0</item>
<item id="VisualStudioMinVersion">Visual Studio 2017</item>
</content>
49 changes: 9 additions & 40 deletions Documentation/SandcastleBuilder/Content/BenefitsAndFeatures.aml
Expand Up @@ -54,9 +54,9 @@ feature is available as well with support for ASP.NET, PHP, and client-side scri

<listItem>
<para>The project settings are saved in a standard MSBuild-format project file and can be built from
within the standalone GUI, from the command line using <application>MSBuild</application>, or in a post-build
step for a Visual Studio project that runs <application>MSBuild</application>. Support for full Visual Studio
integration is also available with the above mentioned extension package.</para>
within the standalone GUI, from the command line using <application>MSBuild</application> or <application>dotnet
build</application>, or in a post-build step for a Visual Studio project that runs <application>MSBuild</application>.
Support for full Visual Studio integration is also available with the above mentioned extension package.</para>
</listItem>

<listItem>
Expand Down Expand Up @@ -142,9 +142,7 @@ file builder resource files in several languages and information is provided on

<listItem>
<para>Support is included for the <codeInline>&lt;inheritdoc /&gt;</codeInline> tag which allows you
to inherit documentation from base types/members. This is implemented via a standalone tool so it can also be
used by other third-party tools and build scripts. This tool provides features beyond those found in the build
component supplied with Sandcastle.</para>
to inherit documentation from base types/members.</para>
</listItem>
</list>

Expand All @@ -170,16 +168,6 @@ additional content items in a project (no API content).</para>
libraries or online content that does not appear in your help file.</para>
</listItem>

<listItem>
<para>AjaxDoc Builder - Build help files for Atlas script libraries in conjunction with
<externalLink>
<linkText>AjaxDoc</linkText>
<linkUri>http://AjaxDoc.codeplex.com</linkUri>
<linkTarget>_blank</linkTarget>
</externalLink>.
</para>
</listItem>

<listItem>
<para>Completion Notification - E-mail the build results to someone, optionally attaching the log
file (raw or transformed via XSL).</para>
Expand All @@ -191,26 +179,11 @@ locale to overcome its encoding issues when using non-English languages that use
(DBCS).</para>
</listItem>

<listItem>
<para>Hierarchical Table of Contents - Used to rearrange the table of contents such that
namespaces are nested within their parent namespaces.
</para>
</listItem>

<listItem>
<para>Output Deployment - Copy the resulting help file to a file share, web server, FTP site,
etc.</para>
</listItem>

<listItem>
<para>Script# Reflection File Fixer - Fixes up the reflection information file so that
<externalLink>
<linkText>Script#</linkText>
<linkUri>http://scriptsharp.com/</linkUri>
<linkTarget>_blank</linkTarget>
</externalLink> assemblies are documented correctly.</para>
</listItem>

<listItem>
<para>Table of Contents Exclusion - Used to exclude API members from the table of contents (the
members still appear in the help file).</para>
Expand Down Expand Up @@ -261,17 +234,13 @@ details when only documenting the public API.</para>
insert common elements or sections of documentation.</para>
</listItem>

<listItem>
<para>A set of cached build data components that cache key information such as comment, reflection
index information, and member ID URLs across builds in order to speed them up.</para>
</listItem>
</list>

<para>The custom build components can also be used outside of the help file builder in other custom build
scripts and third-party tools as well. All build components are Managed Extensibility Framework (MEF) components
and can be selected for inclusion in your projects. There is also support for defining additional language
syntax generators used to generate the syntax sections in the API reference topics. See the
<link xlink:href="8dcbb69b-7a1a-4049-8e6b-2bf344efbbc9" /> topic for more information.</para>
<para>All build components are Managed Extensibility Framework (MEF) components and can be selected for
inclusion in your projects. You can also create your own components using the
<link xlink:href="e6d18448-2459-46f1-bbdc-a7db415f2bda">documenation</link> in this help file. There is also
support for defining additional <link xlink:href="5e80d139-811c-48ed-9b52-dcd8a3f5aef3">language syntax generators</link>
used to generate the syntax sections in the API reference topics.</para>
</content>
</section>

Expand Down
Expand Up @@ -61,6 +61,7 @@ projects that run out of memory during the build.</para>
</section>

<relatedTopics>
<link xlink:href="c8258d52-6664-4e96-86cd-6f75a854a69c" />
<link xlink:href="e6d18448-2459-46f1-bbdc-a7db415f2bda" />
<link xlink:href="5e80d139-811c-48ed-9b52-dcd8a3f5aef3" />
<link xlink:href="e32086c6-de17-4e54-a746-1ac80bf0c45a" />
Expand Down

0 comments on commit 64ecc94

Please sign in to comment.