Skip to content

Commit 2e40895

Browse files
authored
Update SHFB in order to build documentation without MSBuild (#3083)
1 parent b35c884 commit 2e40895

File tree

7 files changed

+27
-36
lines changed

7 files changed

+27
-36
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ TestResult.xml
1919
.vs/
2020
/build-common/NHibernate.dev.props
2121
/doc/reference/master.xml
22+
/doc/bin/
23+
/doc/obj/
24+
/Tools/bin/
25+
/Tools/obj/

Tools/actual_msbuild.cmd

-11
This file was deleted.

Tools/packages.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="vswhere" Version="2.1.4" />
1514
<PackageReference Include="NUnit.Console" Version="3.10.0" />
1615
</ItemGroup>
1716

doc/.gitignore

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
1+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
2+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
23
<PropertyGroup>
34
<!-- The configuration and platform will be used to determine which
45
assemblies to include from solution and project documentation
@@ -7,26 +8,27 @@
78
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
89
<SchemaVersion>2.0</SchemaVersion>
910
<ProjectGuid>{91f431cd-23fb-4ed4-a690-0344073c65f0}</ProjectGuid>
10-
<SHFBSchemaVersion>1.8.0.0</SHFBSchemaVersion>
11+
<SHFBSchemaVersion>2017.9.26.0</SHFBSchemaVersion>
1112
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual
1213
Studio adds them anyway -->
1314
<AssemblyName>Documentation</AssemblyName>
1415
<RootNamespace>Documentation</RootNamespace>
1516
<Name>Documentation</Name>
1617
<!-- SHFB properties -->
17-
<OutputPath>${doc.out.dir}</OutputPath>
18+
<FrameworkVersion>.NET Framework 4.6.1</FrameworkVersion>
19+
<OutputPath></OutputPath>
1820
<HtmlHelpName>NHibernateAPI</HtmlHelpName>
19-
<HelpFileFormat>HtmlHelp1x</HelpFileFormat>
21+
<HelpFileFormat>HtmlHelp1</HelpFileFormat>
2022
<CopyrightText>NHibernate</CopyrightText>
2123
<CopyrightHref>https://nhibernate.info</CopyrightHref>
2224
<FeedbackEMailAddress>https://groups.google.com/group/nhibernate-development</FeedbackEMailAddress>
2325
<FeedbackEMailLinkText>nhibernate team</FeedbackEMailLinkText>
2426
<HelpTitle>NHibernate API Reference</HelpTitle>
2527
<IndentHtml>False</IndentHtml>
26-
<HelpFileVersion>${project.version}</HelpFileVersion>
28+
<HelpFileVersion>1.0.0.0</HelpFileVersion>
2729
<DocumentationSources>
28-
<DocumentationSource sourceFile="${root.dir}/src/NHibernate/bin/${build.config}/net461/NHibernate.dll" />
29-
<DocumentationSource sourceFile="${root.dir}/src/NHibernate/bin/${build.config}/net461/Nhibernate.xml" />
30+
<DocumentationSource sourceFile="../src/NHibernate/bin/$(Configuration)/net461/NHibernate.dll" />
31+
<DocumentationSource sourceFile="../src/NHibernate/bin/$(Configuration)/net461/Nhibernate.xml" />
3032
</DocumentationSources>
3133
</PropertyGroup>
3234
<!-- There are no properties for these two groups but they need to appear in
@@ -35,6 +37,10 @@
3537
</PropertyGroup>
3638
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3739
</PropertyGroup>
40+
<ItemGroup>
41+
<PackageReference Include="EWSoftware.SHFB.NETFramework" Version="4.8.0.2" />
42+
</ItemGroup>
43+
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="'$(MSBuildRestoreSessionId)' != ''" />
3844
<!-- Import the SHFB build targets -->
39-
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
45+
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" Condition="'$(MSBuildRestoreSessionId)' == ''" />
4046
</Project>

doc/documentation.build

+7-11
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,7 @@
4242
</zip>
4343
</target>
4444

45-
<target name="apidocbuilder-project" depends="init">
46-
<copy file="NHibernate.shfbproj.template" tofile="NHibernate.shfbproj" overwrite="true">
47-
<filterchain>
48-
<expandproperties />
49-
</filterchain>
50-
</copy>
51-
</target>
52-
53-
<target name="api" depends="init apidocbuilder-project" description="Generates the API documentation (in MSDN style if available)">
45+
<target name="api" depends="init" description="Generates the API documentation (in MSDN style if available)">
5446
<uptodate property="api.uptodate">
5547
<sourcefiles>
5648
<include name="${root.dir}/src/NHibernate/bin/${build.config}/net461/*.dll" />
@@ -65,8 +57,12 @@
6557
<echo if="${api.uptodate}">API documentation is up to date, skipping generation step.</echo>
6658

6759
<if test="${not api.uptodate}">
68-
<exec program="${path::combine(tools.dir, 'actual_msbuild.cmd')}">
69-
<arg line="NHibernate.shfbproj" />
60+
<exec program="dotnet">
61+
<arg value="build" />
62+
<arg value="/p:HelpFileVersion=&quot;${project.version}&quot;" />
63+
<arg value="/p:OutputPath=&quot;${doc.out.dir}&quot;" />
64+
<arg value="/p:Configuration=&quot;${build.config}&quot;" />
65+
<arg value="NHibernate.shfbproj" />
7066
</exec>
7167
</if>
7268
</target>

doc/reference/README.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ the documentation. You don't need to download and install Saxon, its jars are
2222
present in the repository.
2323

2424
You need HTML Help Workshop to build the CHM help file, and Sandcastle Help File
25-
Builder (SHFB - https://github.com/EWSoftware/SHFB) to build the HtmlHelp2 help
26-
file.
25+
Builder v2021.11.7.0 or later (SHFB - https://github.com/EWSoftware/SHFB) to
26+
build the HtmlHelp2 help file.
2727

2828
================================================================================
2929
DocBook Quick Start

0 commit comments

Comments
 (0)