source: subversion/applications/editors/josm/i18n/build.xml @ 14020

Last change on this file since 14020 was 14020, checked in by Dirk Stoecker, 11 years ago

updated

File size: 6.0 KB
Line 
1<project name="JOSM i18n" default="build" basedir=".">
2
3  <!-- compilation properties -->
4  <property name="josm.build.dir"    value="../core"/>
5  <property name="josm.presets"      value="${josm.build.dir}/presets/presets.xml"/>
6  <property name="josm.style"        value="${josm.build.dir}/styles/standard/elemstyles.xml"/>
7  <property name="plugin.dir"        value="../plugins"/>
8  <property name="validator.tagfile" value="${plugin.dir}/validator/tagchecker.cfg"/>
9  <property name="wms.srcfile"       value="${plugin.dir}/wmsplugin/sources.cfg"/>
10  <property name="surveyor.srcfile"  value="${plugin.dir}/surveyor/resources/surveyor.xml"/>
11  <property name="i18n.build.dir"    value="build"/>
12  <property name="i18n.install.dir"  value="${josm.build.dir}/lib"/>
13  <property name="i18n.name"         value="josm-translation"/>
14  <property name="i18n.jar"          value="${i18n.install.dir}/${i18n.name}.jar"/>
15
16  <property name="ant.build.javac.target" value="1.5"/>
17
18  <property name="gettexttasks.jar" value="lib/gettext-ant-tasks-0.9.6.jar"/>
19
20  <target name="init.gettext" description="Loads the Ant gettext tasks">
21    <taskdef name="gettext-extract" classname="org.xnap.commons.ant.gettext.GettextExtractKeysTask" classpath="${gettexttasks.jar}"/>
22    <taskdef name="gettext-merge" classname="org.xnap.commons.ant.gettext.GettextMergeKeysTask" classpath="${gettexttasks.jar}"/>
23    <taskdef name="gettext-dist" classname="org.xnap.commons.ant.gettext.GettextDistTask" classpath="${gettexttasks.jar}"/>
24  </target>
25
26  <target name="trans_.java">
27    <mkdir dir="${i18n.build.dir}"/>
28    <exec executable="perl" output="${i18n.build.dir}/trans_presets.java">
29      <arg line="convpreset.pl ${josm.presets}"/>
30    </exec>
31    <exec executable="perl" output="${i18n.build.dir}/trans_style.java">
32      <arg line="convstyle.pl ${josm.style}"/>
33    </exec>
34    <exec executable="perl" output="${i18n.build.dir}/trans_validator.java">
35      <arg line="convvalidator.pl ${validator.tagfile}"/>
36    </exec>
37    <exec executable="perl" output="${i18n.build.dir}/trans_wms.java">
38      <arg line="convwms.pl ${wms.srcfile}"/>
39    </exec>
40    <exec executable="perl" output="${i18n.build.dir}/trans_surveyor.java">
41      <arg line="convsurveyor.pl ${surveyor.srcfile}"/>
42    </exec>
43    <copy file="specialmessages.java" todir="${i18n.build.dir}" />
44  </target>
45
46  <target name="po/josm.pot"
47          description="Extracts message keys from the source code"
48          depends="trans_.java,init.gettext">
49    <gettext-extract keysFile="josm.pot" poDirectory="po"
50                     keywords="-k -ktrc -ktr -kmarktr -ktrn:1,2 -ktrl">
51      <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
52      <fileset dir="${plugin.dir}" includes="**/*.java"/>
53      <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
54      <fileset dir="${i18n.build.dir}" includes="trans_*.java"/>
55    </gettext-extract>
56  </target>
57
58  <target name="build" depends="po/josm.pot,init.gettext">
59    <copy file="i18n.properties" todir="build/org/openstreetmap/josm" />
60
61    <gettext-merge keysFile="josm.pot" poDirectory="po"/>
62
63    <!--<gettext-dist targetBundle="org.openstreetmap.josm.i18n.Translation"
64                  poDirectory="po" outputDirectory="build"/>-->
65    <ant target="build-lang"><property name="language" value="ar"/></ant>
66    <ant target="build-lang"><property name="language" value="bg"/></ant>
67    <ant target="build-lang"><property name="language" value="cs"/></ant>
68    <ant target="build-lang"><property name="language" value="da"/></ant>
69    <ant target="build-lang"><property name="language" value="de"/></ant>
70    <ant target="build-lang"><property name="language" value="el"/></ant>
71    <ant target="build-lang"><property name="language" value="en_GB"/></ant>
72    <ant target="build-lang"><property name="language" value="es"/></ant>
73    <ant target="build-lang"><property name="language" value="fi"/></ant>
74    <ant target="build-lang"><property name="language" value="fr"/></ant>
75    <ant target="build-lang"><property name="language" value="he"/><property name="jlanguage" value="iw_IL"/></ant>
76    <ant target="build-lang"><property name="language" value="ja"/></ant>
77    <ant target="build-lang"><property name="language" value="is"/></ant>
78    <ant target="build-lang"><property name="language" value="it"/></ant>
79    <ant target="build-lang"><property name="language" value="nl"/></ant>
80    <ant target="build-lang"><property name="language" value="pl"/></ant>
81    <ant target="build-lang"><property name="language" value="ro"/></ant>
82    <ant target="build-lang"><property name="language" value="ru"/></ant>
83    <ant target="build-lang"><property name="language" value="sk"/></ant>
84    <ant target="build-lang"><property name="language" value="sl"/></ant>
85    <ant target="build-lang"><property name="language" value="sv"/></ant>
86    <ant target="build-lang"><property name="language" value="tr"/></ant>
87
88    <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
89      <env key="LANG" value="C"/>
90      <arg value="info"/>
91      <arg value="--xml"/>
92      <arg value="po"/>
93    </exec>
94    <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
95    <delete file="REVISION"/>
96
97    <jar destfile="${i18n.jar}" basedir="build" excludes="**/*.java">
98      <manifest>
99        <attribute name="Extension-Name" value="JOSM Translation into various languages" />
100        <attribute name="Translation-Version" value="${version.entry.commit.revision}"/>
101        <attribute name="Translation-Date" value="${version.entry.commit.date}"/>
102      </manifest>
103    </jar>
104  </target>
105
106  <target name="build-lang">
107    <property name="jlanguage" value="${language}"/>
108    <exec executable="msgfmt">
109      <arg line="--verbose --java2 -dbuild -rorg.openstreetmap.josm.i18n.Translation -l${jlanguage} po/${language}.po"/>
110    </exec>
111  </target>
112
113  <target name="clean">
114    <delete dir="${i18n.build.dir}" />
115    <delete file="po/josm.pot"/>
116    <delete>
117      <fileset dir="po" includes="*.*~" defaultexcludes="false"/>
118    </delete>
119  </target>
120
121</project>
Note: See TracBrowser for help on using the repository browser.