@@ -208,7 +208,7 @@ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
208
208
<property name =" git" value =" git" />
209
209
210
210
<!-- Get the id of the changeset we're building from using a
211
- Mercurial command.
211
+ git command.
212
212
-->
213
213
<target name =" -get-changeset-from-command"
214
214
depends =" -check-is-git-repo" if =" build.from.repo" >
@@ -226,14 +226,19 @@ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
226
226
<target name =" -check-is-git-repo" >
227
227
<available property =" build.from.repo" file =" .git" type =" dir" />
228
228
</target >
229
+ <target name =" -check-is-archived-git-repo" >
230
+ <available property =" build.from.archived.repo"
231
+ file =" .git_archival.txt"
232
+ type =" file" />
233
+ </target >
229
234
230
235
<!-- Get the id of the changeset we're building from by reading
231
236
.git_archival.txt file created by git archive. This will only
232
237
be used when we're not building from a checked out copy of
233
238
the repository, for example the source distribution.
234
239
-->
235
240
<target name =" -get-changeset-from-file"
236
- depends =" -check-is-git-repo" unless =" build.from.repo" >
241
+ depends =" -check-is-archived- git-repo" if =" build.from.archived .repo" >
237
242
<tempfile property =" git.archival.temp" deleteonexit =" true" />
238
243
<copy file =" .git_archival.txt" tofile =" ${ git.archival.temp } " />
239
244
<replaceregexp file =" ${ git.archival.temp } " flags =" s"
@@ -242,16 +247,20 @@ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
242
247
<loadfile srcFile =" ${ git.archival.temp } " property =" changeset" />
243
248
</target >
244
249
250
+ <target name =" -set-changeset" unless =" changeset" >
251
+ <property name =" changeset" value =" unknown" />
252
+ </target >
253
+
245
254
<target name =" -update-build-info"
246
- depends =" -get-changeset-from-command,-get-changeset-from-file" >
255
+ depends =" -get-changeset-from-command,-get-changeset-from-file,-set-changeset " >
247
256
<mkdir dir =" ${ build.classes.dir } /org/opensolaris/opengrok" />
248
257
<propertyfile
249
258
file =" ${ build.classes.dir } /org/opensolaris/opengrok/info.properties" >
250
259
<entry key =" version" value =" ${ version } " />
251
260
<entry key =" changeset" value =" ${ changeset } " />
252
261
</propertyfile >
253
262
</target >
254
-
263
+
255
264
<property name =" coverage.dir" value =" ${ basedir } /coverage" />
256
265
<target name =" -pre-compile" depends =" jrcs,jflex,download-lucene" />
257
266
<target name =" eclipse" depends =" -pre-compile"
0 commit comments