1 | <project name="lang" default="install-all" basedir=".">
|
---|
2 |
|
---|
3 | <!-- compilation properties -->
|
---|
4 | <property name="josm.build.dir" value="../../core"/>
|
---|
5 | <property name="josm.presets" value="../../core/presets/presets.xml"/>
|
---|
6 | <property name="josm.home.dir" value="${user.home}/.josm"/>
|
---|
7 | <property name="josm" location="../../core/dist/josm-custom.jar" />
|
---|
8 | <property name="plugin.build.dir" value="build"/>
|
---|
9 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
10 | <property name="plugin.name" value="${ant.project.name}"/>
|
---|
11 | <property name="plugin.jar" value="../../dist/${plugin.name}.jar"/>
|
---|
12 |
|
---|
13 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
14 |
|
---|
15 | <target name="dist" depends="install-all">
|
---|
16 | </target>
|
---|
17 |
|
---|
18 | <target name="install-all" depends="josm-build,keys.pot">
|
---|
19 | <ant target="install"><property name="language" value="de"/></ant>
|
---|
20 | <ant target="install"><property name="language" value="fr"/></ant>
|
---|
21 | <ant target="install"><property name="language" value="ro"/></ant>
|
---|
22 | <ant target="install"><property name="language" value="en_GB"/></ant>
|
---|
23 | </target>
|
---|
24 |
|
---|
25 | <target name="install">
|
---|
26 | <mkdir dir="${language}/build"/>
|
---|
27 | <mkdir dir="../../dist"/>
|
---|
28 | <javac srcdir="${language}/src" classpath="${josm.build.dir}/dist/josm-custom.jar" destdir="${language}/build" />
|
---|
29 |
|
---|
30 | <exec executable="msgmerge">
|
---|
31 | <arg line="-U ${language}/${language}.po keys.pot"/>
|
---|
32 | </exec>
|
---|
33 |
|
---|
34 | <exec executable="msgfmt">
|
---|
35 | <arg line="--verbose --java2 -d${language}/build -rorg.openstreetmap.josm.Translation -l${language} ${language}/${language}.po"/>
|
---|
36 | </exec>
|
---|
37 |
|
---|
38 | <copy file="i18n.properties" todir="${language}/build/org/openstreetmap/josm" />
|
---|
39 |
|
---|
40 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
41 | <env key="LANG" value="C"/>
|
---|
42 | <arg value="info"/>
|
---|
43 | <arg value="--xml"/>
|
---|
44 | <arg value="${language}/${language}.po"/>
|
---|
45 | </exec>
|
---|
46 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
47 | <delete file="REVISION"/>
|
---|
48 | <jar destfile="../../dist/lang-${language}.jar" basedir="${language}/build">
|
---|
49 | <manifest>
|
---|
50 | <attribute name="Plugin-Class" value="org.openstreetmap.josm.TranslationLoader_${language}" />
|
---|
51 | <attribute name="Plugin-Description" value="Translation to locale ${language}" />
|
---|
52 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
53 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
54 | <attribute name="Plugin-Early" value="true" />
|
---|
55 | </manifest>
|
---|
56 | </jar>
|
---|
57 | </target>
|
---|
58 |
|
---|
59 |
|
---|
60 |
|
---|
61 | <target name="josm-build">
|
---|
62 | <ant dir="${josm.build.dir}" />
|
---|
63 | </target>
|
---|
64 |
|
---|
65 | <target name="keys.pot">
|
---|
66 | <exec executable="perl" output="presets.java">
|
---|
67 | <arg line="convpreset.pl ${josm.presets}"/>
|
---|
68 | </exec>
|
---|
69 |
|
---|
70 | <exec executable="find" output="alljava.txt">
|
---|
71 | <arg line="${josm.build.dir}/src .. -name '*.java'"/>
|
---|
72 | </exec>
|
---|
73 |
|
---|
74 | <exec executable="xgettext">
|
---|
75 | <arg line="-ktr -ktrn:1,2 -ktrc -kmarktr -Ljava --from-code=UTF-8 -okeys.pot -falljava.txt"/>
|
---|
76 | </exec>
|
---|
77 | </target>
|
---|
78 |
|
---|
79 | <target name="clean">
|
---|
80 | <ant target="clean_lang"><property name="language" value="de"/></ant>
|
---|
81 | <ant target="clean_lang"><property name="language" value="fr"/></ant>
|
---|
82 | <ant target="clean_lang"><property name="language" value="ro"/></ant>
|
---|
83 | <ant target="clean_lang"><property name="language" value="en_GB"/></ant>
|
---|
84 | <delete dir="${plugin.build.dir}" />
|
---|
85 | </target>
|
---|
86 |
|
---|
87 | <target name="clean_lang">
|
---|
88 | <delete file="../../dist/lang-${language}.jar" />
|
---|
89 | <delete dir="${language}/build"/>
|
---|
90 | <delete file="keys.pot"/>
|
---|
91 | <delete file="presets.java"/>
|
---|
92 | </target>
|
---|
93 |
|
---|
94 | </project>
|
---|