-
Notifications
You must be signed in to change notification settings - Fork 25
/
ant-util.xml
51 lines (36 loc) · 1.56 KB
/
ant-util.xml
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<description>
Contains shared variables and common utility ant targets used by
all Synoptic projects.
</description>
<!-- Where to find the libraries Synoptic depends on. -->
<property name="util.synoptic.libdir" value="../lib"/>
<!--=====================================================================-->
<!--
Uses 'git rev-parse HEAD' to embed the latest git commit hash into
util.hg.revision property.
TODO: Complete refactoring by removing 'hg' from property/target names.
TODO: Test that the repository contains no uncommitted changes and
fail if this is the case.
-->
<target name="hg-rev-extract">
<!-- Find out the current hg changeset id using 'hd id -i'. -->
<exec executable="git" outputproperty="util.hg.revision" failifexecutionfails="true" errorproperty="">
<arg value="rev-parse" />
<arg value="HEAD" />
</exec>
<!-- TODO: upgrade this logic to use git
Check that the current repository does not include any
uncommitted changes. This is indicated by a '+' at the end of
${util.hg.revision}. The hg.revision.ok property will be set
iff there are no uncommitted changes.
<condition property="hg.revision.ok" value="true">
<not>
<contains string="${util.hg.revision}" substring="+" />
</not>
</condition>
<fail unless="hg.revision.ok">Repository contains uncommitted changes (${util.hg.revision}). Cannot embed a definitive revision id. Please commit before running this ant target.</fail>
-->
</target>
</project>