Repository navigation
Expand file tree
/
Copy pathGallioBook.module
More file actions
108 lines (80 loc) · 5.44 KB
/
Copy pathGallioBook.module
File metadata and controls
108 lines (80 loc) · 5.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MetaBuildBinDir)\MetaBuild.Module.targets" />
<PropertyGroup>
<SaxonJar>$(ModuleDir)\tools\Saxon\saxon.jar</SaxonJar>
<XslthlJar>$(ModuleDir)\tools\Xslthl\xslthl-2.0.1.jar</XslthlJar>
<XslthlConfig>$(ModuleDir)\resources\Highlighters\xslthl-config.xml</XslthlConfig>
<XercesJar>$(ModuleDir)\tools\xerces-2_9_1\xercesImpl.jar</XercesJar>
<FopBat>$(ModuleDir)\tools\fop-0.94\fop.bat</FopBat>
<FopConf>$(ModuleDir)\resources\Fo\Fop.xconf</FopConf>
<BookXml>$(ModuleDir)\content\GallioBook.docbook</BookXml>
<XHtmlXslt>$(ModuleDir)\resources\Html\XHtml.xsl</XHtmlXslt>
<HtmlHelpXslt>$(ModuleDir)\resources\Html\HtmlHelp.xsl</HtmlHelpXslt>
<PdfXslt>$(ModuleDir)\resources\Fo\Pdf.xsl</PdfXslt>
<TransformCommand>java -cp "$(SaxonJar)";"$(XslthlJar)";"$(XercesJar)" -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration -Dxslthl.config="file:///$(XslthlConfig)" com.icl.saxon.StyleSheet</TransformCommand>
<DistLabel>0</DistLabel>
<DistLabel Condition="'$(BuildNumber)'!=''">$(BuildNumber)</DistLabel>
</PropertyGroup>
<PropertyGroup>
<HtmlHelpWorkshopInstallDir>$(Registry:HKEY_CURRENT_USER\Software\Microsoft\HTML Help Workshop\@InstallDir)</HtmlHelpWorkshopInstallDir>
<HtmlHelpWorkshopInstallDir Condition="'$(HtmlHelpWorkshopInstallDir)'==''">$(Registry:HKEY_LOCAL_MACHINE\Software\Microsoft\HTML Help Workshop\@InstallDir)</HtmlHelpWorkshopInstallDir>
<HtmlHelpWorkshopInstallDir Condition="'$(HtmlHelpWorkshopInstallDir)'==''">$(ProgramFiles)\HTML Help Workshop</HtmlHelpWorkshopInstallDir>
<HtmlHelpWorkshopCompiler Condition="'$(HtmlHelpWorkshopInstallDir)'!='' and Exists('$(HtmlHelpWorkshopInstallDir)\hhc.exe')">$(HtmlHelpWorkshopInstallDir)\hhc.exe</HtmlHelpWorkshopCompiler>
</PropertyGroup>
<Target Name="AfterBuild"
DependsOnTargets="RenderDocBookXHtml;RenderDocBookPdf;RenderDocBookHtmlHelp">
</Target>
<Target Name="RenderDocBookXHtml"
DependsOnTargets="CopyContentForXHtml">
<Message Text="Rendering Book in XHTML..." Importance="High" />
<Exec Command="$(TransformCommand) "$(BookXml)" "$(XHtmlXslt)" chunker.output.encoding="UTF-8" chunker.output.indent="yes" html.stylesheet="Book.css" keep.relative.image.uris=0"
WorkingDirectory="$(ImageDir)\GallioBook\XHtml" />
</Target>
<Target Name="RenderDocBookPdf">
<Message Text="Rendering Book in PDF..." Importance="High" />
<Exec Command="$(TransformCommand) -o "$(TempDir)\GallioBook\GallioBook.fo" "$(BookXml)" "$(PdfXslt)" keep.relative.image.uris=0" />
<Exec Command=""$(FopBat)" -fo "$(TempDir)\GallioBook\GallioBook.fo" -c "$(FopConf)" -pdf "$(ImageDir)\GallioBook\GallioBook.pdf""
WorkingDirectory="content" />
</Target>
<Target Name="RenderDocBookHtmlHelp"
DependsOnTargets="WarnIfHtmlHelpWorkshopNotInstalled;RenderIfHtmlHelpWorkshopInstalled" />
<Target Name="WarnIfHtmlHelpWorkshopNotInstalled"
Condition="'$(HtmlHelpWorkshopCompiler)'==''">
<Warning Text="The HTML Help Workshop does not appear to be installed. The documentation will not be rendered in this format." />
</Target>
<Target Name="RenderIfHtmlHelpWorkshopInstalled"
Condition="'$(HtmlHelpWorkshopCompiler)'!=''"
DependsOnTargets="CopyContentForHtmlHelp">
<Message Text="Rendering Book in HtmlHelp (CHM)..." Importance="High" />
<Exec Command="$(TransformCommand) "$(BookXml)" "$(HtmlHelpXslt)" html.stylesheet="Book.css" htmlhelp.chm="$(ImageDir)\GallioBook\GallioBook.chm" keep.relative.image.uris=0"
WorkingDirectory="$(TempDir)\GallioBook\HtmlHelp" />
<Exec Command=""$(HtmlHelpWorkshopCompiler)" "$(TempDir)\GallioBook\HtmlHelp\htmlhelp.hhp""
IgnoreExitCode="true"/>
<Error Text="CHM file not produced!"
Condition="! Exists('$(ImageDir)\GallioBook\GallioBook.chm')"/>
</Target>
<Target Name="CopyContentForXHtml">
<RemoveDir Directories="$(ImageDir)\GallioBook\XHtml" />
<MakeDir Directories="$(ImageDir)\GallioBook" />
<SvnExport RepositoryPath="$(ModuleDir)\content"
LocalPath="$(ImageDir)\GallioBook\XHtml" />
<ItemGroup>
<_ContentFilesToDeleteForXHtml Include="$(ImageDir)\GallioBook\XHtml\**\*.docbook" />
</ItemGroup>
<Delete Files="@(_ContentFilesToDeleteForXHtml)"
Condition="'@(_ContentFilesToDeleteForXHtml)'!=''" />
</Target>
<Target Name="CopyContentForHtmlHelp">
<RemoveDir Directories="$(TempDir)\GallioBook\HtmlHelp" />
<MakeDir Directories="$(TempDir)\GallioBook" />
<SvnExport RepositoryPath="$(ModuleDir)\content"
LocalPath="$(TempDir)\GallioBook\HtmlHelp" />
</Target>
<Target Name="BeforeDist">
<ItemGroup>
<File Include="$(ImageDir)\GallioBook\**\*">
<DistPath>GallioBook\$(DistLabel)</DistPath>
</File>
</ItemGroup>
</Target>
</Project>