forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.step
291 lines (275 loc) · 20.1 KB
/
compile.step
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<?xml version="1.0" encoding="utf-8" ?>
<project name="Compiler" default="go">
<!-- Project UppercuT - http://projectuppercut.org -->
<!-- DO NOT EDIT THIS FILE - Add custom tasks in BuildTasks.Custom folder with file by the same name - find out more at http://uppercut.pbwiki.com -->
<property name="build.config.settings" value="__NONE__" overwrite="false" />
<include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
<property name="path.separator" value="${string::trim(path::combine(' ', ' '))}" />
<property name="dirs.current.file" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
<include buildfile="${dirs.current.file}${path.separator}default.build.settings" />
<property name="build.step.name" value="${project::get-name()}" />
<property name="build.step.path" value="${project::get-buildfile-path()}" />
<!-- build step customizations below this -->
<property name="dirs.build.windows.mono" value="${string::replace(dirs.build,'\','/')}" />
<property name="dirs.build_results" value="${dirs.build_artifacts}${path.separator}compile" overwrite="false" />
<property name="msbuild.logger" value="ThoughtWorks.CruiseControl.MSBuild.XmlLogger,"${dirs.tools}${path.separator}NAnt${path.separator}ThoughtWorks.CruiseControl.MSBuild.dll"" />
<property name="msbuild.outputpath" value="${dirs.build}${path.separator}${folder.app.drop}" overwrite="false" />
<property name="msbuild.outputpath.windows.mono" value="${string::replace(msbuild.outputpath,'\','/')}" />
<property name="solution.path" value="${dirs.current}${path.separator}${path_to_solution}${path.separator}${project.name}.sln" />
<property name="solution.path" value="${path::get-full-path(solution.path)}" />
<property name="solution.path.windows.mono" value="${string::replace(dirs.current,'\','/')}/${string::replace(path_to_solution,'\','/')}/${project.name}.sln" />
<property name="solution.path" value="${dirs.current}${path.separator}${path_to_solution}${path.separator}${project.name}.vbp" if="${microsoft.framework =='vb6'}" />
<property name="nant.settings.currentframework" value="mono-4.0" if="${platform::is-unix()}" />
<property name="nant.settings.currentframework" value="net-3.5" if="${microsoft.framework !='vb6' and platform::is-windows()}" />
<property name="framework.multitargeting" value="false" />
<property name="framework.multitargeting.delimiter" value="," />
<target name="go" depends="load_uppercut_assemblies, run_tasks" />
<target name="prepare">
<echo message="Removing and adding ${dirs.build_results}."/>
<delete dir="${dirs.build_results}" failonerror="false" />
<mkdir dir="${dirs.build_results}" />
</target>
<!-- run_normal_tasks is called from run_tasks unless replace extension exists-->
<target name="run_normal_tasks"
depends="error_check, set_vars, restore_packages, build_code, copy_documentation, copy_db, set_file_attributes_to_normal"
description="Compiling project." />
<target name="error_check">
<fail message="You must fill out the project.name, repository.path, and company.name settings in the ${build.config.settings} file. Please do that and retry the build."
if="${project.name=='__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__'}" />
</target>
<target name="check_for_multitargeting">
<if test="${string::contains(microsoft.framework,',')}">
<echo level="Warning" message="You want to multi target, eh? You passed a comma into the framework: ${microsoft.framework}" />
<property name="framework.multitargeting" value="true" />
<property name="framework.multitargeting.delimiter" value="," />
</if>
<if test="${string::contains(microsoft.framework,';')}">
<echo level="Warning" message="You want to multi target, eh? You passed a semicolon into the framework: ${microsoft.framework}" />
<property name="framework.multitargeting" value="true" />
<property name="framework.multitargeting.delimiter" value=";" />
</if>
</target>
<target name="set_vars">
<echo level="Warning" message="Setting compile variables" />
<setenv name="EnableNuGetPackageRestore" value="true"/>
</target>
<target name="restore_packages" if="${file::exists(app.nuget)}">
<echo level="Warning" message="Finding and restoring all packages (${app.nuget} restore '${solution.path}')" />
<exec program="${app.nuget}"
workingdir="${dirs.build}"
commandline='restore "${solution.path}"'
failonerror="false"
if="${platform::is-windows()}" />
<exec
program="mono"
workingdir="${dirs.build}"
failonerror="false"
if="${platform::is-unix()}"
>
<arg value='"${app.nuget}"' />
<arg value='restore "${solution.path}"' />
</exec>
</target>
<target name="build_code" depends="" description="Building Library">
<echo level="Warning" message="Compiling ${solution.path}."/>
<call target="build_dotNET_code" if="${microsoft.framework !='vb6'}" />
<call target="build_vb6_code" if="${microsoft.framework =='vb6'}" />
</target>
<target name="build_dotNET_code" >
<if test="${framework.multitargeting}">
<foreach item="String" in="${microsoft.framework}" delim="${framework.multitargeting.delimiter}" property="framework.specific">
<property name="msbuild.outputpath" value="${dirs.build}${path.separator}${folder.app.drop}${path.separator}${framework.specific}" />
<property name="msbuild.outputpath.windows.mono" value="${string::replace(msbuild.outputpath,'\','/')}" />
<property name="microsoft.framework.specific" value="${string::trim(framework.specific)}" />
<call target="build_dotNet_code_framework" />
</foreach>
</if>
<if test="${not framework.multitargeting}">
<property name="microsoft.framework.specific" value="${string::trim(microsoft.framework)}" />
<call target="build_dotNet_code_framework" />
</if>
</target>
<target name="build_dotNet_code_framework">
<echo level="Warning" message="Building on ${framework::get-version(microsoft.framework.specific)}" />
<property name="nant.settings.currentframework" value="${string::trim(microsoft.framework.specific)}" />
<mkdir dir="${msbuild.outputpath}" />
<if test="${platform::is-unix()}">
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<exec program="${app.xbuild}"
basedir="/usr/bin"
workingdir="${dirs.build}"
commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Building..." />
<echo level="Warning" message="Working directory ${dirs.build}" />
<echo level="Warning" message="Running ${app.xbuild} ${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:detailed /toolsversion:${framework::get-version(microsoft.framework.specific)} /property:Platform='${msbuild.platform}' /property:TargetFrameworkVersion=v${framework::get-version(microsoft.framework.specific)} /l:${msbuild.logger};'${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml'" />
<exec program="${app.xbuild}"
basedir="/usr/bin"
workingdir="${dirs.build}"
commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:detailed /toolsversion:${framework::get-version(microsoft.framework.specific)} /property:Platform='${msbuild.platform}' /property:TargetFrameworkProfile='' /property:TargetFrameworkVersion=v${framework::get-version(microsoft.framework.specific)} /l:${msbuild.logger};'${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml'" />
</if>
<if test="${platform::is-windows()}">
<!-- nant is retarded - I had to have four of these instead of throwing an if on the outputpath and targets -->
<if test="${msbuild.override_output_path}">
<if test="${framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline="${solution.path.windows.mono} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message='Building...by running this command ${app.xbuild} ${solution.path.windows.mono} /nologo /property:OutputPath="${msbuild.outputpath.windows.mono}" /property:Configuration=${msbuild.configuration} /verbosity:minimal' />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline='${solution.path.windows.mono} /nologo /property:OutputPath="${msbuild.outputpath.windows.mono}" /property:Configuration=${msbuild.configuration} /verbosity:minimal' />
</if>
<if test="${framework::get-family(microsoft.framework.specific) != 'mono'}" >
<msbuild project="${solution.path}" verbosity="minimal" if="${microsoft.framework.specific != 'net-1.0' and microsoft.framework.specific != 'net-1.1'}">
<property name="Configuration" value="${msbuild.configuration}" />
<property name="OutputPath" value="${msbuild.outputpath}" />
<property name="Platform" value="${msbuild.platform}" />
<property name="TargetFrameworkVersion" value="v${framework::get-version(microsoft.framework.specific)}" />
<property name="ToolsVersion" value="${framework::get-version(microsoft.framework.specific)}" />
<!--property name="Logger" value="${msbuild.logger};"${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml"" /-->
<arg line="/l:${msbuild.logger};"${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml"" />
</msbuild>
<solution
configuration="${msbuild.configuration}"
solutionfile="${solution.path}"
outputdir="${msbuild.outputpath}"
platform="${msbuild.platform}"
if="${microsoft.framework.specific == 'net-1.0' or microsoft.framework.specific == 'net-1.1'}"
/>
</if>
</if>
<if test="${not framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline="${solution.path.windows.mono} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message='Building without multitargeting by running this command ${app.xbuild} ${solution.path.windows.mono} /nologo /property:OutputPath="${msbuild.outputpath.windows.mono}" /property:Configuration=${msbuild.configuration} /verbosity:minimal' />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline='${solution.path.windows.mono} /nologo /property:OutputPath="${msbuild.outputpath.windows.mono}" /property:Configuration=${msbuild.configuration} /verbosity:minimal' />
</if>
<if test="${framework::get-family(microsoft.framework.specific) != 'mono'}" >
<msbuild project="${solution.path}" verbosity="minimal" if="${microsoft.framework.specific != 'net-1.0' and microsoft.framework.specific != 'net-1.1'}">
<property name="Configuration" value="${msbuild.configuration}" />
<property name="OutputPath" value="${msbuild.outputpath}" />
<property name="Platform" value="${msbuild.platform}" />
<!--property name="Logger" value="${msbuild.logger};"${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml"" /-->
<arg line="/l:${msbuild.logger};"${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml"" />
</msbuild>
<solution
configuration="${msbuild.configuration}"
solutionfile="${solution.path}"
outputdir="${msbuild.outputpath}"
platform="${msbuild.platform}"
if="${microsoft.framework.specific == 'net-1.0' or microsoft.framework.specific == 'net-1.1'}"
/>
</if>
</if>
</if>
<if test="${not msbuild.override_output_path}">
<if test="${framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build}"
workingdir="${dirs.build}"
commandline="${solution.path} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Building..." />
<exec program="${app.xbuild}"
basedir="${dirs.build}"
workingdir="${dirs.build}"
commandline="${solution.path} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal" />
</if>
<if test="${framework::get-family(microsoft.framework.specific) != 'mono'}" >
<msbuild project="${solution.path}" verbosity="minimal" if="${microsoft.framework.specific != 'net-1.0' and microsoft.framework.specific != 'net-1.1'}">
<property name="Configuration" value="${msbuild.configuration}" />
<property name="Platform" value="${msbuild.platform}" />
<property name="TargetFrameworkVersion" value="v${framework::get-version(microsoft.framework.specific)}" />
<property name="ToolsVersion" value="${framework::get-version(microsoft.framework.specific)}" />
<!--property name="Logger" value="${msbuild.logger};"${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml"" /-->
<arg line="/l:${msbuild.logger};"${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml"" />
</msbuild>
<solution
configuration="${msbuild.configuration}"
solutionfile="${solution.path}"
platform="${msbuild.platform}"
if="${microsoft.framework.specific == 'net-1.0' or microsoft.framework.specific == 'net-1.1'}"
/>
</if>
</if>
<if test="${not framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline="${solution.path.windows.mono} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Building...by running this command ${app.xbuild} ${solution.path.windows.mono} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline="${solution.path.windows.mono} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal" />
</if>
<if test="${framework::get-family(microsoft.framework.specific) != 'mono'}" >
<msbuild project="${solution.path}" verbosity="minimal" if="${microsoft.framework.specific != 'net-1.0' and microsoft.framework.specific != 'net-1.1'}">
<property name="Configuration" value="${msbuild.configuration}" />
<property name="Platform" value="${msbuild.platform}" />
<!--property name="Logger" value="${msbuild.logger};"${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml"" /-->
<arg line="/l:${msbuild.logger};"${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml"" />
</msbuild>
<solution
configuration="${msbuild.configuration}"
solutionfile="${solution.path}"
platform="${msbuild.platform}"
if="${microsoft.framework.specific == 'net-1.0' or microsoft.framework.specific == 'net-1.1'}"
/>
</if>
</if>
</if>
</if>
</target>
<target name="build_vb6_code">
<vb6 project="${solution.path}" outdir="${dirs.build}${path.separator}${folder.app.drop}" />
</target>
<target name="copy_documentation" if="${directory::exists(dirs.docs)}">
<echo level="Warning" message="Copying documentation files to ${dirs.build}${path.separator}${folder.documentation}."/>
<copy todir="${dirs.build}${path.separator}${folder.documentation}" failonerror="false" >
<fileset basedir="${dirs.docs}">
<include name="**/*.*" />
</fileset>
</copy>
</target>
<target name="copy_db" if="${directory::exists(dirs.db)}">
<echo level="Warning" message="Copying database files to ${dirs.build}${path.separator}${folder.database}."/>
<copy todir="${dirs.build}${path.separator}${folder.database}" failonerror="false">
<fileset basedir="${dirs.db}">
<exclude name="**/*.csproj" />
<exclude name="**/*.csproj.user" />
<exclude name="bin/**/*.*" />
<exclude name="obj/**/*.*" />
<exclude name="Properties/**/*.*" />
<include name="**/*.*" />
</fileset>
</copy>
</target>
<target name="set_file_attributes_to_normal">
<echo level="Warning" message="Removing read only attributes that some source control things put on files in '${dirs.build}'." />
<attrib normal="true">
<fileset basedir="${dirs.build}">
<include name="**/*" />
</fileset>
</attrib>
</target>
</project>