uppercutbuild 0.9.0.346.20100805 → 1.0.0.0.20100806

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/docs/README +7 -2
  2. data/lib/build.sh +23 -0
  3. data/lib/build/UppercuT.xml +1 -1
  4. data/lib/build/analyze.step +78 -77
  5. data/lib/build/analyzers/gallio.test.step +25 -26
  6. data/lib/build/analyzers/mbunit2.test.step +25 -28
  7. data/lib/build/analyzers/moma.step +29 -31
  8. data/lib/build/analyzers/ncover.step +32 -34
  9. data/lib/build/analyzers/ndepend.step +19 -12
  10. data/lib/build/analyzers/nitriq.step +19 -22
  11. data/lib/build/analyzers/nunit.test.step +37 -37
  12. data/lib/build/analyzers/test.step +99 -98
  13. data/lib/build/compile.step +68 -50
  14. data/lib/build/customize.build +76 -75
  15. data/lib/build/customizers/item.template +50 -49
  16. data/lib/build/default.build +171 -167
  17. data/lib/build/deploymentBuilder.step +103 -102
  18. data/lib/build/environmentBuilder.step +119 -118
  19. data/lib/build/gemsBuild.step +113 -112
  20. data/lib/build/gemsPrepare.step +157 -156
  21. data/lib/build/generateBuildInfo.step +108 -105
  22. data/lib/build/ilmerge.build +183 -182
  23. data/lib/build/open.build +115 -102
  24. data/lib/build/package.step +234 -233
  25. data/lib/build/policyChecks.step +81 -80
  26. data/lib/build/updateAssemblies.build +107 -106
  27. data/lib/build/uppercut.dll +0 -0
  28. data/lib/build/uppercut.tasks.dll +0 -0
  29. data/lib/build/versionBuilder.step +149 -147
  30. data/lib/build/versioners/git.step +106 -105
  31. data/lib/build/versioners/hg.step +106 -105
  32. data/lib/build/versioners/svn.step +112 -111
  33. data/lib/build/versioners/tfs.step +104 -103
  34. data/lib/build/zip.build +134 -162
  35. data/lib/deployment/scripts/database.deploy +37 -36
  36. data/lib/open.sh +7 -0
  37. data/lib/settings/UppercuT.config +76 -73
  38. data/lib/zip.sh +9 -0
  39. metadata +9 -6
@@ -4,18 +4,19 @@
4
4
  <!-- 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 -->
5
5
  <property name="build.config.settings" value="__NONE__" overwrite="false" />
6
6
  <include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
7
+ <property name="path.separator" value="${string::trim(path::combine(' ', ' '))}" />
7
8
  <property name="file.current.no_extension" value="compile" />
8
9
  <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
9
10
  <property name="path.to.toplevel" value=".." />
10
11
  <property name="folder.build_scripts" value="build" overwrite="false" />
11
12
  <property name="folder.build_scripts_custom" value="build.custom" overwrite="false" />
12
- <property name="dirs.build_scripts_custom" value="${dirs.current}\${path.to.toplevel}\${folder.build_scripts_custom}" />
13
+ <property name="dirs.build_scripts_custom" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.build_scripts_custom}" />
13
14
  <property name="folder.code_build" value="build_output" overwrite="false" />
14
- <property name="dirs.build" value="${dirs.current}\${path.to.toplevel}\${folder.code_build}" />
15
+ <property name="dirs.build" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.code_build}" />
15
16
  <property name="folder.documentation" value="docs" overwrite="false" />
16
- <property name="dirs.docs" value="${dirs.current}\${path.to.toplevel}\${folder.documentation}" />
17
+ <property name="dirs.docs" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.documentation}" />
17
18
  <property name="folder.database" value="__DATABASE_FOLDER_NAME__" overwrite="false" />
18
- <property name="dirs.db" value="${dirs.current}\${path.to.toplevel}\${folder.database}" />
19
+ <property name="dirs.db" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.database}" />
19
20
  <property name="project.name" value="__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__" overwrite="false" />
20
21
  <property name="folder.app.drop" value="${project.name}" overwrite="false" />
21
22
  <property name="path_to_solution" value="." overwrite="false" />
@@ -23,15 +24,17 @@
23
24
  <property name="msbuild.configuration" value="Release" overwrite="false" />
24
25
  <property name="msbuild.platform" value="Any CPU" overwrite="false" />
25
26
  <property name="msbuild.override_output_path" value="true" overwrite="false" />
26
- <property name="msbuild.outputpath" value="${dirs.build}\${folder.app.drop}" overwrite="false" />
27
- <property name="solution.path" value="${dirs.current}\${path.to.toplevel}\${path_to_solution}\${project.name}.sln" />
28
- <property name="solution.path" value="${dirs.current}\${path.to.toplevel}\${path_to_solution}\${project.name}.vbp" if="${microsoft.framework =='vb6'}" />
29
- <property name="nant.settings.currentframework" value="net-3.5" if="${microsoft.framework !='vb6'}" />
27
+ <property name="msbuild.outputpath" value="${dirs.build}${path.separator}${folder.app.drop}" overwrite="false" />
28
+ <property name="xbuild.outputpath" value=".${path.separator}${folder.code_build}${path.separator}${folder.app.drop}" overwrite="false" />
29
+ <property name="solution.path" value="${directory::get-parent-directory(dirs.current)}${path.separator}${project.name}.sln" />
30
+ <property name="solution.path" value="${directory::get-parent-directory(dirs.current)}${path.separator}${project.name}.vbp" if="${microsoft.framework =='vb6'}" />
31
+ <property name="nant.settings.currentframework" value="mono-1.0" if="${platform::is-unix()}" />
32
+ <property name="nant.settings.currentframework" value="net-3.5" if="${microsoft.framework !='vb6' and platform::is-windows()}" />
30
33
  <property name="framework.multitargeting" value="false" />
31
34
  <property name="framework.multitargeting.delimiter" value="," />
32
- <property name="file.custom.step.before" value="${dirs.build_scripts_custom}\${file.current.no_extension}.pre.step" />
33
- <property name="file.custom.step.after" value="${dirs.build_scripts_custom}\${file.current.no_extension}.post.step" />
34
- <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}\${file.current.no_extension}.replace.step" />
35
+ <property name="file.custom.step.before" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.pre.step" />
36
+ <property name="file.custom.step.after" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.post.step" />
37
+ <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.replace.step" />
35
38
  <property name="is.replaced" value="false" />
36
39
  <property name="fail.build.on.error" value="true" />
37
40
 
@@ -77,7 +80,7 @@
77
80
  </target>
78
81
 
79
82
  <target name="error_check">
