-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathbuild.xml
76 lines (63 loc) · 2.84 KB
/
build.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
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
<project name="FSMEDITOR" default="jar">
<!-- project directory -->
<dirname property="FSMEDITOR.dir" file="${ant.file}"/>
<property name="JGRAPHX" location="${FSMEDITOR.dir}/jgraphx"/>
<property name="FSM" location="${FSMEDITOR.dir}/fsm-editor"/>
<property name="JGRAPHX.antfile" location="${JGRAPHX}/build.xml"/>
<property name="FSM.antfile" location="${FSM}/build.xml"/>
<path id="depfiles">
<pathelement path="${JGRAPHX.antfile}"/>
</path>
<path id="codefiles">
<pathelement path="${FSM.antfile}"/>
</path>
<path id="antfiles">
<pathelement path="${JGRAPHX.antfile}"/>
<pathelement path="${FSM.antfile}"/>
</path>
<!-- standard targets -->
<target name="clean">
<echo message="Started cleaning..."/>
<subant buildpathref="antfiles" inheritall="false" inheritrefs="false" target="clean"/>
<echo message="Completed cleaning."/>
</target>
<target name="builddep" depends="clean,git">
<echo message="Started building..."/>
<subant buildpathref="depfiles" inheritall="false" inheritrefs="false" target="jar"/>
<echo message="Completed building."/>
</target>
<target name="build" depends="builddep">
<echo message="Started building..."/>
<subant buildpathref="codefiles" inheritall="false" inheritrefs="false" target="build"/>
<echo message="Completed building."/>
</target>
<target name="jar" depends="build">
<echo>git master hash: ${repository.version}</echo>
<echo file="${FSM}/svn.version">git master hash: ${repository.version}</echo>
<echo message="Started building jar archives..."/>
<subant buildpathref="codefiles" inheritall="false" inheritrefs="false" target="jar"/>
<echo message="Completed jars."/>
</target>
<!-- from http://stackoverflow.com/questions/2974106/how-to-lookup-the-latest-git-commit-hash-from-an-ant-build-script -->
<available file=".git" type="dir" property="git.present"/>
<target name="git" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
</target>
<!-- Eclipse targets -->
<target name="classpath">
<echo message="Started writing classpaths..."/>
<subant buildpathref="antfiles" failonerror="false" inheritall="false" inheritrefs="false" target="classpath"/>
<echo message="Completed writing classpaths."/>
</target>
</project>