-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
78 lines (64 loc) · 2.28 KB
/
build.xml
File metadata and controls
78 lines (64 loc) · 2.28 KB
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
<project
xmlns:ivy="antlib:org.apache.ivy.ant"
name="AntResourceCompiler"
basedir="."
default="help">
<target name="help">
<java classname="org.apache.tools.ant.Main">
<arg value="-projecthelp" />
</java>
</target>
<target name="clean-lib" description="Clean the project libraries directory (dependencies)">
<delete includeemptydirs="true" dir="./lib"/>
</target>
<target name="clean-build" description="Clean build output">
<delete dir="./build" />
</target>
<target name="clean" depends="clean-lib,clean-build" description="Cleana all"/>
<target name="retrieve" description="Retrieve dependencies with ivy">
<ivy:retrieve pattern="./lib/[artifact].[ext]" type="jar" changing="false"/>
</target>
<target name="build" depends="retrieve" description="Compile classes">
<mkdir dir="./build" />
<mkdir dir="./build/classes" />
<javac destdir="./build/classes" debug="true" source="1.5" target="1.5">
<src path="./src"/>
<classpath>
<fileset dir="./lib" includes="*.jar" />
</classpath>
</javac>
</target>
<target name="getgitdetails" >
<exec executable="git" outputproperty="git.tag">
<arg value="name-rev"/>
<arg value="--name-only"/>
<arg value="HEAD"/>
</exec>
<exec executable="git" outputproperty="git.revision">
<arg value="rev-parse"/>
<arg value="HEAD"/>
</exec>
</target>
<target name="jar" description="Create Jars" depends="build,getgitdetails">
<mkdir dir="./build/tmp/" />
<mkdir dir="./build/jars/" />
<jar jarfile="./build/jars/ant-resource-compiler.jar">
<manifest>
<attribute name="Class-Path" value="." />
<attribute name="Git-Revision" value="${git.revision}" />
<attribute name="Implementation-Version" value="${git.tag}" />
</manifest>
<fileset dir="./build/classes" includes="**/*" />
<fileset dir="./src" includes="**/*.prototype" />
</jar>
</target>
<target name="publish" depends="clean, build, jar" description="Publish this project in the ivy repository">
<ivy:publish artifactspattern="./build/jars/[artifact].[ext]"
resolver="shared"
pubrevision="latest"
status="release"
overwrite="true"
/>
<echo message="Released with version ${git.revision}" />
</target>
</project>