80
- <fail message="You must fill out the project.name, repository.path, and company.name settings in the settings\UppercuT.config file. Please do that and retry the build."
83
+ <fail message="You must fill out the project.name, repository.path, and company.name settings in the settings${path.separator}UppercuT.config file. Please do that and retry the build."
81
84
  if="${project.name=='__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__'}" />
82
85
  </target>
83
86
 
@@ -103,7 +106,8 @@
103
106
  <target name="build_dotNET_code" >
104
107
  <if test="${framework.multitargeting}">
105
108
  <foreach item="String" in="${microsoft.framework}" delim="${framework.multitargeting.delimiter}" property="framework.specific">
106
- <property name="msbuild.outputpath" value="${dirs.build}\${folder.app.drop}\${framework.specific}" />
109
+ <property name="msbuild.outputpath" value="${dirs.build}${path.separator}${folder.app.drop}${path.separator}${framework.specific}" />
110
+ <property name="xbuild.outputpath" value=".${path.separator}${folder.code_build}${path.separator}${folder.app.drop}${path.separator}${framework.specific}" />
107
111
  <property name="microsoft.framework.specific" value="${string::trim(framework.specific)}" />
108
112
  <call target="build_dotNet_code_framework" />
109
113
  </foreach>
@@ -117,52 +121,66 @@
117
121
  <target name="build_dotNet_code_framework">
118
122
  <echo message="Building on ${framework::get-version(microsoft.framework.specific)}" />
119
123
  <property name="nant.settings.currentframework" value="${string::trim(microsoft.framework.specific)}" />
120
- <!-- nant is retarded - I had to have two of these instead of throwing an if on the outputpath -->
121
- <if test="${msbuild.override_output_path}">
122
- <if test="${framework.multitargeting}">
123
- <msbuild project="${solution.path}" verbosity="minimal">
124
- <property name="Configuration" value="${msbuild.configuration}" />
125
- <property name="OutputPath" value="${msbuild.outputpath}" />
126
- <property name="Platform" value="${msbuild.platform}" />
127
- <property name="TargetFrameworkVersion" value="v${framework::get-version(microsoft.framework.specific)}" />
128
- <property name="ToolsVersion" value="${framework::get-version(microsoft.framework.specific)}" />
129
- </msbuild>
130
- </if>
131
- <if test="${not framework.multitargeting}">
132
- <msbuild project="${solution.path}" verbosity="minimal">
133
- <property name="Configuration" value="${msbuild.configuration}" />
134
- <property name="OutputPath" value="${msbuild.outputpath}" />
135
- <property name="Platform" value="${msbuild.platform}" />
136
- <property name="TargetFrameworkVersion" value="v${framework::get-version(microsoft.framework.specific)}" />
137
- </msbuild>
138
- </if>
124
+ <mkdir dir="${msbuild.outputpath}" />
125
+ <if test="${platform::is-unix()}">
126
+ <!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
127
+ <echo message="Cleaning build..." />
128
+ <exec program="xbuild"
129
+ basedir="/usr/bin"
130
+ workingdir="${dirs.build}"
131
+ commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" />
132
+ <echo message="Building..." />
133
+ <exec program="xbuild"
134
+ basedir="/usr/bin"
135
+ workingdir="${dirs.build}"
136
+ commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger" />
139
137
  </if>
140
- <if test="${not msbuild.override_output_path}">
141
- <if test="${framework.multitargeting}">
142
- <msbuild project="${solution.path}" verbosity="minimal">
143
- <property name="Configuration" value="${msbuild.configuration}" />
144
- <property name="Platform" value="${msbuild.platform}" />
145
- <property name="TargetFrameworkVersion" value="v${framework::get-version(microsoft.framework.specific)}" />
146
- <property name="ToolsVersion" value="${framework::get-version(microsoft.framework.specific)}" />
138
+ <if test="${platform::is-windows()}">
139
+ <!-- nant is retarded - I had to have four of these instead of throwing an if on the outputpath and targets -->
140
+ <if test="${msbuild.override_output_path}">
141
+ <if test="${framework.multitargeting}">
142
+ <msbuild project="${solution.path}" verbosity="minimal">
143
+ <property name="Configuration" value="${msbuild.configuration}" />
144
+ <property name="OutputPath" value="${msbuild.outputpath}" />
145
+ <property name="Platform" value="${msbuild.platform}" />
146
+ <property name="TargetFrameworkVersion" value="v${framework::get-version(microsoft.framework.specific)}" />
147
+ <property name="ToolsVersion" value="${framework::get-version(microsoft.framework.specific)}" />
147
148
  </msbuild>
149
+ </if>
150
+ <if test="${not framework.multitargeting}">
151
+ <msbuild project="${solution.path}" verbosity="minimal">
152
+ <property name="Configuration" value="${msbuild.configuration}" />
153
+ <property name="OutputPath" value="${msbuild.outputpath}" />
154
+ <property name="Platform" value="${msbuild.platform}" />
155
+ </msbuild>
156
+ </if>
148
157
  </if>
149
- <if test="${not framework.multitargeting}">
150
- <msbuild project="${solution.path}" verbosity="minimal">
151
- <property name="Configuration" value="${msbuild.configuration}" />
152
- <property name="Platform" value="${msbuild.platform}" />
153
- <property name="TargetFrameworkVersion" value="v${framework::get-version(microsoft.framework.specific)}" />
154
- </msbuild>
158
+ <if test="${not msbuild.override_output_path}">
159
+ <if test="${framework.multitargeting}">
160
+ <msbuild project="${solution.path}" verbosity="minimal">
161
+ <property name="Configuration" value="${msbuild.configuration}" />
162
+ <property name="Platform" value="${msbuild.platform}" />
163
+ <property name="TargetFrameworkVersion" value="v${framework::get-version(microsoft.framework.specific)}" />
164
+ <property name="ToolsVersion" value="${framework::get-version(microsoft.framework.specific)}" />
165
+ </msbuild>
166
+ </if>
167
+ <if test="${not framework.multitargeting}">
155
168
  </if>
169
+ <msbuild project="${solution.path}" verbosity="minimal">
170
+ <property name="Configuration" value="${msbuild.configuration}" />
171
+ <property name="Platform" value="${msbuild.platform}" />
172
+ </msbuild>
173
+ </if>
156
174
  </if>
157
175
  </target>
158
176
 
159
177
  <target name="build_vb6_code">
160
- <vb6 project="${solution.path}" outdir="${dirs.build}\${folder.app.drop}" />
178
+ <vb6 project="${solution.path}" outdir="${dirs.build}${path.separator}${folder.app.drop}" />
161
179
  </target>
162
180
 
163
181
  <target name="copy_documentation">
