source: osm/applications/editors/josm/plugins/lang/build.xml@ 9465

Last change on this file since 9465 was 8486, checked in by stoecker, 17 years ago

added presets translation support

File size: 3.5 KB
RevLine 
[1497]1<project name="lang" default="install-all" basedir=".">
2
[5017]3 <!-- compilation properties -->
[5153]4 <property name="josm.build.dir" value="../../core"/>
[8486]5 <property name="josm.presets" value="../../core/presets/presets.xml"/>
[5153]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"/>
[6100]9 <property name="plugin.dist.dir" value="../../dist"/>
[5153]10 <property name="plugin.name" value="${ant.project.name}"/>
[6100]11 <property name="plugin.jar" value="../../dist/${plugin.name}.jar"/>
[5153]12
[5197]13 <property name="ant.build.javac.target" value="1.5"/>
[5017]14
[5153]15 <target name="dist" depends="install-all">
16 </target>
17
[5147]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>
[1497]24
[5147]25 <target name="install">
[5153]26 <mkdir dir="${language}/build"/>
[6100]27 <mkdir dir="../../dist"/>
[5153]28 <javac srcdir="${language}/src" classpath="${josm.build.dir}/dist/josm-custom.jar" destdir="${language}/build" />
[1497]29
[5147]30 <exec executable="msgmerge">
31 <arg line="-U ${language}/${language}.po keys.pot"/>
32 </exec>
[1497]33
[5147]34 <exec executable="msgfmt">
[6110]35 <arg line="--verbose --java2 -d${language}/build -rorg.openstreetmap.josm.Translation -l${language} ${language}/${language}.po"/>
[5147]36 </exec>
[1497]37
[5153]38 <copy file="i18n.properties" todir="${language}/build/org/openstreetmap/josm" />
[1498]39
[7812]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"/>
[6100]48 <jar destfile="../../dist/lang-${language}.jar" basedir="${language}/build">
[5147]49 <manifest>
50 <attribute name="Plugin-Class" value="org.openstreetmap.josm.TranslationLoader_${language}" />
51 <attribute name="Plugin-Description" value="Translation to locale ${language}" />
[7812]52 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
53 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
[5147]54 <attribute name="Plugin-Early" value="true" />
55 </manifest>
56 </jar>
57 </target>
[1497]58
59
60
[5147]61 <target name="josm-build">
62 <ant dir="${josm.build.dir}" />
63 </target>
[8486]64
[5147]65 <target name="keys.pot">
[8486]66 <exec executable="perl" output="presets.java">
67 <arg line="convpreset.pl ${josm.presets}"/>
68 </exec>
69
[5147]70 <exec executable="find" output="alljava.txt">
[6110]71 <arg line="${josm.build.dir}/src .. -name '*.java'"/>
[5147]72 </exec>
[1497]73
[5147]74 <exec executable="xgettext">
[6110]75 <arg line="-ktr -ktrn:1,2 -ktrc -kmarktr -Ljava --from-code=UTF-8 -okeys.pot -falljava.txt"/>
[5147]76 </exec>
77 </target>
[5017]78
[5147]79 <target name="clean">
[5153]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}" />
[5147]85 </target>
[5017]86
[5153]87 <target name="clean_lang">
[6100]88 <delete file="../../dist/lang-${language}.jar" />
[5153]89 <delete dir="${language}/build"/>
[7821]90 <delete file="keys.pot"/>
[8486]91 <delete file="presets.java"/>
[5153]92 </target>
93
[1497]94</project>
Note: See TracBrowser for help on using the repository browser.