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

Last change on this file since 30144 was 30144, checked in by simon04, 11 years ago

JOSM: include validator/*mapcss in i18n process

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