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
@@ -1,104 +1,105 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <project name="TFSVersioner" default="go">
3
- <!-- Project UppercuT - http://projectuppercut.org -->
4
- <!-- DO NOT EDIT THIS FILE - This creates the assembly file to be used by the rest of the application - 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="tfs" />
8
- <property name="path.to.toplevel" value="..\.." />
9
- <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
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}\versioners" />
13
- <property name="repository.path" value="__REPOSITORY_PATH__" overwrite="false" />
14
- <property name="version.revision" value="0" overwrite="false" />
15
- <property name="tfs.history.output" value="" overwrite="false" />
16
- <property name="file.custom.step.before" value="${dirs.build_scripts_custom}\${file.current.no_extension}.pre.step" />
17
- <property name="file.custom.step.after" value="${dirs.build_scripts_custom}\${file.current.no_extension}.post.step" />
18
- <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}\${file.current.no_extension}.replace.step" />
19
- <property name="is.replaced" value="false" />
20
- <property name="fail.build.on.error" value="false" />
21
-
22
- <target name="go" depends="run_tasks" />
23
-
24
- <target name="run_tasks">
25
- <echo message="Running ${project::get-name()} tasks." />
26
- <call target="prepare" if="${target::exists('prepare')}" />
27
- <call target="custom_tasks_before" if="${target::exists('custom_tasks_before')}" />
28
- <call target="custom_tasks_replace" if="${target::exists('custom_tasks_replace')}" />
29
- <call target="run_normal_tasks" if="${not is.replaced}" />
30
- <call target="custom_tasks_after" if="${target::exists('custom_tasks_after')}" />
31
- </target>
32
-
33
- <target name="run_normal_tasks"
34
- depends="get_revision, get_externally_provided_revision, set_version_environment_variable"
35
- description="Generating Assembly File." />
36
-
37
- <target name="custom_tasks_before">
38
- <echo message="Running custom tasks if ${file.custom.step.before} exists." />
39
- <nant buildfile="${file.custom.step.before}" inheritall="true" if="${file::exists(file.custom.step.before)}" failonerror="${fail.build.on.error}" />
40
- <exec program="powershell.exe" if="${file::exists(file.custom.step.before + '.ps1')}" failonerror="${fail.build.on.error}">
41
- <arg value="${path::get-full-path(file.custom.step.before + '.ps1')}" />
42
- </exec>
43
- <exec program="ruby.exe" if="${file::exists(file.custom.step.before + '.rb')}" failonerror="${fail.build.on.error}">
44
- <arg value="${path::get-full-path(file.custom.step.before + '.rb')}" />
45
- </exec>
46
- </target>
47
-
48
- <target name="custom_tasks_replace">
49
- <echo message="Running custom tasks instead of normal tasks if ${file.custom.step.replace} exists." />
50
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace)}" />
51
- <nant buildfile="${file.custom.step.replace}" inheritall="true" if="${file::exists(file.custom.step.replace)}" failonerror="${fail.build.on.error}" />
52
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.ps1')}" />
53
- <exec program="powershell.exe" if="${file::exists(file.custom.step.replace + '.ps1')}" failonerror="${fail.build.on.error}" >
54
- <arg value="${path::get-full-path(file.custom.step.replace + '.ps1')}" />
55
- </exec>
56
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.rb')}" />
57
- <exec program="ruby.exe" if="${file::exists(file.custom.step.replace + '.rb')}" failonerror="${fail.build.on.error}" >
58
- <arg value="${path::get-full-path(file.custom.step.replace + '.rb')}" />
59
- </exec>
60
- </target>
61
-
62
- <target name="get_revision">
63
- <exec
64
- program="tf"
65
- commandline="history ${dirs.current}\${path.to.toplevel}\ /r /noprompt /stopafter:1 /version:W"
66
- output="_revision.xml"
67
- failonerror="false"/>
68
- <loadfile
69
- file="_revision.xml"
70
- property="tfs.history.output"
71
- failonerror="false"
72
- if="${file::exists('_revision.xml')}"
73
- />
74
- <regex
75
- pattern="^(?'tfschangeset'\d+)\s"
76
- input="${tfs.history.output}"
77
- options="Multiline"
78
- failonerror="false"
79
- />
80
- <property name="version.revision" value="${tfschangeset}" if="${property::exists('tfschangeset')}"/>
81
- <delete file="_revision.xml" failonerror="false" />
82
- </target>
83
-
84
- <target name="get_externally_provided_revision">
85
- <property name="version.revision" value="${environment::get-variable('BUILD_VCS_NUMBER')}" if="${version.revision == '0' and environment::variable-exists('BUILD_VCS_NUMBER')}" />
86
- </target>
87
-
88
- <target name="set_version_environment_variable">
89
- <setenv name="uc.app.revision" value="${version.revision}"/>
90
- <setenv name="uc.app.revision.hash" value="${version.revision}"/>
91
- </target>
92
-
93
- <target name="custom_tasks_after">
94
- <echo message="Running custom tasks if ${file.custom.step.after} exists." />
95
- <nant buildfile="${file.custom.step.after}" inheritall="true" if="${file::exists(file.custom.step.after)}" failonerror="${fail.build.on.error}" />
96
- <exec program="powershell.exe" if="${file::exists(file.custom.step.after + '.ps1')}" failonerror="${fail.build.on.error}" >
97
- <arg value="${path::get-full-path(file.custom.step.after + '.ps1')}" />
98
- </exec>
99
- <exec program="ruby.exe" if="${file::exists(file.custom.step.after + '.rb')}" failonerror="${fail.build.on.error}" >
100
- <arg value="${path::get-full-path(file.custom.step.after + '.rb')}" />
101
- </exec>
102
- </target>
103
-
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <project name="TFSVersioner" default="go">
3
+ <!-- Project UppercuT - http://projectuppercut.org -->
4
+ <!-- DO NOT EDIT THIS FILE - This creates the assembly file to be used by the rest of the application - 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="tfs" />
9
+ <property name="path.to.toplevel" value="..${path.separator}.." />
10
+ <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
11
+ <property name="folder.build_scripts" value="build" overwrite="false" />
12
+ <property name="folder.build_scripts_custom" value="build.custom${path.separator}" overwrite="false" />
13
+ <property name="dirs.build_scripts_custom" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.build_scripts_custom}${path.separator}versioners" />
14
+ <property name="repository.path" value="__REPOSITORY_PATH__" overwrite="false" />
15
+ <property name="version.revision" value="0" overwrite="false" />
16
+ <property name="tfs.history.output" value="" overwrite="false" />
17
+ <property name="file.custom.step.before" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.pre.step" />
18
+ <property name="file.custom.step.after" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.post.step" />
19
+ <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.replace.step" />
20
+ <property name="is.replaced" value="false" />
21
+ <property name="fail.build.on.error" value="false" />
22
+
23
+ <target name="go" depends="run_tasks" />
24
+
25
+ <target name="run_tasks">
26
+ <echo message="Running ${project::get-name()} tasks." />
27
+ <call target="prepare" if="${target::exists('prepare')}" />
28
+ <call target="custom_tasks_before" if="${target::exists('custom_tasks_before')}" />
29
+ <call target="custom_tasks_replace" if="${target::exists('custom_tasks_replace')}" />
30
+ <call target="run_normal_tasks" if="${not is.replaced}" />
31
+ <call target="custom_tasks_after" if="${target::exists('custom_tasks_after')}" />
32
+ </target>
33
+
34
+ <target name="run_normal_tasks"
35
+ depends="get_revision, get_externally_provided_revision, set_version_environment_variable"
36
+ description="Generating Assembly File." />
37
+
38
+ <target name="custom_tasks_before">
39
+ <echo message="Running custom tasks if ${file.custom.step.before} exists." />
40
+ <nant buildfile="${file.custom.step.before}" inheritall="true" if="${file::exists(file.custom.step.before)}" failonerror="${fail.build.on.error}" />
41
+ <exec program="powershell.exe" if="${file::exists(file.custom.step.before + '.ps1')}" failonerror="${fail.build.on.error}">
42
+ <arg value="${path::get-full-path(file.custom.step.before + '.ps1')}" />
43
+ </exec>
44
+ <exec program="ruby.exe" if="${file::exists(file.custom.step.before + '.rb')}" failonerror="${fail.build.on.error}">
45
+ <arg value="${path::get-full-path(file.custom.step.before + '.rb')}" />
46
+ </exec>
47
+ </target>
48
+
49
+ <target name="custom_tasks_replace">
50
+ <echo message="Running custom tasks instead of normal tasks if ${file.custom.step.replace} exists." />
51
+ <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace)}" />
52
+ <nant buildfile="${file.custom.step.replace}" inheritall="true" if="${file::exists(file.custom.step.replace)}" failonerror="${fail.build.on.error}" />
53
+ <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.ps1')}" />
54
+ <exec program="powershell.exe" if="${file::exists(file.custom.step.replace + '.ps1')}" failonerror="${fail.build.on.error}" >
55
+ <arg value="${path::get-full-path(file.custom.step.replace + '.ps1')}" />
56
+ </exec>
57
+ <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.rb')}" />
58
+ <exec program="ruby.exe" if="${file::exists(file.custom.step.replace + '.rb')}" failonerror="${fail.build.on.error}" >
59
+ <arg value="${path::get-full-path(file.custom.step.replace + '.rb')}" />
60
+ </exec>
61
+ </target>
62
+
63
+ <target name="get_revision">
64
+ <exec
65
+ program="tf"
66
+ commandline="history ${dirs.current}${path.separator}${path.to.toplevel}${path.separator} /r /noprompt /stopafter:1 /version:W"
67
+ output="_revision.xml"
68
+ failonerror="false"/>
69
+ <loadfile
70
+ file="_revision.xml"
71
+ property="tfs.history.output"
72
+ failonerror="false"
73
+ if="${file::exists('_revision.xml')}"
74
+ />
75
+ <regex
76
+ pattern="^(?'tfschangeset'\d+)\s"
77
+ input="${tfs.history.output}"
78
+ options="Multiline"
79
+ failonerror="false"
80
+ />
81
+ <property name="version.revision" value="${tfschangeset}" if="${property::exists('tfschangeset')}"/>
82
+ <delete file="_revision.xml" failonerror="false" />
83
+ </target>
84
+
85
+ <target name="get_externally_provided_revision">
86
+ <property name="version.revision" value="${environment::get-variable('BUILD_VCS_NUMBER')}" if="${version.revision == '0' and environment::variable-exists('BUILD_VCS_NUMBER')}" />
87
+ </target>
88
+
89
+ <target name="set_version_environment_variable">
90
+ <setenv name="uc.app.revision" value="${version.revision}"/>
91
+ <setenv name="uc.app.revision.hash" value="${version.revision}"/>
92
+ </target>
93
+
94
+ <target name="custom_tasks_after">
95
+ <echo message="Running custom tasks if ${file.custom.step.after} exists." />
96
+ <nant buildfile="${file.custom.step.after}" inheritall="true" if="${file::exists(file.custom.step.after)}" failonerror="${fail.build.on.error}" />
97
+ <exec program="powershell.exe" if="${file::exists(file.custom.step.after + '.ps1')}" failonerror="${fail.build.on.error}" >
98
+ <arg value="${path::get-full-path(file.custom.step.after + '.ps1')}" />
99
+ </exec>
100
+ <exec program="ruby.exe" if="${file::exists(file.custom.step.after + '.rb')}" failonerror="${fail.build.on.error}" >
101
+ <arg value="${path::get-full-path(file.custom.step.after + '.rb')}" />
102
+ </exec>
103
+ </target>
104
+
104
105
  </project>
