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

Last change on this file since 26716 was 26716, checked in by bastik, 8 years ago

small update

File size: 5.5 KB
RevLine 
[26174]1<?xml version="1.0" encoding="utf-8"?>
[11529]2<project name="JOSM i18n" default="build" basedir=".">
[26174]3    <!-- compilation properties -->
4    <property name="josm.build.dir" value="../core"/>
5    <property name="josm.presets" value="${josm.build.dir}/data/defaultpresets.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="${josm.build.dir}/data/tagchecker.cfg"/>
9    <property name="wms.srcfile" value="http://josm.openstreetmap.de/maps"/>
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}/data"/>
13    <property name="po.build.dir" value="${i18n.build.dir}"/>
14    <property name="ant.build.javac.target" value="1.5"/>
15    <property name="gettexttasks.jar" value="lib/gettext-ant-tasks-0.9.7.jar"/>
16    <property name="antcontrib.jar" value="lib/ant-contrib-1.0b3.jar"/>
17    <target name="init" description="Loads the Ant gettext and contrib tasks">
18        <taskdef name="gettext-extract" classname="org.xnap.commons.ant.gettext.GettextExtractKeysTask" classpath="${gettexttasks.jar}"/>
19        <taskdef name="gettext-merge" classname="org.xnap.commons.ant.gettext.GettextMergeKeysTask" classpath="${gettexttasks.jar}"/>
20        <taskdef name="gettext-dist" classname="org.xnap.commons.ant.gettext.GettextDistTask" classpath="${gettexttasks.jar}"/>
21        <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${antcontrib.jar}"/>
22    </target>
23    <target name="trans_.java">
24        <mkdir dir="${i18n.build.dir}"/>
25        <exec executable="perl" failonerror="true" output="${i18n.build.dir}/trans_presets.java">
26            <arg line="convpreset.pl ${josm.presets}"/>
27        </exec>
28        <exec executable="perl" output="${i18n.build.dir}/trans_style.java">
29            <arg line="convstyle.pl ${josm.style}"/>
30        </exec>
31        <exec executable="perl" output="${i18n.build.dir}/trans_validator.java">
32            <arg line="convvalidator.pl ${validator.tagfile}"/>
33        </exec>
34        <exec executable="perl" output="${i18n.build.dir}/trans_wms.java">
35            <arg line="convwms.pl ${wms.srcfile}"/>
36        </exec>
37        <exec executable="perl" output="${i18n.build.dir}/trans_surveyor.java">
38            <arg line="convsurveyor.pl ${surveyor.srcfile}"/>
39        </exec>
40        <exec executable="perl" output="${i18n.build.dir}/trans_plugins.java">
41            <arg line="convplugins.pl ${plugin.dir}/*/build.xml"/>
42        </exec>
43        <copy file="specialmessages.java" todir="${i18n.build.dir}"/>
44    </target>
45    <target name="po/josm.pot" description="Extracts message keys from the source code" depends="trans_.java,init">
46        <gettext-extract keysFile="josm.pot" poDirectory="po" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
47            <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
48            <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
49            <fileset dir="${i18n.build.dir}" includes="trans_*.java"/>
50            <fileset dir="${plugin.dir}" includes="**/*.java"/>
51        </gettext-extract>
52    </target>
53    <target name="build" depends="po/josm.pot,init">
[26247]54        <gettext-merge keysFile="josm.pot" poDirectory="po"/>
[26174]55        <antcall target="coretrans"/>
56        <foreach param="path" target="plugintrans">
57            <path>
58                <dirset dir="${plugin.dir}" includes="*"/>
59            </path>
60        </foreach>
61    </target>
62    <target name="coretrans">
63        <mkdir dir="${po.build.dir}/core"/>
64        <gettext-extract keysFile="josm.pot" poDirectory="${po.build.dir}/core" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
65            <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
66            <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
67            <fileset dir="${i18n.build.dir}" includes="trans_*.java"/>
68        </gettext-extract>
69        <copy todir="${po.build.dir}/core">
70            <fileset dir="po"/>
71        </copy>
72        <gettext-merge keysFile="josm.pot" poDirectory="${po.build.dir}/core"/>
73        <exec executable="perl">
74            <arg line="i18n.pl ${i18n.install.dir}/ ${po.build.dir}/core/*.po"/>
75        </exec>
76    </target>
[26716]77    <target name="plugintrans" depends="init">
[26174]78        <basename file="${path}" property="dir"/>
79        <mkdir dir="${po.build.dir}/plugin_${dir}"/>
80        <gettext-extract keysFile="josm.pot" poDirectory="${po.build.dir}/plugin_${dir}" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
81            <fileset dir="${plugin.dir}/${dir}" includes="**/*.java"/>
82        </gettext-extract>
83        <if>
84            <available file="${po.build.dir}/plugin_${dir}/josm.pot"/>
85            <then>
86                <copy todir="${po.build.dir}/plugin_${dir}">
87                    <fileset dir="po"/>
88                </copy>
89                <gettext-merge keysFile="josm.pot" poDirectory="${po.build.dir}/plugin_${dir}"/>
90                <exec executable="perl">
91                    <arg line="i18n.pl ${plugin.dir}/${dir}/data/ ${po.build.dir}/plugin_${dir}/*.po"/>
92                </exec>
93            </then>
94        </if>
95    </target>
96    <target name="clean">
97        <delete dir="${i18n.build.dir}"/>
98        <delete file="po/josm.pot"/>
99        <delete>
100            <fileset dir="po" includes="*.*~" defaultexcludes="false"/>
101        </delete>
102    </target>
[11529]103</project>
Note: See TracBrowser for help on using the repository browser.