1 | <project name="openstreetmap" default="dist" basedir=".">
|
---|
2 |
|
---|
3 | <property name="src" location="src" />
|
---|
4 | <property name="po" location="po" />
|
---|
5 | <property name="build" location="build" />
|
---|
6 | <property name="dist" location="dist" />
|
---|
7 | <property name="lib" location="lib" />
|
---|
8 |
|
---|
9 | <path id="classpath">
|
---|
10 | <fileset dir="${lib}">
|
---|
11 | <include name="**/*.jar"/>
|
---|
12 | </fileset>
|
---|
13 | </path>
|
---|
14 |
|
---|
15 | <path id="srcfiles">
|
---|
16 | <fileset dir="${src}">
|
---|
17 | <include name="**/*.java"/>
|
---|
18 | </fileset>
|
---|
19 | </path>
|
---|
20 |
|
---|
21 | <target name="init">
|
---|
22 | <mkdir dir="${build}" />
|
---|
23 | <mkdir dir="${dist}" />
|
---|
24 | </target>
|
---|
25 |
|
---|
26 | <target name="compile" depends="init">
|
---|
27 | <javac srcdir="${src}" classpathref="classpath" destdir="${build}">
|
---|
28 | <include name="org/openstreetmap/josm/gui/MainApplication.java"/>
|
---|
29 | <include name="org/openstreetmap/josm/gui/MainApplet.java"/>
|
---|
30 | </javac>
|
---|
31 | </target>
|
---|
32 |
|
---|
33 | <target name="dist" depends="compile,gettext">
|
---|
34 | <!-- jars -->
|
---|
35 | <unjar src="${lib}/MinML2.jar" dest="${build}" />
|
---|
36 | <unjar src="${lib}/gettext-commons-0.9.jar" dest="${build}" />
|
---|
37 | <unjar src="${lib}/metadata-extractor-2.3.1.jar" dest="${build}" />
|
---|
38 |
|
---|
39 | <!-- images -->
|
---|
40 | <copy todir="${build}/images">
|
---|
41 | <fileset dir="images" />
|
---|
42 | </copy>
|
---|
43 | <copy todir="${build}/org/openstreetmap/josm">
|
---|
44 | <fileset dir="${po}/org/openstreetmap/josm" />
|
---|
45 | </copy>
|
---|
46 | <jar destfile="${dist}/josm-custom.jar" basedir="${build}">
|
---|
47 | <manifest>
|
---|
48 | <attribute name="Main-class" value="org.openstreetmap.josm.gui.MainApplication" />
|
---|
49 | </manifest>
|
---|
50 | </jar>
|
---|
51 | </target>
|
---|
52 |
|
---|
53 | <target name="clean">
|
---|
54 | <delete dir="${build}" />
|
---|
55 | <delete dir="${dist}" />
|
---|
56 | </target>
|
---|
57 |
|
---|
58 |
|
---|
59 | <target name="gettext" depends="init">
|
---|
60 | <exec executable="find" output="${build}/alljava.txt">
|
---|
61 | <arg line="${src} -name '*.java'"/>
|
---|
62 | </exec>
|
---|
63 | <exec executable="xgettext">
|
---|
64 | <arg line="-ktr -ktrn:1,2 -ktrc -kmarktr -Ljava -o${build}/keys.pot -f${build}/alljava.txt"/>
|
---|
65 | </exec>
|
---|
66 | <apply executable="msgmerge">
|
---|
67 | <arg value="-U"/>
|
---|
68 | <srcfile/>
|
---|
69 | <arg file="${build}/keys.pot"/>
|
---|
70 | <fileset dir="${po}">
|
---|
71 | <include name="*.po"/>
|
---|
72 | </fileset>
|
---|
73 | </apply>
|
---|
74 |
|
---|
75 | <!-- FIXME: somehow iterate the po-directory and create the java files -->
|
---|
76 | <exec executable="msgfmt">
|
---|
77 | <arg line="--java2 -d${po} -rorg.openstreetmap.josm.Translation -lde ${po}/de.po"/>
|
---|
78 | </exec>
|
---|
79 | <exec executable="msgfmt">
|
---|
80 | <arg line="--java2 -d${po} -rorg.openstreetmap.josm.Translation -lfr ${po}/fr.po"/>
|
---|
81 | </exec>
|
---|
82 | <exec executable="msgfmt">
|
---|
83 | <arg line="--java2 -d${po} -rorg.openstreetmap.josm.Translation -len_GB ${po}/en_GB.po"/>
|
---|
84 | </exec>
|
---|
85 | </target>
|
---|
86 |
|
---|
87 | </project>
|
---|