forked from nhibernate/iesi.collections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.build
210 lines (179 loc) · 7.7 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?xml version="1.0" ?>
<project name="Iesi.Collections" default="build" xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd">
<property name="root.dir" value="." />
<property name="project.version" value="4.0.4" overwrite="false" />
<!-- Pass -D:skip.tests=true to NAnt to skip running tests when building -->
<property name="skip.tests" value="false" overwrite="false" />
<target name="dotnet-restore">
<exec workingdir="${root.dir}/src" program="dotnet">
<arg value="restore" />
<arg value="Iesi.Collections.sln" />
</exec>
</target>
<target name="dotnet-build" depends="dotnet-restore">
<exec workingdir="${root.dir}/src" program="dotnet">
<arg value="build" />
<arg value="-c" />
<arg value="${project.config}" />
<arg value="Iesi.Collections.sln" />
</exec>
</target>
<target name="set-project-configuration">
<property name="project.config" value="debug" overwrite="false" />
<property name="build.name" value="Iesi.Collections-${project.version}-${project.config}" />
<property name="build.dir" value="${root.dir}/build/${build.name}" />
<property name="tools.dir" value="${root.dir}/Tools"/>
</target>
<target name="init"
depends="set-project-configuration"
description="Initializes build properties" />
<target name="build"
depends="init dotnet-build"
description="Builds Iesi.Collections in the current configuration" />
<target name="run-tests" description="Run NUnitLite tests">
<exec program="${test.file}">
<arg value="--result=test-results.xml;format=nunit2" />
<arg value="--teamcity" if="${property::exists('config.teamcity')}" />
</exec>
</target>
<target name="run-core-tests" description="Run .NET Core NUnitLite tests">
<exec program="dotnet">
<arg value="exec" />
<arg value="${test.file}" />
<arg value="--result=test-results.xml;format=nunit2" />
<arg value="--teamcity" if="${property::exists('config.teamcity')}" />
</exec>
</target>
<target name="test" depends="init build" description="Runs all Iesi.Collections tests for the current framework" unless="${skip.tests}">
<property name="tests.basedir" value="${root.dir}/src/Iesi.Collections.Test/bin/${project.config}" />
<property name="test.file" value="${tests.basedir}/net40/Iesi.Collections.Test.exe" />
<call target="run-tests" />
<property name="test.file" value="${tests.basedir}/net461/Iesi.Collections.Test.exe" />
<call target="run-tests" />
<property name="test.file" value="${tests.basedir}/netcoreapp1.0/Iesi.Collections.Test.dll" />
<call target="run-core-tests" />
</target>
<target name="binaries" depends="init">
<call target="build" />
</target>
<target name="sources">
<property name="source.tmpdir" value="${build.dir}/tmp-src" />
<copy todir="${source.tmpdir}">
<fileset>
<!-- copy all of the Iesi.Collections source -->
<include name="src/Iesi*/**" />
<include name="src/*.*" />
<include name="*.build" />
<include name="LICENSE.txt" />
<include name="readme.html" />
<!-- exclude ReSharper stuff -->
<exclude name="**/_ReSharper*/**" />
<exclude name="**/*.resharperoptions" />
<exclude name="**/*resharper*" />
<!-- exclude VS.NET stuff -->
<exclude name="**/*.suo" />
<exclude name="**/*.user" />
<exclude name="**/bin/**" />
<exclude name="**/obj/**" />
</fileset>
</copy>
</target>
<target name="sources-zip" depends="init sources">
<zip zipfile="${build.dir}/Iesi.Collections-${project.version}-src.zip">
<fileset basedir="${source.tmpdir}">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="binaries-zip" depends="init bin-pack">
<zip zipfile="${build.dir}/Iesi.Collections-${project.version}-bin.zip">
<fileset basedir="${bin-pack.tmpdir}">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="bin-pack" depends="init binaries">
<property name="bin-pack.tmpdir" value="${build.dir}/tmp-bin" />
<property name="bin-pack.bins" value="${bin-pack.tmpdir}/Bins" />
<property name="bin-pack.tests" value="${bin-pack.tmpdir}/Tests" />
<copy file="LICENSE.txt" todir="${bin-pack.tmpdir}"/>
<exec program="CScript.exe" commandline="Tools\showdown\showdown.wsf README.md ${bin-pack.tmpdir}/readme.html"/>
<copy todir="${bin-pack.bins}">
<fileset basedir="src/Iesi.Collections/bin/${project.config}/">
<include name="**/Iesi.Collections.???" />
</fileset>
</copy>
<!-- Tests -->
<copy todir="${bin-pack.tests}">
<fileset basedir="src/Iesi.Collections.Test/bin/${project.config}/">
<include name="**/Iesi.Collections.Test.???" />
</fileset>
</copy>
</target>
<target name="package" depends="init binaries test sources-zip binaries-zip" description="Creates files for the General Available Release on SourceForge">
<echo message="Created a '${project.config}' package in ${build.dir}" />
</target>
<target name="release" depends="init binaries binaries-zip sources-zip" description="Creates files for the partial (Alpha-Beta-Candidate) Release on SourceForge">
<echo message="Created a '${project.config}' package in ${build.dir}" />
</target>
<target name="cleanall" description="Deletes every build configuration">
<echo message="Deleting all builds from all configurations" />
<delete dir="build" failonerror="false" />
</target>
<target name="clean" depends="init" description="Deletes current build">
<delete dir="${build.dir}" failonerror="false" />
</target>
<target name="nuget.set-properties">
<property name="nuget.nupackages.relative-dir" value="nuget_gallery" />
<property name="nuget.workingdir" value="${build.dir}/tmp_nugetdeploy" />
<property name="nuget.nupackages.dir" value="${build.dir}/${nuget.nupackages.relative-dir}" />
<property name="nuget.nupackages.pushbatfile" value="${nuget.nupackages.dir}/NuGetPush.bat" />
</target>
<target name="nuget" depends="init binaries nuget.set-properties" description="Creates files for the release on nuget gallery.">
<mkdir dir="${nuget.nupackages.dir}" />
<move todir="${nuget.nupackages.dir}">
<fileset basedir="${root.dir}/src/Iesi.Collections/bin/${project.config}">
<include name="*.nupkg" />
</fileset>
</move>
</target>
<target name="download-nuget" depends="init">
<get
src="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
dest="${tools.dir}/nuget.exe"
usetimestamp="true"
/>
</target>
<target name="nugetpushbat" depends="init binaries download-nuget nuget.set-properties nuget"
description="Creates files for the release on nuget gallery.">
<copy file="${tools.dir}/NuGet.exe" todir="${nuget.nupackages.dir}"/>
<echo message="rem In order to use this bat you have to be sure you have executed 'nuget SetApiKey' ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="false"/>
<foreach item="File" property="filename" >
<in>
<items>
<include name="${nuget.nupackages.dir}/*.nupkg"/>
</items>
</in>
<do>
<echo message="nuget push ${filename} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/>
</do>
</foreach>
</target>
<target name="nugetpush" depends="init binaries download-nuget nuget.set-properties nuget"
description="Push packages on nuget gallery.">
<!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' -->
<foreach item="File" property="filename">
<in>
<items>
<include name="${nuget.nupackages.dir}/*.nupkg"/>
</items>
</in>
<do>
<exec basedir="${tools.dir}" workingdir="${nuget.nupackages.dir}" program="NuGet.exe">
<arg value="push" />
<arg value="${filename}" />
</exec>
</do>
</foreach>
</target>
</project>