164
- <echo message="Building documentation files to ${dirs.build}\${folder.documentation}."/>
165
- <copy todir="${dirs.build}\${folder.documentation}">
182
+ <echo message="Building documentation files to ${dirs.build}${path.separator}${folder.documentation}."/>
183
+ <copy todir="${dirs.build}${path.separator}${folder.documentation}">
166
184
  <fileset basedir="${dirs.docs}">
167
185
  <include name="**/*.*" />
168
186
  </fileset>
@@ -170,8 +188,8 @@
170
188
  </target>
171
189
 
172
190
  <target name="copy_db">
173
- <echo message="Building database files to ${dirs.build}\${folder.database}."/>
174
- <copy todir="${dirs.build}\${folder.database}">
191
+ <echo message="Building database files to ${dirs.build}${path.separator}${folder.database}."/>
192
+ <copy todir="${dirs.build}${path.separator}${folder.database}">
175
193
  <fileset basedir="${dirs.db}">
176
194
  <include name="**/*.*" />
177
195
  </fileset>
@@ -1,76 +1,77 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <project name="Customize UppercuT" default="go">
3
- <!-- Project UppercuT - http://projectuppercut.org -->
4
- <!-- 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 -->
5
- <property name="build.config.settings" value="__NONE__" overwrite="false" />
6
- <include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
7
- <property name="file.current.no_extension" value="customize" />
8
- <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
9
- <property name="path.to.toplevel" value=".." />
10
- <property name="folder.build_scripts_custom" value="build.custom" overwrite="false" />
11
- <property name="dirs.build_scripts_custom" value="${dirs.current}\${path.to.toplevel}\${folder.build_scripts_custom}" />
12
- <property name="customize.step.name" value="__REPLACE__" overwrite="false" />
13
- <property name="customize.step.type" value="__REPLACE__" overwrite="false" />
14
- <property name="customize.step.type.lowered" value="${string::to-lower(customize.step.type)}" />
15
- <property name="file.customize.template" value="item.template" />
16
- <property name="file.customized" value="" readonly="false" />
17
- <property name="path.to.custom_file" value="-1" />
18
- <property name="path.to.custom_file" value="" if="${file::exists(customize.step.name)}" />
19
-
20
- <target name="go" depends="run_tasks, report_finish_time" />
21
-
22
- <target name="run_tasks">
23
- <echo message="Running ${project::get-name()} to create custom tasks." />
24
- <call target="prepare" if="${target::exists('prepare')}" />
25
- <call target="run_normal_tasks" />
26
- </target>
27
-
28
- <target name="run_normal_tasks"
29
- depends="error_check, customize"
30
- description="Setting up a customize file for UppercuT." />
31
-
32
- <target name="error_check">
33
- <echo message="Error checking - the input for customize.step.name is '${customize.step.name}' and the input for customize.step.type is '${customize.step.type}'." />
34
- <fail message="Please send in the arguments for what step to customize and what type of customization. Call customize.bat /? for usage instructions."
35
- if="${customize.step.name=='__REPLACE__' or customize.step.type =='__REPLACE__'}" />
36
- <fail message="The type of customization can only be pre, post, or replace."
37
- unless="${customize.step.type.lowered =='pre' or customize.step.type.lowered =='post' or customize.step.type.lowered =='replace'}" />
38
- </target>
39
-
40
- <target name="customize">
41
- <property name="file.customized" value="${path::get-file-name-without-extension(customize.step.name)}.${customize.step.type.lowered}${path::get-extension(customize.step.name)}" />
42
- <echo message="Creating a customized step called ${file.customized}." />
43
- <call target="resolve_path_to_custom_file" />
44
- <fail message="${file.customized} already exists in ${dirs.build_scripts_custom}. Will not run." if="${file::exists(dirs.build_scripts_custom + '\' + file.customized)}" />
45
- <call target="create_file_if_not_already_existing" />
46
- <call target="replace_template_values" />
47
- </target>
48
-
49
- <target name="resolve_path_to_custom_file">
50
- <property name="path.to.custom_file" value="\analyzers" if="${file::exists('analyzers\' + customize.step.name)}" />
51
- <property name="path.to.custom_file" value="\versioners" if="${file::exists('versioners\' + customize.step.name)}" />
52
- <fail message="${customize.step.name} does not exist in anywhere in the build directory." if="${path.to.custom_file=='-1'}" />
53
- <property name="dirs.build_scripts_custom" value="${dirs.build_scripts_custom}${path.to.custom_file}" />
54
- <echo message="Found ${customize.step.name} in '${dirs.current}\${path.to.custom_file}'. This means the custom path is going to be ${dirs.build_scripts_custom}." />
55
- </target>
56
-
57
- <target name="create_file_if_not_already_existing">
58
- <copy file="customizers\${file.customize.template}" tofile="${dirs.build_scripts_custom}\${file.customized}" if="${not file::exists(dirs.build_scripts_custom + '\' + file.customized)}" />
59
- </target>
60
-
61
- <target name="replace_template_values">
62
- <xmlpoke
63
- file="${dirs.build_scripts_custom}\${file.customized}"
64
- xpath="/project/@name"
65
- value="CUSTOM ${string::to-upper(customize.step.type)} ${string::to-upper(path::get-file-name-without-extension(customize.step.name))}" />
66
- <xmlpoke
67
- file="${dirs.build_scripts_custom}\${file.customized}"
68
- xpath="/project/property[@name = 'path.to.toplevel']/@value"
69
- value="..\.." if="${path.to.custom_file !=''}" />
70
- </target>
71
-
72
- <target name="report_finish_time">
73
- <echo message="Customize finished at ${datetime::now()}. Please make any customizations you need to now to ${dirs.build_scripts_custom}\${file.customized} and don't forget to add it to source control." />
74
- </target>
75
-
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <project name="Customize UppercuT" default="go">
3
+ <!-- Project UppercuT - http://projectuppercut.org -->
4
+ <!-- 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 -->
5
+ <property name="build.config.settings" value="__NONE__" overwrite="false" />
6
+ <include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
7
+ <property name="path.separator" value="${string::trim(path::combine(' ', ' '))}" />
8
+ <property name="file.current.no_extension" value="customize" />
9
+ <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
10
+ <property name="path.to.toplevel" value=".." />
11
+ <property name="folder.build_scripts_custom" value="build.custom" overwrite="false" />
12
+ <property name="dirs.build_scripts_custom" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.build_scripts_custom}" />
13
+ <property name="customize.step.name" value="__REPLACE__" overwrite="false" />
14
+ <property name="customize.step.type" value="__REPLACE__" overwrite="false" />
15
+ <property name="customize.step.type.lowered" value="${string::to-lower(customize.step.type)}" />
16
+ <property name="file.customize.template" value="item.template" />
17
+ <property name="file.customized" value="" readonly="false" />
18
+ <property name="path.to.custom_file" value="-1" />
19
+ <property name="path.to.custom_file" value="" if="${file::exists(customize.step.name)}" />
20
+
21
+ <target name="go" depends="run_tasks, report_finish_time" />
22
+
23
+ <target name="run_tasks">
24
+ <echo message="Running ${project::get-name()} to create custom tasks." />
25
+ <call target="prepare" if="${target::exists('prepare')}" />
26
+ <call target="run_normal_tasks" />
27
+ </target>
28
+
29
+ <target name="run_normal_tasks"
30
+ depends="error_check, customize"
31
+ description="Setting up a customize file for UppercuT." />
32
+
33
+ <target name="error_check">
34
+ <echo message="Error checking - the input for customize.step.name is '${customize.step.name}' and the input for customize.step.type is '${customize.step.type}'." />
35
+ <fail message="Please send in the arguments for what step to customize and what type of customization. Call customize.bat /? for usage instructions."
36
+ if="${customize.step.name=='__REPLACE__' or customize.step.type =='__REPLACE__'}" />
37
+ <fail message="The type of customization can only be pre, post, or replace."
38
+ unless="${customize.step.type.lowered =='pre' or customize.step.type.lowered =='post' or customize.step.type.lowered =='replace'}" />
39
+ </target>
40
+
41
+ <target name="customize">
42
+ <property name="file.customized" value="${path::get-file-name-without-extension(customize.step.name)}.${customize.step.type.lowered}${path::get-extension(customize.step.name)}" />
43
+ <echo message="Creating a customized step called ${file.customized}." />
44
+ <call target="resolve_path_to_custom_file" />
45
+ <fail message="${file.customized} already exists in ${dirs.build_scripts_custom}. Will not run." if="${file::exists(dirs.build_scripts_custom + path.separator + file.customized)}" />
46
+ <call target="create_file_if_not_already_existing" />
47
+ <call target="replace_template_values" />
48
+ </target>
49
+
50
+ <target name="resolve_path_to_custom_file">
51
+ <property name="path.to.custom_file" value="${path.separator}analyzers" if="${file::exists('analyzers' + path.separator + customize.step.name)}" />
52
+ <property name="path.to.custom_file" value="${path.separator}versioners" if="${file::exists('versioners' + path.separator + customize.step.name)}" />
53
+ <fail message="${customize.step.name} does not exist in anywhere in the build directory." if="${path.to.custom_file=='-1'}" />
54
+ <property name="dirs.build_scripts_custom" value="${dirs.build_scripts_custom}${path.to.custom_file}" />
55
+ <echo message="Found ${customize.step.name} in '${dirs.current}${path.separator}${path.to.custom_file}'. This means the custom path is going to be ${dirs.build_scripts_custom}." />
56
+ </target>
57
+
58
+ <target name="create_file_if_not_already_existing">
59
+ <copy file="customizers${path.separator}${file.customize.template}" tofile="${dirs.build_scripts_custom}${path.separator}${file.customized}" if="${not file::exists(dirs.build_scripts_custom + path.separator + file.customized)}" />
60
+ </target>
61
+
62
+ <target name="replace_template_values">
63
+ <xmlpoke
64
+ file="${dirs.build_scripts_custom}${path.separator}${file.customized}"
65
+ xpath="/project/@name"
66
+ value="CUSTOM ${string::to-upper(customize.step.type)} ${string::to-upper(path::get-file-name-without-extension(customize.step.name))}" />
67
+ <xmlpoke
68
+ file="${dirs.build_scripts_custom}${path.separator}${file.customized}"
69
+ xpath="/project/property[@name = 'path.to.toplevel']/@value"
70
+ value="..${path.separator}.." if="${path.to.custom_file !=''}" />
71
+ </target>
72
+
73
+ <target name="report_finish_time">
74
+ <echo message="Customize finished at ${datetime::now()}. Please make any customizations you need to now to ${dirs.build_scripts_custom}${path.separator}${file.customized} and don't forget to add it to source control." />
75
+ </target>
76
+
76
77
  </project>
