forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.build
128 lines (112 loc) · 8.63 KB
/
default.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version="1.0" encoding="utf-8" ?>
<project name="UppercuTBuild" 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 -->
<target name="go" depends="prepare_build, start_recorder, report_start_time, load_uppercut_assemblies, report_uppercut_version, run_tasks, report_finish_time, stop_recorder" />
<target name="start_recorder">
<record name="${log.build}" autoflush="true" level="Info" action="Start" failonerror="false" />
</target>
<target name="report_start_time">
<echo level="Warning" message="Build for ${project.name} started at ${datetime::now()} with UppercuT." />
</target>
<target name="stop_recorder">
<record name="${log.build}" action="Flush" failonerror="false" />
<record name="${log.build}" action="Stop" failonerror="false" />
<record name="${log.build}" action="Close" failonerror="false" />
<copy
file="${log.build}"
todir="${dirs.drop}${path.separator}${folder.build_artifacts}"
failonerror="false"
/>
<echo level="Warning" message="See '${dirs.drop}${path.separator}${folder.build_artifacts}${path.separator}build.log' for detailed build log information." />
</target>
<!-- run_normal_tasks is called from run_tasks unless replace extension exists -->
<target name="run_normal_tasks"
depends="error_check, build"
description="Building with UppercuT default.build." />
<target name="prepare_build">
<echo level="Warning" message="Removing and adding ${dirs.build}."/>
<mkdir dir="${dirs.build}" failonerror="false" />
<delete dir="${dirs.build}${path.separator}build_artifacts" failonerror="false" />
<delete dir="${dirs.build}${path.separator}${folder.documentation}" failonerror="false" />
<delete dir="${dirs.build}${path.separator}${folder.environment_files}" failonerror="false" />
<delete dir="${dirs.build}${path.separator}${folder.database}" failonerror="false" />
<delete dir="${dirs.build}${path.separator}${folder.reports}" failonerror="false" />
<delete dir="${dirs.build}${path.separator}${folder.file_server}" failonerror="false" />
<delete dir="${dirs.build}${path.separator}${folder.app.drop}" failonerror="false" />
</target>
<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__' or repository.path=='__REPOSITORY_PATH__' or company.name=='__COMPANY_NAME__'}" />
</target>
<target name="build">
<call target="get_revision" />
<call target="get_build_number" />
<call target="update_version_number" />
<call target="get_drop_directory" />
<nant buildfile="${dirs.current.file}${path.separator}policyChecks.step" inheritall="true" if="${run.policychecks}" />
<nant buildfile="${dirs.current.file}${path.separator}versionBuilder.step" inheritall="true" />
<nant buildfile="${dirs.current.file}${path.separator}generateBuildInfo.step" inheritall="true" />
<nant buildfile="${dirs.current.file}${path.separator}manifestBuilder.step" inheritall="true" if="${run.manifestbuilder}" />
<nant buildfile="${dirs.current.file}${path.separator}compile.step" inheritall="true" />
<nant buildfile="${dirs.current.file}${path.separator}environmentBuilder.step" inheritall="true" if="${run.environmentbuilder}" />
<nant buildfile="${dirs.current.file}${path.separator}analyze.step" inheritall="true" if="${run.analyzers}" />
<nant buildfile="${dirs.current.file}${path.separator}obfuscate.step" inheritall="true" if="${run.obfuscator}" />
<nant buildfile="${dirs.current.file}${path.separator}package.step" inheritall="true" />
<nant buildfile="${dirs.current.file}${path.separator}ilmerge.build" inheritall="true" if="${run.ilmerge}" />
<nant buildfile="${dirs.current.file}${path.separator}gemsPrepare.step" inheritall="true" failonerror="false" if="${run.gems}" />
<nant buildfile="${dirs.current.file}${path.separator}gemsBuild.step" inheritall="true" failonerror="false" if="${run.gems}" />
<nant buildfile="${dirs.current.file}${path.separator}nugetPrepare.step" inheritall="true" failonerror="false" if="${run.nuget}" />
<nant buildfile="${dirs.current.file}${path.separator}nugetBuild.step" inheritall="true" failonerror="false" if="${run.nuget}" />
</target>
<target name="get_revision">
<nant buildfile="${dirs.current.file}${path.separator}versioners${path.separator}svn.step" inheritall="true" if="${source_control_type=='svn'}" failonerror="false" />
<nant buildfile="${dirs.current.file}${path.separator}versioners${path.separator}tfs.step" inheritall="true" if="${source_control_type=='tfs'}" failonerror="false" />
<nant buildfile="${dirs.current.file}${path.separator}versioners${path.separator}git.step" inheritall="true" if="${source_control_type=='git'}" failonerror="false" />
<nant buildfile="${dirs.current.file}${path.separator}versioners${path.separator}hg.step" inheritall="true" if="${source_control_type=='hg'}" failonerror="false" />
<!--<nant buildfile="${dirs.current.file}${path.separator}versioners${path.separator}vault.step" inheritall="true" if="${source_control_type=='vault'}" />-->
<!--<nant buildfile="${dirs.current.file}${path.separator}versioners${path.separator}vss.step" inheritall="true" if="${source_control_type=='vss'}" />-->
<property name="version.revision" value="${environment::get-variable('uc.app.revision')}" if="${environment::variable-exists('uc.app.revision')}" />
<property name="version.hash" value="${environment::get-variable('uc.app.revision.hash')}" if="${environment::variable-exists('uc.app.revision.hash')}" />
<property name="version.hash" value="${version.revision}" if="${version.hash == '0'}" />
<echo level="Warning" message="Using revision number: ${version.revision} and hash: ${version.hash}." />
</target>
<target name="get_build_number">
<property name="version.build" value="${environment::get-variable('CCNetNumericLabel')}" if="${environment::variable-exists('CCNetNumericLabel')}" />
<property name="version.build" value="${environment::get-variable('BUILD_NUMBER')}" if="${environment::variable-exists('BUILD_NUMBER')}" />
<echo level="Warning" message="Using build number ${version.build}." />
</target>
<target name="update_version_number">
<property name="assembly.version.full" value="${version.major}.${version.minor}.${version.build}.${version.revision}" />
<property name="assembly.version.full" value="${version.major}.${version.minor}.${version.patch}.0" if="${version.use_semanticversioning}" />
<echo level="Warning" message="Version full updated to ${assembly.version.full}." />
</target>
<target name="get_drop_directory">
<property name="dirs.drop" value="${environment::get-variable('CCNetArtifactDirectory')}${path.separator}b${version.build}-r${version.revision}" if="${environment::variable-exists('CCNetArtifactDirectory')}" />
<!--Point TeamCity at code_drop for an artifact directory. It will automatically save the files. -->
<echo level="Warning" message="Compiled code drop directory will be ${path::get-full-path(dirs.drop)}." />
</target>
<target name="report_finish_time">
<echo level="Warning" message="" />
<echo level="Warning" message="====================" />
<echo level="Warning" message="${project::get-name()} - FINISHED!" />
<echo level="Warning" message="====================" />
<echo level="Warning" message="Build for ${project.name} finished at ${datetime::now()} with UppercuT version ${version.uppercut}." />
</target>
<target name="report_uppercut_version">
<xmlpeek
file="UppercuT.xml"
xpath="/uppercut/version"
property="version.uppercut"
failonerror="false" />
<echo level="Warning" message="Using UppercuT version: ${version.uppercut}." />
</target>
</project>