@@ -1,163 +1,135 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <project name="BuildZipper" default="go">
3
- <!-- Project UppercuT - http://projectuppercut.org -->
4
- <!-- DO NOT EDIT THIS FILE - This creates a zip of all project output - 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="zip" />
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_drop" value="code_drop" overwrite="false" />
14
- <property name="dirs.drop" value="${dirs.current}\${path.to.toplevel}\${folder.code_drop}" overwrite="false" />
15
- <property name="project.name" value="__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__" overwrite="false" />
16
- <property name="version.major" value="1" overwrite="false" />
17
- <property name="version.minor" value="0" overwrite="false" />
18
- <property name="version.build" value="0" overwrite="false" />
19
- <property name="version.revision" value="0" overwrite="false" />
20
- <property name="version.hash" value="${version.revision}" overwrite="false" />
21
- <property name="version" value="0" />
22
- <property name="file.uppercut.assembly" value="uppercut.tasks.dll" />
23
- <property name="path.uppercut.assembly" value="${dirs.current}\${file.uppercut.assembly}" />
24
- <property name="zip.file" value="${dirs.drop}\${project.name}.zip" />
25
- <property name="zip.file.rename" value="${dirs.drop}\${project.name}.v${version}.zip" />
26
- <property name="allow.powershell.unrestricted" value="false" overwrite="false" />
27
- <property name="file.custom.step.before" value="${dirs.build_scripts_custom}\${file.current.no_extension}.pre.build" />
28
- <property name="file.custom.step.after" value="${dirs.build_scripts_custom}\${file.current.no_extension}.post.build" />
29
- <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}\${file.current.no_extension}.replace.build" />
30
- <property name="is.replaced" value="false" />
31
- <property name="fail.build.on.error" value="true" />
32
-
33
- <target name="go" depends="load_uppercut_assemblies, allow_powershell_unrestricted, run_tasks" />
34
-
35
- <target name="run_tasks">
36
- <echo message="Running ${project::get-name()} tasks." />
37
- <call target="prepare" if="${target::exists('prepare')}" />
38
- <call target="custom_tasks_before" if="${target::exists('custom_tasks_before')}" />
39
- <call target="custom_tasks_replace" if="${target::exists('custom_tasks_replace')}" />
40
- <call target="run_normal_tasks" if="${not is.replaced}" />
41
- <call target="custom_tasks_after" if="${target::exists('custom_tasks_after')}" />
42
- </target>
43
-
44
- <target name="run_normal_tasks"
45
- depends="error_check, zip, get_version, rename_zip_folder"
46
- description="Zipping assemblies." />
47
-
48
- <target name="custom_tasks_before">
49
- <echo message="Running custom tasks if ${file.custom.step.before} exists." />
50
- <nant buildfile="${file.custom.step.before}" inheritall="true" if="${file::exists(file.custom.step.before)}" failonerror="${fail.build.on.error}" />
51
- <exec program="powershell.exe" if="${file::exists(file.custom.step.before + '.ps1')}" failonerror="${fail.build.on.error}">
52
- <arg value="${path::get-full-path(file.custom.step.before + '.ps1')}" />
53
- </exec>
54
- <exec program="ruby.exe" if="${file::exists(file.custom.step.before + '.rb')}" failonerror="${fail.build.on.error}">
55
- <arg value="${path::get-full-path(file.custom.step.before + '.rb')}" />
56
- </exec>
57
- </target>
58
-
59
- <target name="custom_tasks_replace">
60
- <echo message="Running custom tasks instead of normal tasks if ${file.custom.step.replace} exists." />
61
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace)}" />
62
- <nant buildfile="${file.custom.step.replace}" inheritall="true" if="${file::exists(file.custom.step.replace)}" failonerror="${fail.build.on.error}" />
63
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.ps1')}" />
64
- <exec program="powershell.exe" if="${file::exists(file.custom.step.replace + '.ps1')}" failonerror="${fail.build.on.error}" >
65
- <arg value="${path::get-full-path(file.custom.step.replace + '.ps1')}" />
66
- </exec>
67
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.rb')}" />
68
- <exec program="ruby.exe" if="${file::exists(file.custom.step.replace + '.rb')}" failonerror="${fail.build.on.error}" >
69
- <arg value="${path::get-full-path(file.custom.step.replace + '.rb')}" />
70
- </exec>
71
- </target>
72
-
73
- <target name="prepare">
74
- <echo message="Deleting ${zip.file}."/>
75
- <delete>
76
- <fileset basedir="${dirs.drop}" >
77
- <include name="${project.name}*.zip" />
78
- </fileset>
79
- </delete>
80
- </target>
81
-
82
- <target name="error_check">
83
- <fail message="You must provide arguments to the command line like this zip.build -D:project.name='SOLUTION_NAME_WITHOUT_EXTENSION' or pass the build configuration settings file zip.build -D:build.config.settings='Settings\Uppercut.config"
84
- if="${project.name=='__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__'}" />
85
- </target>
86
-
87
- <target name="zip">
88
- <echo message="Attempting to zip up binaries to ${zip.file}." />
89
- <zip zipfile="${zip.file}">
90
- <fileset basedir="${dirs.drop}">
91
- <exclude name="gems/**" />
92
- <include name="**/*" />
93
- </fileset>
94
- </zip>
95
- </target>
96
-
97
- <target name="get_version">
98
- <call target="get_revision" />
99
- <call target="shorten_hash" />
100
- <call target="get_build_number" />
101
- <property name="version" value="${version.major}.${version.minor}.${version.build}.${version.hash}" />
102
- <property name="zip.file.rename" value="${dirs.drop}\${project.name}.v${version}.zip" />
103
- </target>
104
-
105
- <target name="get_revision">
106
- <nant buildfile="${dirs.current}\versioners\svn.step" inheritall="true" if="${source_control_type=='svn'}" />
107
- <nant buildfile="${dirs.current}\versioners\tfs.step" inheritall="true" if="${source_control_type=='tfs'}" />
108
- <nant buildfile="${dirs.current}\versioners\git.step" inheritall="true" if="${source_control_type=='git'}" />
109
- <nant buildfile="${dirs.current}\versioners\hg.step" inheritall="true" if="${source_control_type=='hg'}" failonerror="false" />
110
- <!--<nant buildfile="${dirs.current}\versioners\vault.step" inheritall="true" if="${source_control_type=='vault'}" />-->
111
- <!--<nant buildfile="${dirs.current}\versioners\vss.step" inheritall="true" if="${source_control_type=='vss'}" />-->
112
-
113
- <property name="version.revision" value="${environment::get-variable('uc.app.revision')}" if="${environment::variable-exists('uc.app.revision')}" />
114
- <property name="version.revision" value="${environment::get-variable('BUILD_VCS_NUMBER')}" if="${version.revision == '0' and environment::variable-exists('BUILD_VCS_NUMBER')}" />
115
- <property name="version.hash" value="${environment::get-variable('uc.app.revision.hash')}" if="${environment::variable-exists('uc.app.revision.hash')}" />
116
- <property name="version.hash" value="${version.revision}" if="${version.hash == '0'}" />
117
- <echo message="Using revision number: ${version.revision} and hash: ${version.hash}." />
118
- </target>
119
-
120
- <target name="shorten_hash">
121
- <echo message="Shortening the length of the version hash '${version.hash}' to 8 digits." />
122
- <property name="version.hash" value="${string::substring(version.hash,0,8)}" if="${string::get-length(version.hash) > 8}" />
123
- <echo message="The hash is now: ${version.hash}." />
124
- </target>
125
-
126
- <target name="get_build_number">
127
- <property name="version.build" value="${environment::get-variable('CCNetNumericLabel')}" if="${environment::variable-exists('CCNetNumericLabel')}" />
128
- <property name="version.build" value="${environment::get-variable('BUILD_NUMBER')}" if="${environment::variable-exists('BUILD_NUMBER')}" />
129
- <echo message="Using build number ${version.build}." />
130
- </target>
131
-
132
- <target name="rename_zip_folder">
133
- <echo message="Renaming zip file ${zip.file} to ${zip.file.rename}." />
134
- <move file="${zip.file}" tofile="${zip.file.rename}" />
135
- </target>
136
-
137
- <target name="custom_tasks_after">
138
- <echo message="Running custom tasks if ${file.custom.step.after} exists." />
139
- <nant buildfile="${file.custom.step.after}" inheritall="true" if="${file::exists(file.custom.step.after)}" failonerror="${fail.build.on.error}" />
140
- <exec program="powershell.exe" if="${file::exists(file.custom.step.after + '.ps1')}" failonerror="${fail.build.on.error}" >
141
- <arg value="${path::get-full-path(file.custom.step.after + '.ps1')}" />
142
- </exec>
143
- <exec program="ruby.exe" if="${file::exists(file.custom.step.after + '.rb')}" failonerror="${fail.build.on.error}" >
144
- <arg value="${path::get-full-path(file.custom.step.after + '.rb')}" />
145
- </exec>
146
- </target>
147
-
148
- <target name="load_uppercut_assemblies">
149
- <loadtasks assembly="${path.uppercut.assembly}" if="${file::exists(path.uppercut.assembly)}" />
150
- </target>
151
-
152
- <target name="allow_powershell_unrestricted">
153
- <!-- powershell 1.0 -->
154
- <exec program="powershell.exe" if="${allow.powershell.unrestricted}" failonerror="false">
155
- <arg value="set-executionpolicy unrestricted" />
156
- </exec>
157
- <!-- powershell 2.0 -->
158
- <exec program="powershell.exe" if="${allow.powershell.unrestricted}" failonerror="false">
159
- <arg value="set-executionpolicy unrestricted -force -scope CurrentUser" />
160
- </exec>
161
- </target>
162
-
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <project name="BuildZipper" default="go">
3
+ <!-- Project UppercuT - http://projectuppercut.org -->
4
+ <!-- DO NOT EDIT THIS FILE - This creates a zip of all project output - 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="zip" />
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_drop" value="code_drop" overwrite="false" />
15
+ <property name="dirs.drop" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.code_drop}" overwrite="false" />
16
+ <property name="project.name" value="__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__" overwrite="false" />
17
+ <property name="version.major" value="1" overwrite="false" />
18
+ <property name="version.minor" value="0" overwrite="false" />
19
+ <property name="version.patch" value="0" overwrite="false" />
20
+ <property name="version.build" value="0" overwrite="false" />
21
+ <property name="version.revision" value="0" overwrite="false" />
22
+ <property name="version.hash" value="${version.revision}" overwrite="false" />
23
+ <property name="version" value="0" />
24
+ <property name="file.uppercut.assembly" value="uppercut.tasks.dll" />
25
+ <property name="path.uppercut.assembly" value="${dirs.current}${path.separator}${file.uppercut.assembly}" />
26
+ <property name="zip.file" value="${dirs.drop}${path.separator}${project.name}.zip" />
27
+ <property name="zip.file.rename" value="${dirs.drop}${path.separator}${project.name}.v${version}.zip" />
28
+ <property name="allow.powershell.unrestricted" value="false" overwrite="false" />
29
+ <property name="file.custom.step.before" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.pre.build" />
30
+ <property name="file.custom.step.after" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.post.build" />
31
+ <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}${path.separator}${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, run_tasks" />
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, zip, get_version, rename_zip_folder"
48
+ description="Zipping assemblies." />
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="Deleting ${zip.file}."/>
77
+ <delete>
78
+ <fileset basedir="${dirs.drop}" >
79
+ <include name="${project.name}*.zip" />
80
+ </fileset>
81
+ </delete>
82
+ </target>
83
+
84
+ <target name="error_check">
85
+ <fail message="You must provide arguments to the command line like this zip.build -D:project.name='SOLUTION_NAME_WITHOUT_EXTENSION' or pass the build configuration settings file zip.build -D:build.config.settings='Settings${path.separator}Uppercut.config"
86
+ if="${project.name=='__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__'}" />
87
+ </target>
88
+
89
+ <target name="zip">
90
+ <echo message="Attempting to zip up binaries to ${zip.file}." />
91
+ <zip zipfile="${zip.file}">
92
+ <fileset basedir="${dirs.drop}">
93
+ <exclude name="gems/**" />
94
+ <include name="**/*" />
95
+ </fileset>
96
+ </zip>
97
+ </target>
98
+
99
+ <target name="get_version">
100
+ <property name="version" value="${version.major}.${version.minor}.${version.patch}.0" />
101
+ <property name="zip.file.rename" value="${dirs.drop}${path.separator}${project.name}.v${version}.zip" />
102
+ </target>
103
+
104
+ <target name="rename_zip_folder">
105
+ <echo message="Renaming zip file ${zip.file} to ${zip.file.rename}." />
106
+ <move file="${zip.file}" tofile="${zip.file.rename}" />
107
+ </target>
108
+
109
+ <target name="custom_tasks_after">
110
+ <echo message="Running custom tasks if ${file.custom.step.after} exists." />
111
+ <nant buildfile="${file.custom.step.after}" inheritall="true" if="${file::exists(file.custom.step.after)}" failonerror="${fail.build.on.error}" />
112
+ <exec program="powershell.exe" if="${file::exists(file.custom.step.after + '.ps1')}" failonerror="${fail.build.on.error}" >
113
+ <arg value="${path::get-full-path(file.custom.step.after + '.ps1')}" />
114
+ </exec>
115
+ <exec program="ruby.exe" if="${file::exists(file.custom.step.after + '.rb')}" failonerror="${fail.build.on.error}" >
116
+ <arg value="${path::get-full-path(file.custom.step.after + '.rb')}" />
117
+ </exec>
118
+ </target>
119
+
120
+ <target name="load_uppercut_assemblies">
121
+ <loadtasks assembly="${path.uppercut.assembly}" if="${file::exists(path.uppercut.assembly)}" />
122
+ </target>
123
+
124
+ <target name="allow_powershell_unrestricted">
125
+ <!-- powershell 1.0 -->
126
+ <exec program="powershell.exe" if="${allow.powershell.unrestricted}" failonerror="false">
127
+ <arg value="set-executionpolicy unrestricted" />
128
+ </exec>
129
+ <!-- powershell 2.0 -->
130
+ <exec program="powershell.exe" if="${allow.powershell.unrestricted}" failonerror="false">
131
+ <arg value="set-executionpolicy unrestricted -force -scope CurrentUser" />
132
+ </exec>
133
+ </target>
134
+
163
135
  </project>