@@ -1,50 +1,51 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <project name="__REPLACE__" default="go">
3
- <!-- Project UppercuT - http://projectuppercut.org -->
4
- <property name="build.config.settings" value="__NONE__" overwrite="false" />
5
- <include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
6
- <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
7
- <property name="path.to.toplevel" value=".." />
8
- <property name="folder.build_scripts" value="build" overwrite="false" />
9
- <property name="dirs.build_scripts" value="${dirs.current}\${path.to.toplevel}\${folder.build_scripts}" />
10
- <property name="folder.build_scripts_custom" value="build.custom" overwrite="false" />
11
- <property name="dirs.build_scripts_custom" value="${dirs.current}\${path.to.toplevel}\${folder.build_scripts_custom}" />
12
- <property name="folder.code_build" value="build_output" overwrite="false" />
13
- <property name="dirs.build" value="${dirs.current}\${path.to.toplevel}\${folder.code_build}" />
14
- <property name="folder.code_drop" value="code_drop" overwrite="false" />
15
- <property name="dirs.drop" value="${dirs.current}\${path.to.toplevel}\${folder.code_drop}" overwrite="false" />
16
- <property name="folder.app.drop" value="${project.name}" overwrite="false" />
17
- <property name="folder.database" value="__DATABASE_FOLDER_NAME__" overwrite="false" />
18
- <property name="dirs.database" value="${dirs.current}\${path.to.toplevel}\${folder.database}" overwrite="false" />
19
- <property name="folder.reports" value="${project.name}.Reports" overwrite="false" />
20
- <property name="dirs.reports" value="${dirs.current}\${path.to.toplevel}\${folder.reports}" overwrite="false" />
21
- <property name="folder.file_server" value="file.server" overwrite="false" />
22
- <property name="dirs.file_server" value="${dirs.current}\${path.to.toplevel}\${folder.file_server}" overwrite="false" />
23
- <property name="folder.environment_files" value="environment.files" overwrite="false" />
24
- <property name="dirs.environment_files" value="${dirs.current}\${path.to.toplevel}\${folder.environment_files}" overwrite="false" />
25
- <property name="folder.deployment" value="deployment" overwrite="false" />
26
- <property name="dirs.deployment" value="${dirs.current}\${path.to.toplevel}\${folder.deployment}" overwrite="false" />
27
- <property name="folder.settings" value="settings" overwrite="false" />
28
- <property name="dirs.settings" value="${dirs.current}\${path.to.toplevel}\${folder.settings}" overwrite="false" />
29
- <property name="folder.documentation" value="docs" overwrite="false" />
30
- <property name="dirs.docs" value="${dirs.current}\${path.to.toplevel}\${folder.documentation}" overwrite="false" />
31
- <property name="folder.references" value="lib" overwrite="false" />
32
- <property name="dirs.lib" value="${dirs.current}\${path.to.toplevel}\${folder.references}" overwrite="false" />
33
-
34
- <target name="go" depends="run_tasks" />
35
-
36
- <target name="run_tasks">
37
- <!-- INSERT YOUR TASKS HERE OR CALL OUT TO OTHER TASKS -->
38
- <!-- Sample provided below that you can customize -->
39
- </target>
40
-
41
- <!--<target name="documentation">
42
- <echo message="Packaging documentation files to ${dirs.drop}\${folder.documentation}."/>
43
- <copy todir="${dirs.drop}\${folder.documentation}">
44
- <fileset basedir="${dirs.build}\${folder.documentation}">
45
- <include name="**/*.*" />
46
- </fileset>
47
- </copy>
48
- </target>-->
49
-
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <project name="__REPLACE__" default="go">
3
+ <!-- Project UppercuT - http://projectuppercut.org -->
4
+ <property name="build.config.settings" value="__NONE__" overwrite="false" />
5
+ <include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
6
+ <property name="path.separator" value="${string::trim(path::combine(' ', ' '))}" />
7
+ <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
8
+ <property name="path.to.toplevel" value=".." />
9
+ <property name="folder.build_scripts" value="build" overwrite="false" />
10
+ <property name="dirs.build_scripts" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.build_scripts}" />
11
+ <property name="folder.build_scripts_custom" value="build.custom" overwrite="false" />
12
+ <property name="dirs.build_scripts_custom" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.build_scripts_custom}" />
13
+ <property name="folder.code_build" value="build_output" overwrite="false" />
14
+ <property name="dirs.build" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.code_build}" />
15
+ <property name="folder.code_drop" value="code_drop" overwrite="false" />
16
+ <property name="dirs.drop" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.code_drop}" overwrite="false" />
17
+ <property name="folder.app.drop" value="${project.name}" overwrite="false" />
18
+ <property name="folder.database" value="__DATABASE_FOLDER_NAME__" overwrite="false" />
19
+ <property name="dirs.database" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.database}" overwrite="false" />
20
+ <property name="folder.reports" value="${project.name}.Reports" overwrite="false" />
21
+ <property name="dirs.reports" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.reports}" overwrite="false" />
22
+ <property name="folder.file_server" value="file.server" overwrite="false" />
23
+ <property name="dirs.file_server" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.file_server}" overwrite="false" />
24
+ <property name="folder.environment_files" value="environment.files" overwrite="false" />
25
+ <property name="dirs.environment_files" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.environment_files}" overwrite="false" />
26
+ <property name="folder.deployment" value="deployment" overwrite="false" />
27
+ <property name="dirs.deployment" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.deployment}" overwrite="false" />
28
+ <property name="folder.settings" value="settings" overwrite="false" />
29
+ <property name="dirs.settings" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.settings}" overwrite="false" />
30
+ <property name="folder.documentation" value="docs" overwrite="false" />
31
+ <property name="dirs.docs" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.documentation}" overwrite="false" />
32
+ <property name="folder.references" value="lib" overwrite="false" />
33
+ <property name="dirs.lib" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.references}" overwrite="false" />
34
+
35
+ <target name="go" depends="run_tasks" />
36
+
37
+ <target name="run_tasks">
38
+ <!-- INSERT YOUR TASKS HERE OR CALL OUT TO OTHER TASKS -->
39
+ <!-- Sample provided below that you can customize -->
40
+ </target>
41
+
42
+ <!--<target name="documentation">
43
+ <echo message="Packaging documentation files to ${dirs.drop}${path.separator}${folder.documentation}."/>
44
+ <copy todir="${dirs.drop}${path.separator}${folder.documentation}">
45
+ <fileset basedir="${dirs.build}${path.separator}${folder.documentation}">
46
+ <include name="**/*.*" />
47
+ </fileset>
48
+ </copy>
49
+ </target>-->
50
+
50
51
  </project>
