|
2 | 2 | <project name="Iesi.Collections" default="build" xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd"> |
3 | 3 |
|
4 | 4 | <property name="root.dir" value="." /> |
5 | | - <property name="project.version" value="4.0.4" overwrite="false" /> |
| 5 | + <property name="project.version" value="4.0.5" overwrite="false" /> |
6 | 6 |
|
7 | 7 | <!-- Pass -D:skip.tests=true to NAnt to skip running tests when building --> |
8 | 8 | <property name="skip.tests" value="false" overwrite="false" /> |
9 | 9 |
|
10 | | - <target name="dotnet-restore"> |
11 | | - <exec workingdir="${root.dir}/src" program="dotnet"> |
12 | | - <arg value="restore" /> |
13 | | - <arg value="Iesi.Collections.sln" /> |
14 | | - </exec> |
| 10 | + <target name="init" description="Initializes build properties"> |
| 11 | + <property name="project.config" value="debug" overwrite="false" /> |
| 12 | + <property name="build.name" value="Iesi.Collections-${project.version}-${project.config}" /> |
| 13 | + <property name="build.dir" value="${root.dir}/build/${build.name}" /> |
15 | 14 | </target> |
16 | 15 |
|
17 | | - <target name="dotnet-build" depends="dotnet-restore"> |
| 16 | + <target name="build" |
| 17 | + depends="init nuget.set-properties" |
| 18 | + description="Builds Iesi.Collections in the current configuration"> |
| 19 | + |
18 | 20 | <exec workingdir="${root.dir}/src" program="dotnet"> |
19 | 21 | <arg value="build" /> |
20 | 22 | <arg value="-c" /> |
21 | 23 | <arg value="${project.config}" /> |
| 24 | + <arg value="/p:PackageOutputPath="${path::get-full-path(nuget.nupackages.dir)}"" /> |
22 | 25 | <arg value="Iesi.Collections.sln" /> |
23 | 26 | </exec> |
24 | 27 | </target> |
25 | 28 |
|
26 | | - <target name="set-project-configuration"> |
27 | | - <property name="project.config" value="debug" overwrite="false" /> |
28 | | - <property name="build.name" value="Iesi.Collections-${project.version}-${project.config}" /> |
29 | | - <property name="build.dir" value="${root.dir}/build/${build.name}" /> |
30 | | - <property name="tools.dir" value="${root.dir}/Tools"/> |
31 | | - </target> |
32 | | - |
33 | | - <target name="init" |
34 | | - depends="set-project-configuration" |
35 | | - description="Initializes build properties" /> |
36 | | - |
37 | | - <target name="build" |
38 | | - depends="init dotnet-build" |
39 | | - description="Builds Iesi.Collections in the current configuration" /> |
40 | | - |
41 | 29 | <target name="run-tests" description="Run NUnitLite tests"> |
42 | 30 | <exec program="${test.file}"> |
43 | 31 | <arg value="--result=test-results.xml;format=nunit2" /> |
|
60 | 48 | <call target="run-tests" /> |
61 | 49 | <property name="test.file" value="${tests.basedir}/net461/Iesi.Collections.Test.exe" /> |
62 | 50 | <call target="run-tests" /> |
63 | | - <property name="test.file" value="${tests.basedir}/netcoreapp1.0/Iesi.Collections.Test.dll" /> |
| 51 | + <property name="test.file" value="${tests.basedir}/netcoreapp3.1/Iesi.Collections.Test.dll" /> |
64 | 52 | <call target="run-core-tests" /> |
65 | 53 | </target> |
66 | 54 |
|
67 | | - <target name="binaries" depends="init"> |
68 | | - <call target="build" /> |
69 | | - </target> |
70 | | - |
71 | | - <target name="sources"> |
72 | | - <property name="source.tmpdir" value="${build.dir}/tmp-src" /> |
73 | | - <copy todir="${source.tmpdir}"> |
74 | | - <fileset> |
75 | | - <!-- copy all of the Iesi.Collections source --> |
76 | | - <include name="src/Iesi*/**" /> |
77 | | - <include name="src/*.*" /> |
78 | | - <include name="*.build" /> |
79 | | - <include name="LICENSE.txt" /> |
80 | | - <include name="readme.html" /> |
81 | | - <!-- exclude ReSharper stuff --> |
82 | | - <exclude name="**/_ReSharper*/**" /> |
83 | | - <exclude name="**/*.resharperoptions" /> |
84 | | - <exclude name="**/*resharper*" /> |
85 | | - <!-- exclude VS.NET stuff --> |
86 | | - <exclude name="**/*.suo" /> |
87 | | - <exclude name="**/*.user" /> |
88 | | - <exclude name="**/bin/**" /> |
89 | | - <exclude name="**/obj/**" /> |
90 | | - </fileset> |
91 | | - </copy> |
92 | | - </target> |
93 | | - |
94 | | - <target name="sources-zip" depends="init sources"> |
95 | | - <zip zipfile="${build.dir}/Iesi.Collections-${project.version}-src.zip"> |
96 | | - <fileset basedir="${source.tmpdir}"> |
97 | | - <include name="**/*" /> |
98 | | - </fileset> |
99 | | - </zip> |
| 55 | + <target name="sources-zip" depends="init"> |
| 56 | + <exec program="git" commandline="archive HEAD --format zip --output "${build.dir}/Iesi.Collections-${project.version}-src.zip""/> |
100 | 57 | </target> |
101 | 58 |
|
102 | 59 | <target name="binaries-zip" depends="init bin-pack"> |
|
107 | 64 | </zip> |
108 | 65 | </target> |
109 | 66 |
|
110 | | - <target name="bin-pack" depends="init binaries"> |
| 67 | + <target name="bin-pack" depends="init build"> |
111 | 68 | <property name="bin-pack.tmpdir" value="${build.dir}/tmp-bin" /> |
112 | 69 | <property name="bin-pack.bins" value="${bin-pack.tmpdir}/Bins" /> |
113 | 70 | <property name="bin-pack.tests" value="${bin-pack.tmpdir}/Tests" /> |
|
130 | 87 | </copy> |
131 | 88 | </target> |
132 | 89 |
|
133 | | - <target name="package" depends="init binaries test sources-zip binaries-zip" description="Creates files for the General Available Release on SourceForge"> |
| 90 | + <target name="package" depends="init build test sources-zip binaries-zip" description="Creates files for the General Available Release on SourceForge"> |
134 | 91 | <echo message="Created a '${project.config}' package in ${build.dir}" /> |
135 | 92 | </target> |
136 | 93 |
|
137 | | - <target name="release" depends="init binaries binaries-zip sources-zip" description="Creates files for the partial (Alpha-Beta-Candidate) Release on SourceForge"> |
| 94 | + <target name="release" depends="init build binaries-zip sources-zip" description="Creates files for the partial (Alpha-Beta-Candidate) Release on SourceForge"> |
138 | 95 | <echo message="Created a '${project.config}' package in ${build.dir}" /> |
139 | 96 | </target> |
140 | 97 |
|
|
148 | 105 | </target> |
149 | 106 |
|
150 | 107 | <target name="nuget.set-properties"> |
151 | | - <property name="nuget.nupackages.relative-dir" value="nuget_gallery" /> |
152 | | - <property name="nuget.workingdir" value="${build.dir}/tmp_nugetdeploy" /> |
153 | | - <property name="nuget.nupackages.dir" value="${build.dir}/${nuget.nupackages.relative-dir}" /> |
| 108 | + <property name="nuget.nupackages.dir" value="${build.dir}/nuget_gallery" /> |
154 | 109 | <property name="nuget.nupackages.pushbatfile" value="${nuget.nupackages.dir}/NuGetPush.bat" /> |
155 | 110 | </target> |
156 | 111 |
|
157 | | - <target name="nuget" depends="init binaries nuget.set-properties" description="Creates files for the release on nuget gallery."> |
158 | | - <mkdir dir="${nuget.nupackages.dir}" /> |
159 | | - <move todir="${nuget.nupackages.dir}"> |
160 | | - <fileset basedir="${root.dir}/src/Iesi.Collections/bin/${project.config}"> |
161 | | - <include name="*.nupkg" /> |
162 | | - </fileset> |
163 | | - </move> |
164 | | - </target> |
165 | | - |
166 | | - <target name="download-nuget" depends="init"> |
167 | | - <get |
168 | | - src="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" |
169 | | - dest="${tools.dir}/nuget.exe" |
170 | | - usetimestamp="true" |
171 | | - /> |
| 112 | + <target name="nugetpushbat" depends="init build" |
| 113 | + description="Creates files for the release on nuget gallery."> |
| 114 | + |
| 115 | + <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"/> |
| 116 | + <foreach item="File" property="filename"> |
| 117 | + <in> |
| 118 | + <items> |
| 119 | + <include name="${nuget.nupackages.dir}/*.nupkg"/> |
| 120 | + <exclude name="${nuget.nupackages.dir}/*.symbols.nupkg"/> |
| 121 | + </items> |
| 122 | + </in> |
| 123 | + <do> |
| 124 | + <echo message="dotnet nuget push -s https://nuget.org/ ${path::get-file-name(filename)} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/> |
| 125 | + </do> |
| 126 | + </foreach> |
| 127 | + <foreach item="File" property="filename"> |
| 128 | + <in> |
| 129 | + <items> |
| 130 | + <include name="${nuget.nupackages.dir}/*.symbols.nupkg"/> |
| 131 | + </items> |
| 132 | + </in> |
| 133 | + <do> |
| 134 | + <echo message="nuget push -source https://nuget.smbsrc.net/ ${path::get-file-name(filename)} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/> |
| 135 | + </do> |
| 136 | + </foreach> |
| 137 | + </target> |
| 138 | + |
| 139 | + <target name="nugetpush" depends="init build" |
| 140 | + description="Push packages on nuget gallery."> |
| 141 | + <!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' --> |
| 142 | + <foreach item="File" property="filename"> |
| 143 | + <in> |
| 144 | + <items> |
| 145 | + <include name="${nuget.nupackages.dir}/*.nupkg"/> |
| 146 | + </items> |
| 147 | + </in> |
| 148 | + <do> |
| 149 | + <exec workingdir="${nuget.nupackages.dir}" program="dotnet"> |
| 150 | + <arg value="nuget" /> |
| 151 | + <arg value="push" /> |
| 152 | + <arg value="-s" /> |
| 153 | + <arg value="https://nuget.org" /> |
| 154 | + <arg value="${filename}" /> |
| 155 | + </exec> |
| 156 | + </do> |
| 157 | + </foreach> |
172 | 158 | </target> |
173 | 159 |
|
174 | | - <target name="nugetpushbat" depends="init binaries download-nuget nuget.set-properties nuget" |
175 | | - description="Creates files for the release on nuget gallery."> |
176 | | - |
177 | | - <copy file="${tools.dir}/NuGet.exe" todir="${nuget.nupackages.dir}"/> |
178 | | - |
179 | | - <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"/> |
180 | | - <foreach item="File" property="filename" > |
181 | | - <in> |
182 | | - <items> |
183 | | - <include name="${nuget.nupackages.dir}/*.nupkg"/> |
184 | | - </items> |
185 | | - </in> |
186 | | - <do> |
187 | | - <echo message="nuget push ${filename} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/> |
188 | | - </do> |
189 | | - </foreach> |
190 | | - </target> |
191 | | - |
192 | | - <target name="nugetpush" depends="init binaries download-nuget nuget.set-properties nuget" |
193 | | - description="Push packages on nuget gallery."> |
194 | | - <!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' --> |
195 | | - <foreach item="File" property="filename"> |
196 | | - <in> |
197 | | - <items> |
198 | | - <include name="${nuget.nupackages.dir}/*.nupkg"/> |
199 | | - </items> |
200 | | - </in> |
201 | | - <do> |
202 | | - <exec basedir="${tools.dir}" workingdir="${nuget.nupackages.dir}" program="NuGet.exe"> |
203 | | - <arg value="push" /> |
204 | | - <arg value="${filename}" /> |
205 | | - </exec> |
206 | | - </do> |
207 | | - </foreach> |
208 | | - </target> |
209 | | - |
210 | 160 | </project> |
0 commit comments