-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
143 lines (121 loc) · 4.28 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<project
xmlns:ivy="antlib:org.apache.ivy.ant"
name="Tensation"
basedir="."
default="help">
<path id="build.antlib">
<fileset dir="./lib" includes="*.jar" />
</path>
<target name="help">
<java classname="org.apache.tools.ant.Main">
<arg value="-projecthelp" />
</java>
</target>
<target name="run">
<java jar="./build/jars/tensation.jar" fork="true">
</java>
</target>
<target name="run-de">
<java jar="./build/jars/tensation.jar" fork="true">
<sysproperty key="user.language" value="de"/>
</java>
</target>
<target name="run-en">
<java jar="./build/jars/tensation.jar" fork="true">
<sysproperty key="user.language" value="en"/>
</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="rc" description="Compile resources">
<taskdef name="resourceCompile" classname="com.mpdeimos.ant.resourcecompiler.ResourceCompilerTask" classpathref="build.antlib"/>
<resourceCompile path="./res"/>
</target>
<target name="retrieve" description="Retrieve dependencies with ivy">
<ivy:retrieve pattern="./lib/[artifact].[ext]" type="jar" changing="false"/>
</target>
<target name="pot" description="Creates a POT file from main properties file">
<exec executable="prop2po">
<arg path="./res/string/string.properties" />
<arg value="-P" />
<arg path="./po/string/string.pot" />
<arg value="--encoding=utf-8" />
<arg value="--progress=none" />
</exec>
</target>
<target name="prop2po" depends="pot" description="Creates PO files from properties files">
<exec executable="prop2po">
<arg path="./res/string" />
<arg path="./po/string" />
<arg value="-t"/>
<arg path="./res/string/string.properties" />
<arg value="--progress=none" />
<arg value="--encoding=utf-8" />
</exec>
<delete file="./po/string/string.po"/>
</target>
<target name="po2prop" description="Creates properties files from PO files">
<exec executable="po2prop">
<arg value="-t"/>
<arg path="./res/string/string.properties" />
<arg path="./po/string" />
<arg path="./res/string" />
<arg value="--progress=none" />
<arg value="--encoding=utf-8" />
<arg value="--personality=java"/>
</exec>
<move todir="./res/string" includeemptydirs="false">
<fileset dir="./res/string">
<exclude name="string*" />
</fileset>
<mapper type="glob" from="*" to="string_*" />
</move>
</target>
<target name="build" description="Comiple classes" depends="rc">
<mkdir dir="./build" />
<mkdir dir="./build/classes" />
<javac destdir="./build/classes" debug="true" source="1.5" target="1.5">
<src path="./src"/>
<src path="./res"/>
<classpath>
<fileset dir="./lib" includes="*.jar" />
</classpath>
</javac>
</target>
<target name="getbzrdetails">
<exec executable="bzr" outputproperty="bzr.revision">
<arg value="revno" />
</exec>
</target>
<target name="jar" description="Create Jars" depends="build">
<mkdir dir="./build/tmp/" />
<mkdir dir="./build/jars/" />
<jar jarfile="./build/jars/tensation.jar">
<manifest>
<attribute name="Main-Class" value="com.mpdeimos.tensation.Main" />
<attribute name="Class-Path" value="." />
<attribute name="Bzr-Revision" value="${bzr.revision}" />
<attribute name="Implementation-Version" value="${bzr.revision}" />
</manifest>
<fileset dir="./build/classes" includes="**/*" />
<fileset dir="./res" includes="string/*.properties" />
<fileset dir="./res" includes="drawable/*.png" />
<fileset dir="./src" includes="**/*.xml" />
<zipfileset excludes="META-INF/*.MF" src="lib/ant-resource-compiler.jar"/>
</jar>
</target>
<target name="publish" depends="clean, retrieve, 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 ${bzr.revision}" />
</target>
</project>