@@ -1,168 +1,172 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <project name="UppercuTBuild" default="go">
3
- <!-- Project UppercuT - http://projectuppercut.org -->
4
- <!-- 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 -->
5
- <property name="build.config.settings" value="__NONE__" overwrite="false" />
6
- <include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
7
- <property name="file.current.no_extension" value="default" />
8
- <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
9
- <property name="path.to.toplevel" value=".." />
10
- <property name="folder.build_scripts" value="build" overwrite="false" />
11
- <property name="folder.build_scripts_custom" value="build.custom" overwrite="false" />
12
- <property name="dirs.build_scripts_custom" value="${dirs.current}\${path.to.toplevel}\${folder.build_scripts_custom}" />
13
- <property name="folder.code_build" value="build_output" overwrite="false" />
14
- <property name="dirs.build" value="${dirs.current}\${path.to.toplevel}\${folder.code_build}" />
15
- <property name="folder.code_drop" value="code_drop" overwrite="false" />
16
- <property name="dirs.drop" value="${dirs.current}\${path.to.toplevel}\${folder.code_drop}" overwrite="false" />
17
- <property name="project.name" value="__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__" overwrite="false" />
18
- <property name="repository.path" value="__REPOSITORY_PATH__" overwrite="false" />
19
- <property name="company.name" value="__COMPANY_NAME__" overwrite="false" />
20
- <property name="source_control_type" value="svn" overwrite="false" />
21
- <property name="version.uppercut" value="0" />
22
- <property name="version.revision" value="0" />
23
- <property name="version.hash" value="${version.revision}" overwrite="false" />
24
- <property name="version.build" value="0" />
25
- <property name="allow.powershell.unrestricted" value="false" overwrite="false" />
26
- <property name="run.ilmerge" value="false" overwrite="false" />
27
- <property name="file.uppercut.assembly" value="uppercut.tasks.dll" />
28
- <property name="path.uppercut.assembly" value="${dirs.current}\${file.uppercut.assembly}" />
29
- <property name="file.custom.step.before" value="${dirs.build_scripts_custom}\${file.current.no_extension}.pre.build" />
30
- <property name="file.custom.step.after" value="${dirs.build_scripts_custom}\${file.current.no_extension}.post.build" />
31
- <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}\${file.current.no_extension}.replace.build" />
32
- <property name="is.replaced" value="false" />
33
- <property name="fail.build.on.error" value="true" />
34
-
35
- <target name="go" depends="load_uppercut_assemblies, allow_powershell_unrestricted, report_uppercut_version, run_tasks, report_finish_time" />
36
-
37
- <target name="run_tasks">
38
- <echo message="Running ${project::get-name()} tasks." />
39
- <call target="prepare" if="${target::exists('prepare')}" />
40
- <call target="custom_tasks_before" if="${target::exists('custom_tasks_before')}" />
41
- <call target="custom_tasks_replace" if="${target::exists('custom_tasks_replace')}" />
42
- <call target="run_normal_tasks" if="${not is.replaced}" />
43
- <call target="custom_tasks_after" if="${target::exists('custom_tasks_after')}" />
44
- </target>
45
-
46
- <target name="run_normal_tasks"
47
- depends="error_check, build"
48
- description="Building with UppercuT default.build." />
49
-
50
- <target name="custom_tasks_before">
51
- <echo message="Running custom tasks if ${file.custom.step.before} exists." />
52
- <nant buildfile="${file.custom.step.before}" inheritall="true" if="${file::exists(file.custom.step.before)}" failonerror="${fail.build.on.error}" />
53
- <exec program="powershell.exe" if="${file::exists(file.custom.step.before + '.ps1')}" failonerror="${fail.build.on.error}">
54
- <arg value="${path::get-full-path(file.custom.step.before + '.ps1')}" />
55
- </exec>
56
- <exec program="ruby.exe" if="${file::exists(file.custom.step.before + '.rb')}" failonerror="${fail.build.on.error}">
57
- <arg value="${path::get-full-path(file.custom.step.before + '.rb')}" />
58
- </exec>
59
- </target>
60
-
61
- <target name="custom_tasks_replace">
62
- <echo message="Running custom tasks instead of normal tasks if ${file.custom.step.replace} exists." />
63
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace)}" />
64
- <nant buildfile="${file.custom.step.replace}" inheritall="true" if="${file::exists(file.custom.step.replace)}" failonerror="${fail.build.on.error}" />
65
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.ps1')}" />
66
- <exec program="powershell.exe" if="${file::exists(file.custom.step.replace + '.ps1')}" failonerror="${fail.build.on.error}" >
67
- <arg value="${path::get-full-path(file.custom.step.replace + '.ps1')}" />
68
- </exec>
69
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.rb')}" />
70
- <exec program="ruby.exe" if="${file::exists(file.custom.step.replace + '.rb')}" failonerror="${fail.build.on.error}" >
71
- <arg value="${path::get-full-path(file.custom.step.replace + '.rb')}" />
72
- </exec>
73
- </target>
74
-
75
- <target name="prepare">
76
- <echo message="Removing and adding ${dirs.build}."/>
77
- <delete dir="${dirs.build}" failonerror="false" />
78
- <mkdir dir="${dirs.build}" failonerror="false" />
79
- </target>
80
-
81
- <target name="error_check">
82
- <fail message="You must fill out the project.name, repository.path, and company.name settings in the settings\UppercuT.config file. Please do that and retry the build."
83
- if="${project.name=='__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__' or repository.path=='__REPOSITORY_PATH__' or company.name=='__COMPANY_NAME__'}" />
84
- </target>
85
-
86
- <target name="build">
87
- <call target="get_revision" />
88
- <call target="get_build_number" />
89
- <call target="get_drop_directory" />
90
-
91
- <nant buildfile="${dirs.current}\policyChecks.step" inheritall="true" />
92
- <nant buildfile="${dirs.current}\versionBuilder.step" inheritall="true" />
93
- <nant buildfile="${dirs.current}\generateBuildInfo.step" inheritall="true" />
94
- <nant buildfile="${dirs.current}\compile.step" inheritall="true" />
95
- <nant buildfile="${dirs.current}\environmentBuilder.step" inheritall="true" />
96
- <nant buildfile="${dirs.current}\analyze.step" inheritall="true" />
97
- <nant buildfile="${dirs.current}\package.step" inheritall="true" />
98
- <nant buildfile="${dirs.current}\ilmerge.build" inheritall="true" if="${run.ilmerge}" />
99
- <nant buildfile="${dirs.current}\gemsPrepare.step" inheritall="true" />
100
- <nant buildfile="${dirs.current}\gemsBuild.step" inheritall="true" />
101
- </target>
102
-
103
- <target name="get_revision">
104
- <nant buildfile="${dirs.current}\versioners\svn.step" inheritall="true" if="${source_control_type=='svn'}" failonerror="false" />
105
- <nant buildfile="${dirs.current}\versioners\tfs.step" inheritall="true" if="${source_control_type=='tfs'}" failonerror="false" />
106
- <nant buildfile="${dirs.current}\versioners\git.step" inheritall="true" if="${source_control_type=='git'}" failonerror="false" />
107
- <nant buildfile="${dirs.current}\versioners\hg.step" inheritall="true" if="${source_control_type=='hg'}" failonerror="false" />
108
- <!--<nant buildfile="${dirs.current}\versioners\vault.step" inheritall="true" if="${source_control_type=='vault'}" />-->
109
- <!--<nant buildfile="${dirs.current}\versioners\vss.step" inheritall="true" if="${source_control_type=='vss'}" />-->
110
-
111
- <property name="version.revision" value="${environment::get-variable('uc.app.revision')}" if="${environment::variable-exists('uc.app.revision')}" />
112
- <property name="version.hash" value="${environment::get-variable('uc.app.revision.hash')}" if="${environment::variable-exists('uc.app.revision.hash')}" />
113
- <property name="version.hash" value="${version.revision}" if="${version.hash == '0'}" />
114
- <echo message="Using revision number: ${version.revision} and hash: ${version.hash}." />
115
- </target>
116
-
117
- <target name="get_build_number">
118
- <property name="version.build" value="${environment::get-variable('CCNetNumericLabel')}" if="${environment::variable-exists('CCNetNumericLabel')}" />
119
- <property name="version.build" value="${environment::get-variable('BUILD_NUMBER')}" if="${environment::variable-exists('BUILD_NUMBER')}" />
120
- <echo message="Using build number ${version.build}." />
121
- </target>
122
-
123
- <target name="get_drop_directory">
124
- <property name="dirs.drop" value="${environment::get-variable('CCNetArtifactDirectory')}\b${version.build}-r${version.revision}" if="${environment::variable-exists('CCNetArtifactDirectory')}" />
125
- <!--Point TeamCity at code_drop for an artifact directory. It will automatically save the files. -->
126
- <echo message="Compiled code drop directory will be ${path::get-full-path(dirs.drop)}." />
127
- </target>
128
-
129
- <target name="custom_tasks_after">
130
- <echo message="Running custom tasks if ${file.custom.step.after} exists." />
131
- <nant buildfile="${file.custom.step.after}" inheritall="true" if="${file::exists(file.custom.step.after)}" failonerror="${fail.build.on.error}" />
132
- <exec program="powershell.exe" if="${file::exists(file.custom.step.after + '.ps1')}" failonerror="${fail.build.on.error}" >
133
- <arg value="${path::get-full-path(file.custom.step.after + '.ps1')}" />
134
- </exec>
135
- <exec program="ruby.exe" if="${file::exists(file.custom.step.after + '.rb')}" failonerror="${fail.build.on.error}" >
136
- <arg value="${path::get-full-path(file.custom.step.after + '.rb')}" />
137
- </exec>
138
- </target>
139
-
140
- <target name="report_finish_time">
141
- <echo message="Build finished at ${datetime::now()} with UppercuT version ${version.uppercut}." />
142
- </target>
143
-
144
- <target name="report_uppercut_version">
145
- <xmlpeek
146
- file="UppercuT.xml"
147
- xpath="/uppercut/version"
148
- property="version.uppercut"
149
- failonerror="false" />
150
- <echo message="Using UppercuT version: ${version.uppercut}." />
151
- </target>
152
-
153
- <target name="load_uppercut_assemblies">
154
- <loadtasks assembly="${path.uppercut.assembly}" if="${file::exists(path.uppercut.assembly)}" />
155
- </target>
156
-
157
- <target name="allow_powershell_unrestricted">
158
- <!-- powershell 1.0 -->
159
- <exec program="powershell.exe" if="${allow.powershell.unrestricted}" failonerror="false">
160
- <arg value="set-executionpolicy unrestricted" />
161
- </exec>
162
- <!-- powershell 2.0 -->
163
- <exec program="powershell.exe" if="${allow.powershell.unrestricted}" failonerror="false">
164
- <arg value="set-executionpolicy unrestricted -force -scope CurrentUser" />
165
- </exec>
166
- </target>
167
-
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <project name="UppercuTBuild" default="go">
3
+ <!-- Project UppercuT - http://projectuppercut.org -->
4
+ <!-- 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 -->
5
+ <property name="build.config.settings" value="__NONE__" overwrite="false" />
6
+ <include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
7
+ <property name="path.separator" value="${string::trim(path::combine(' ', ' '))}" />
8
+ <property name="file.current.no_extension" value="default" />
9
+ <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
10
+ <property name="path.to.toplevel" value=".." />
11
+ <property name="folder.build_scripts" value="build" overwrite="false" />
12
+ <property name="folder.build_scripts_custom" value="build.custom" overwrite="false" />
13
+ <property name="dirs.build_scripts_custom" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.build_scripts_custom}" />
14
+ <property name="folder.code_build" value="build_output" overwrite="false" />
15
+ <property name="dirs.build" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.code_build}" />
16
+ <property name="folder.code_drop" value="code_drop" overwrite="false" />
17
+ <property name="dirs.drop" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.code_drop}" overwrite="false" />
18
+ <property name="project.name" value="__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__" overwrite="false" />
19
+ <property name="repository.path" value="__REPOSITORY_PATH__" overwrite="false" />
20
+ <property name="company.name" value="__COMPANY_NAME__" overwrite="false" />
21
+ <property name="source_control_type" value="svn" overwrite="false" />
22
+ <property name="version.uppercut" value="0" />
23
+ <property name="version.major" value="0" overwrite="false" />
24
+ <property name="version.minor" value="0" overwrite="false" />
25
+ <property name="version.patch" value="0" overwrite="false" />
26
+ <property name="version.build" value="0" />
27
+ <property name="version.revision" value="0" />
28
+ <property name="version.hash" value="${version.revision}" overwrite="false" />
29
+ <property name="allow.powershell.unrestricted" value="false" overwrite="false" />
30
+ <property name="run.ilmerge" value="false" overwrite="false" />
31
+ <property name="file.uppercut.assembly" value="uppercut.tasks.dll" />
32
+ <property name="path.uppercut.assembly" value="${dirs.current}${path.separator}${file.uppercut.assembly}" />
33
+ <property name="file.custom.step.before" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.pre.build" />
34
+ <property name="file.custom.step.after" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.post.build" />
35
+ <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.replace.build" />
36
+ <property name="is.replaced" value="false" />
37
+ <property name="fail.build.on.error" value="true" />
38
+
39
+ <target name="go" depends="load_uppercut_assemblies, allow_powershell_unrestricted, report_uppercut_version, run_tasks, report_finish_time" />
40
+
41
+ <target name="run_tasks">
42
+ <echo message="Running ${project::get-name()} tasks." />
43
+ <call target="prepare" if="${target::exists('prepare')}" />
44
+ <call target="custom_tasks_before" if="${target::exists('custom_tasks_before')}" />
45
+ <call target="custom_tasks_replace" if="${target::exists('custom_tasks_replace')}" />
46
+ <call target="run_normal_tasks" if="${not is.replaced}" />
47
+ <call target="custom_tasks_after" if="${target::exists('custom_tasks_after')}" />
48
+ </target>
49
+
50
+ <target name="run_normal_tasks"
51
+ depends="error_check, build"
52
+ description="Building with UppercuT default.build." />
53
+
54
+ <target name="custom_tasks_before">
55
+ <echo message="Running custom tasks if ${file.custom.step.before} exists." />
56
+ <nant buildfile="${file.custom.step.before}" inheritall="true" if="${file::exists(file.custom.step.before)}" failonerror="${fail.build.on.error}" />
57
+ <exec program="powershell.exe" if="${file::exists(file.custom.step.before + '.ps1')}" failonerror="${fail.build.on.error}">
58
+ <arg value="${path::get-full-path(file.custom.step.before + '.ps1')}" />
59
+ </exec>
60
+ <exec program="ruby.exe" if="${file::exists(file.custom.step.before + '.rb')}" failonerror="${fail.build.on.error}">
61
+ <arg value="${path::get-full-path(file.custom.step.before + '.rb')}" />
62
+ </exec>
63
+ </target>
64
+
65
+ <target name="custom_tasks_replace">
66
+ <echo message="Running custom tasks instead of normal tasks if ${file.custom.step.replace} exists." />
67
+ <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace)}" />
68
+ <nant buildfile="${file.custom.step.replace}" inheritall="true" if="${file::exists(file.custom.step.replace)}" failonerror="${fail.build.on.error}" />
69
+ <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.ps1')}" />
70
+ <exec program="powershell.exe" if="${file::exists(file.custom.step.replace + '.ps1')}" failonerror="${fail.build.on.error}" >
71
+ <arg value="${path::get-full-path(file.custom.step.replace + '.ps1')}" />
72
+ </exec>
73
+ <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.rb')}" />
74
+ <exec program="ruby.exe" if="${file::exists(file.custom.step.replace + '.rb')}" failonerror="${fail.build.on.error}" >
75
+ <arg value="${path::get-full-path(file.custom.step.replace + '.rb')}" />
76
+ </exec>
77
+ </target>
78
+
79
+ <target name="prepare">
80
+ <echo message="Removing and adding ${dirs.build}."/>
81
+ <delete dir="${dirs.build}" failonerror="false" />
82
+ <mkdir dir="${dirs.build}" failonerror="false" />
83
+ </target>
84
+
85
+ <target name="error_check">
86
+ <fail message="You must fill out the project.name, repository.path, and company.name settings in the settings${path.separator}UppercuT.config file. Please do that and retry the build."
87
+ if="${project.name=='__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__' or repository.path=='__REPOSITORY_PATH__' or company.name=='__COMPANY_NAME__'}" />
88
+ </target>
89
+
90
+ <target name="build">
91
+ <call target="get_revision" />
92
+ <call target="get_build_number" />
93
+ <call target="get_drop_directory" />
94
+
95
+ <nant buildfile="${dirs.current}${path.separator}policyChecks.step" inheritall="true" />
96
+ <nant buildfile="${dirs.current}${path.separator}versionBuilder.step" inheritall="true" />
97
+ <nant buildfile="${dirs.current}${path.separator}generateBuildInfo.step" inheritall="true" />
98
+ <nant buildfile="${dirs.current}${path.separator}compile.step" inheritall="true" />
99
+ <nant buildfile="${dirs.current}${path.separator}environmentBuilder.step" inheritall="true" />
100
+ <nant buildfile="${dirs.current}${path.separator}analyze.step" inheritall="true" />
101
+ <nant buildfile="${dirs.current}${path.separator}package.step" inheritall="true" />
102
+ <nant buildfile="${dirs.current}${path.separator}ilmerge.build" inheritall="true" if="${run.ilmerge}" />
103
+ <nant buildfile="${dirs.current}${path.separator}gemsPrepare.step" inheritall="true" />
104
+ <nant buildfile="${dirs.current}${path.separator}gemsBuild.step" inheritall="true" />
105
+ </target>
106
+
107
+ <target name="get_revision">
108
+ <nant buildfile="${dirs.current}${path.separator}versioners${path.separator}svn.step" inheritall="true" if="${source_control_type=='svn'}" failonerror="false" />
109
+ <nant buildfile="${dirs.current}${path.separator}versioners${path.separator}tfs.step" inheritall="true" if="${source_control_type=='tfs'}" failonerror="false" />
110
+ <nant buildfile="${dirs.current}${path.separator}versioners${path.separator}git.step" inheritall="true" if="${source_control_type=='git'}" failonerror="false" />
111
+ <nant buildfile="${dirs.current}${path.separator}versioners${path.separator}hg.step" inheritall="true" if="${source_control_type=='hg'}" failonerror="false" />
112
+ <!--<nant buildfile="${dirs.current}${path.separator}versioners${path.separator}vault.step" inheritall="true" if="${source_control_type=='vault'}" />-->
113
+ <!--<nant buildfile="${dirs.current}${path.separator}versioners${path.separator}vss.step" inheritall="true" if="${source_control_type=='vss'}" />-->
114
+
115
+ <property name="version.revision" value="${environment::get-variable('uc.app.revision')}" if="${environment::variable-exists('uc.app.revision')}" />
116
+ <property name="version.hash" value="${environment::get-variable('uc.app.revision.hash')}" if="${environment::variable-exists('uc.app.revision.hash')}" />
117
+ <property name="version.hash" value="${version.revision}" if="${version.hash == '0'}" />
118
+ <echo message="Using revision number: ${version.revision} and hash: ${version.hash}." />
119
+ </target>
120
+
121
+ <target name="get_build_number">
122
+ <property name="version.build" value="${environment::get-variable('CCNetNumericLabel')}" if="${environment::variable-exists('CCNetNumericLabel')}" />
123
+ <property name="version.build" value="${environment::get-variable('BUILD_NUMBER')}" if="${environment::variable-exists('BUILD_NUMBER')}" />
124
+ <echo message="Using build number ${version.build}." />
125
+ </target>
126
+
127
+ <target name="get_drop_directory">
128
+ <property name="dirs.drop" value="${environment::get-variable('CCNetArtifactDirectory')}${path.separator}b${version.build}-r${version.revision}" if="${environment::variable-exists('CCNetArtifactDirectory')}" />
129
+ <!--Point TeamCity at code_drop for an artifact directory. It will automatically save the files. -->
130
+ <echo message="Compiled code drop directory will be ${path::get-full-path(dirs.drop)}." />
131
+ </target>
132
+
133
+ <target name="custom_tasks_after">
134
+ <echo message="Running custom tasks if ${file.custom.step.after} exists." />
135
+ <nant buildfile="${file.custom.step.after}" inheritall="true" if="${file::exists(file.custom.step.after)}" failonerror="${fail.build.on.error}" />
136
+ <exec program="powershell.exe" if="${file::exists(file.custom.step.after + '.ps1')}" failonerror="${fail.build.on.error}" >
137
+ <arg value="${path::get-full-path(file.custom.step.after + '.ps1')}" />
138
+ </exec>
139
+ <exec program="ruby.exe" if="${file::exists(file.custom.step.after + '.rb')}" failonerror="${fail.build.on.error}" >
140
+ <arg value="${path::get-full-path(file.custom.step.after + '.rb')}" />
141
+ </exec>
142
+ </target>
143
+
144
+ <target name="report_finish_time">
145
+ <echo message="Build finished at ${datetime::now()} with UppercuT version ${version.uppercut}." />
146
+ </target>
147
+
148
+ <target name="report_uppercut_version">
149
+ <xmlpeek
150
+ file="UppercuT.xml"
151
+ xpath="/uppercut/version"
152
+ property="version.uppercut"
153
+ failonerror="false" />
154
+ <echo message="Using UppercuT version: ${version.uppercut}." />
155
+ </target>
156
+
157
+ <target name="load_uppercut_assemblies">
158
+ <loadtasks assembly="${path.uppercut.assembly}" if="${file::exists(path.uppercut.assembly)}" />
159
+ </target>
160
+
161
+ <target name="allow_powershell_unrestricted">
162
+ <!-- powershell 1.0 -->
163
+ <exec program="powershell.exe" if="${allow.powershell.unrestricted}" failonerror="false">
164
+ <arg value="set-executionpolicy unrestricted" />
165
+ </exec>
166
+ <!-- powershell 2.0 -->
167
+ <exec program="powershell.exe" if="${allow.powershell.unrestricted}" failonerror="false">
168
+ <arg value="set-executionpolicy unrestricted -force -scope CurrentUser" />
169
+ </exec>
170
+ </target>
171
+
168
172
  </project>