source: osm/applications/editors/josm/i18n/build.xml@ 30140

Last change on this file since 30140 was 30140, checked in by holgermappt, 11 years ago

antcall parameter syntax fix for target singleplugintrans.

File size: 6.7 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"/>
[30134]8 <property name="validator.tagfile" value="${josm.build.dir}/data/validator/tagchecker.cfg"/>
[26174]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>
[30139]62 <target name="singleplugintrans" depends="po/josm.pot,init">
[30140]63 <antcall target="plugintrans">
64 <param name="path" value="${plugin}"/>
65 </antcall>
[30139]66 </target>
[26928]67 <target name="buildcore" depends="po/josm.pot,init">
68 <gettext-merge keysFile="josm.pot" poDirectory="po"/>
69 <antcall target="coretrans"/>
70 </target>
[26174]71 <target name="coretrans">
72 <mkdir dir="${po.build.dir}/core"/>
73 <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">
74 <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
75 <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
76 <fileset dir="${i18n.build.dir}" includes="trans_*.java"/>
77 </gettext-extract>
78 <copy todir="${po.build.dir}/core">
79 <fileset dir="po"/>
80 </copy>
81 <gettext-merge keysFile="josm.pot" poDirectory="${po.build.dir}/core"/>
82 <exec executable="perl">
83 <arg line="i18n.pl ${i18n.install.dir}/ ${po.build.dir}/core/*.po"/>
84 </exec>
85 </target>
[26716]86 <target name="plugintrans" depends="init">
[26174]87 <basename file="${path}" property="dir"/>
88 <mkdir dir="${po.build.dir}/plugin_${dir}"/>
89 <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">
90 <fileset dir="${plugin.dir}/${dir}" includes="**/*.java"/>
91 </gettext-extract>
92 <if>
93 <available file="${po.build.dir}/plugin_${dir}/josm.pot"/>
94 <then>
95 <copy todir="${po.build.dir}/plugin_${dir}">
96 <fileset dir="po"/>
97 </copy>
98 <gettext-merge keysFile="josm.pot" poDirectory="${po.build.dir}/plugin_${dir}"/>
99 <exec executable="perl">
100 <arg line="i18n.pl ${plugin.dir}/${dir}/data/ ${po.build.dir}/plugin_${dir}/*.po"/>
101 </exec>
102 </then>
103 </if>
[26928]104 <delete dir="${po.build.dir}/plugin_${dir}"/>
[26174]105 </target>
106 <target name="clean">
107 <delete dir="${i18n.build.dir}"/>
108 <delete file="po/josm.pot"/>
109 <delete>
110 <fileset dir="po" includes="*.*~" defaultexcludes="false"/>
111 </delete>
[26928]112 <delete>
113 <fileset dir="po" includes="*.po" defaultexcludes="false"/>
114 </delete>
[26174]115 </target>
[26849]116 <target name="test">
117 <mkdir dir="${i18n.build.dir}/test"/>
118 <exec executable="perl">
119 <arg line="i18n.pl ${i18n.build.dir}/test/ po/*.po"/>
120 </exec>
121 </target>
[26928]122 <target name="pot" depends="po/josm.pot" />
123 <target name="update">
124 <exec executable="perl">
125 <arg line="launchpad.pl bzronly"/>
126 </exec>
127 <antcall target="build"/>
128 </target>
129 <target name="updatecore">
130 <exec executable="perl">
131 <arg line="launchpad.pl bzronly"/>
132 </exec>
133 <antcall target="buildcore"/>
134 </target>
[11529]135</project>
Note: See TracBrowser for help on using the repository browser.