-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNDoc.build
executable file
·237 lines (231 loc) · 12.8 KB
/
NDoc.build
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?xml version="1.0" ?>
<project name="ndoc" default="compile" xmlnds="http://tempuri.org/nant-vs.xsd">
<!-- Global project settings -->
<property name="project.name" value="ndoc" />
<property name="project.version" value="2.0" />
<property name="project.patchversion" value="0" /> <!-- 0 for initial release -->
<property name="project.release.type" value="dev" /> <!-- dev / alpha / beta# / rc# / release -->
<property name="project.build.config" value="debug" readonly="false" />
<property name="project.build.package" value="false" readonly="false" />
<property name="build.number" value="${math::abs(math::floor(timespan::get-total-days(datetime::now() - datetime::parse('01/01/2000'))))}" />
<property name="build.dir" value="${project::get-base-directory()}/bin" readonly="false" />
<!-- Include helpers -->
<include buildfile="NDoc.build.include" />
<include buildfile="NDoc.build.package" />
<!-- Targets that should always be executed -->
<call target="set-build-configuration" />
<call target="set-framework-configuration" />
<!--
-->
<target name="debug" description="Change the build configuration to debug mode.">
<call target="set-debug-build-configuration" />
</target>
<!--
-->
<target name="release" description="Change the build configuration to release mode.">
<call target="set-release-build-configuration" />
</target>
<!--
-->
<target name="compile-build" description="Compile current build configuration for all supports target frameworks">
<echo message="Compiling the ${current.build.config} build configuration for all supported target frameworks." />
<!--
build .NET Framework 1.0 version if both the Framework and SDK are available
-->
<if test="${framework::exists('net-1.0')}">
<if test="${framework::sdk-exists('net-1.0')}">
<call target="set-net-1.0-framework-configuration" />
<call target="compile" />
</if>
<if test="${not framework::sdk-exists('net-1.0')}">
<if test="${property::exists('project.build.package') and project.build.package}">
<fail message="The .NET Framework SDK 1.0 is not available." />
</if>
<if test="${not property::exists('project.build.package') or not project.build.package}">
<echo message="The .NET Framework SDK 1.0 is not available. Build skipped." />
</if>
</if>
</if>
<if test="${not framework::exists('net-1.0')}">
<if test="${property::exists('project.build.package') and project.build.package}">
<fail message="The .NET Framework 1.0 is not available." />
</if>
<if test="${not property::exists('project.build.package') or not project.build.package}">
<echo message="The .NET Framework 1.0 is not available. Build skipped." />
</if>
</if>
<!--
build .NET Framework 1.1 version if both Framework and SDK are available
-->
<if test="${framework::exists('net-1.1')}">
<if test="${framework::sdk-exists('net-1.1')}">
<call target="set-net-1.1-framework-configuration" />
<call target="compile" />
</if>
<if test="${not framework::sdk-exists('net-1.1')}">
<if test="${property::exists('project.build.package') and project.build.package}">
<fail message="The .NET Framework SDK 1.1 is not available." />
</if>
<if test="${not property::exists('project.build.package') or not project.build.package}">
<echo message="The .NET Framework SDK 1.1 is not available. Build skipped." />
</if>
</if>
</if>
<if test="${not framework::exists('net-1.1')}">
<if test="${property::exists('project.build.package') and project.build.package}">
<fail message="The .NET Framework 1.1 is not available." />
</if>
<if test="${not property::exists('project.build.package') or not project.build.package}">
<echo message="The .NET Framework 1.1 is not available. Build skipped." />
</if>
</if>
<!--
build .NET Framework 2.0 version if both Framework and SDK are available
-->
<if test="${framework::exists('net-2.0')}">
<if test="${framework::sdk-exists('net-2.0')}">
<call target="set-net-2.0-framework-configuration" />
<call target="compile" />
</if>
<if test="${not framework::sdk-exists('net-2.0')}">
<if test="${property::exists('project.build.package') and project.build.package}">
<fail message="The .NET Framework SDK 2.0 is not available." />
</if>
<if test="${not property::exists('project.build.package') or not project.build.package}">
<echo message="The .NET Framework SDK 2.0 is not available. Build skipped." />
</if>
</if>
</if>
<if test="${not framework::exists('net-2.0')}">
<if test="${property::exists('project.build.package') and project.build.package}">
<fail message="The .NET Framework 2.0 is not available." />
</if>
<if test="${not property::exists('project.build.package') or not project.build.package}">
<echo message="The .NET Framework 2.0 is not available. Build skipped." />
</if>
</if>
<!--
build Mono 1.0 version if both Framework and SDK are available
-->
<if test="${framework::exists('mono-1.0')}">
<if test="${framework::sdk-exists('mono-1.0')}">
<call target="set-mono-1.0-framework-configuration" />
<call target="compile" />
</if>
<if test="${not framework::sdk-exists('mono-1.0')}">
<if test="${property::exists('project.build.package') and project.build.package}">
<fail message="The Mono SDK 1.0 is not available." />
</if>
<if test="${not property::exists('project.build.package') or not project.build.package}">
<echo message="The Mono SDK 1.0 is not available. Build skipped." />
</if>
</if>
</if>
<if test="${not framework::exists('mono-1.0')}">
<if test="${property::exists('project.build.package') and project.build.package}">
<fail message="Mono 1.0 is not available." />
</if>
<if test="${not property::exists('project.build.package') or not project.build.package}">
<echo message="Mono 1.0 is not available. Build skipped." />
</if>
</if>
<!--
build Mono 2.0 version if both Framework and SDK are available
-->
<if test="${framework::exists('mono-2.0')}">
<if test="${framework::sdk-exists('mono-2.0')}">
<call target="set-mono-2.0-framework-configuration" />
<call target="compile" />
</if>
<if test="${not framework::sdk-exists('mono-2.0')}">
<if test="${property::exists('project.build.package') and project.build.package}">
<fail message="The Mono SDK 2.0 is not available." />
</if>
<if test="${not property::exists('project.build.package') or not project.build.package}">
<echo message="The Mono SDK 2.0 is not available. Build skipped." />
</if>
</if>
</if>
<if test="${not framework::exists('mono-2.0')}">
<if test="${property::exists('project.build.package') and project.build.package}">
<fail message="Mono 2.0 is not available." />
</if>
<if test="${not property::exists('project.build.package') or not project.build.package}">
<echo message="Mono 2.0 is not available. Build skipped." />
</if>
</if>
</target>
<!--
-->
<target name="compile" description="Builds the current build configuration for the current target framework." depends="create-common-assemblyinfo">
<!-- ensure the bin dir has been created, and clean it up if needed -->
<call target="clean-current-bin-dir" />
<!-- copy the ndoc signing key file to the bin dir -->
<copy file="${project::get-base-directory()}/NDoc.snk" todir="${current.bin.dir}" />
<!-- build all projects -->
<nant buildfile="src/ExtendedUI/ExtendedUI.build" target="compile" inheritall="true" />
<nant buildfile="src/Core/Core.build" target="compile" inheritall="true" />
<nant buildfile="src/Console/Console.build" target="compile" inheritall="true" />
<nant buildfile="src/VisualStudio/VisualStudio.build" target="compile" inheritall="true" />
<nant buildfile="src/Gui/Gui.build" target="compile" inheritall="true" />
<nant buildfile="src/Documenter/Msdn/Msdn.build" target="compile" inheritall="true" />
<nant buildfile="src/Documenter/Msdn2/Msdn2.build" target="compile" inheritall="true" />
<nant buildfile="src/Documenter/JavaDoc/JavaDoc.build" target="compile" inheritall="true" />
<nant buildfile="src/Documenter/Latex/Latex.build" target="compile" inheritall="true" />
<nant buildfile="src/Documenter/LinearHtml/LinearHtml.build" target="compile" inheritall="true" />
<nant buildfile="src/Documenter/NativeHtmlHelp2/NativeHtmlHelp2.build" target="compile" inheritall="true" />
<nant buildfile="src/Documenter/Xml/Xml.build" target="compile" inheritall="true" />
<nant buildfile="src/Test/Test.build" target="compile" inheritall="true" />
<!-- remove the ndoc signing key file -->
<delete file="${current.bin.dir}/NDoc.snk" />
</target>
<!--
-->
<target name="create-common-assemblyinfo">
<!-- ensure src/CommonAssemblyInfo.cs is writable if it already exists -->
<attrib file="src/CommonAssemblyInfo.cs" readonly="false" if="${file::exists('src/CommonAssemblyInfo.cs')}" />
<!-- generate the source file holding the common assembly-level attributes -->
<asminfo output="src/CommonAssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="AssemblyConfigurationAttribute" value="${framework::get-target-framework()}.${platform::get-name()}; ${project.release.type}" />
<attribute type="AssemblyCompanyAttribute" value="http://ndoc.sourceforge.net" />
<attribute type="AssemblyProductAttribute" value="NDoc" />
<attribute type="AssemblyCopyrightAttribute" value="" />
<attribute type="AssemblyTrademarkAttribute" value="" />
<attribute type="AssemblyCultureAttribute" value="" />
<attribute type="AssemblyVersionAttribute" value="${project.version}.${build.number}.0" />
<attribute type="AssemblyInformationalVersionAttribute" value="${project.version}.${project.patchversion}" />
</attributes>
</asminfo>
</target>
<!--
-->
<target name="sdkdoc" description="Builds SDK documentation (based on .NET Framework 1.1 assembly)">
<echo message="Creating SDK Documentation for NDoc Core." />
<ndoc>
<assemblies basedir="${build.dir}/net/1.1">
<include name="NDoc.Core.dll" />
</assemblies>
<documenters>
<documenter name="MSDN">
<property name="OutputDirectory" value="doc/sdk" />
<property name="HtmlHelpName" value="NDoc-SDK" />
<property name="Title" value="NDoc ${project.version} SDK" />
<property name="ShowVisualBasic" value="True" />
<property name="SdkLinksOnWeb" value="True" />
<property name="IncludeAssemblyVersion" value="True" />
<property name="FeedbackEmailAddress" value="[email protected]" />
<property name="UseNamespaceDocSummaries" value="True" />
<property name="Preliminary" value="${if(project.release.type == 'release','False','True')}" />
<property name="DocumentAttributes" value="True" />
</documenter>
</documenters>
</ndoc>
</target>
</project>