source: subversion/applications/editors/josm/plugins/lang/build.xml @ 10585

Last change on this file since 10585 was 9732, checked in by Dirk Stoecker, 12 years ago

updated

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