Changeset 34023 in osm for applications


Ignore:
Timestamp:
2018-01-21T00:37:28+01:00 (7 years ago)
Author:
donvip
Message:

see #josm8645 - exclude transifex plugins from Launchpad i18n job (pacth by floscher)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/i18n/build.xml

    r33756 r34023  
    4545        <copy file="specialmessages.java" todir="${i18n.build.dir}"/>
    4646    </target>
    47     <target name="po/josm.pot" description="Extracts message keys from the source code" depends="trans_.java,init">
     47    <!-- Create the file build/pluginSrc.txt, which contains a list of include patterns for all *.java files that should be translated relative to "${plugin.dir}" -->
     48    <target name="filterpluginsources" depends="init">
     49        <delete file="${po.build.dir}/pluginSrc.txt"/>
     50        <foreach param="path" target="filterpluginsource">
     51            <path>
     52                <dirset dir="${plugin.dir}" includes="*" excludes="00_*" />
     53            </path>
     54        </foreach>
     55    </target>
     56    <!-- Helper task for `filterpluginsources`: Appends an include pattern to the file `build/pluginSrc.txt` if there is no file `.tx/config` for a plugin -->
     57    <target name="filterpluginsource">
     58      <if>
     59          <not>
     60              <available file="${path}/.tx/config" type="file" />
     61          </not>
     62          <then>
     63              <basename file="${path}" property="dir"/>
     64              <echo file="${po.build.dir}/pluginSrc.txt" append="true" message="${dir}/**/*.java&#xa;"></echo>
     65          </then>
     66      </if>
     67    </target>
     68    <target name="po/josm.pot" description="Extracts message keys from the source code" depends="trans_.java,init,filterpluginsources">
    4869        <gettext-extract keysFile="josm.raw.pot" poDirectory="po" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
    4970            <!-- core.port -->
     
    5879            <!-- <fileset dir="${i18n.build.dir}/josmfiles" includes="trans_*.*"/> disable for now -->
    5980            <!-- plugins.pot -->
    60             <fileset dir="${plugin.dir}" includes="**/*.java"/>
     81            <fileset dir="${plugin.dir}" includesfile="${po.build.dir}/pluginSrc.txt"/>
    6182            <fileset dir="${i18n.build.dir}" includes="trans_surveyor.java"/>
    6283            <fileset dir="${i18n.build.dir}" includes="trans_tag2link.java"/>
     
    94115    <target name="po/plugins.pot" description="Extracts message keys from the plugins source code (minus core and data strings)" depends="trans_.java,po/core.pot,po/data.pot,init">
    95116        <gettext-extract keysFile="plugins.raw.pot" poDirectory="${i18n.build.dir}" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
    96             <fileset dir="${plugin.dir}" includes="**/*.java"/>
     117            <fileset dir="${plugin.dir}" includesfile="${po.build.dir}/pluginSrc.txt"/>
    97118            <fileset dir="${i18n.build.dir}" includes="trans_surveyor.java"/>
    98119            <fileset dir="${i18n.build.dir}" includes="trans_tag2link.java"/>
     
    139160        </exec>
    140161    </target>
     162    <!-- If the file `josm.pot` is present and the plugin has a `data/` directory, update its *.po files based on the ones in the `po/` directory. -->
    141163    <target name="plugintrans">
    142164        <basename file="${path}" property="dir"/>
     
    151173        </gettext-extract>
    152174        <if>
    153             <available file="${po.build.dir}/plugin_${dir}/josm.pot"/>
     175            <and>
     176                <available file="${po.build.dir}/plugin_${dir}/josm.pot" type="file"/>
     177                <available file="${plugin.dir}/${dir}/data/" type="dir"/>
     178            </and>
    154179            <then>
    155180                <exec executable="perl" failonerror="true">
     
    182207            <arg line="launchpad.pl bzronly"/>
    183208        </exec>
    184         <antcall target="build"/>       
     209        <antcall target="build"/>
    185210    </target>
    186211    <target name="updatecore">
     
    188213            <arg line="launchpad.pl bzronly"/>
    189214        </exec>
    190         <antcall target="buildcore"/>       
     215        <antcall target="buildcore"/>
    191216    </target>
    192217</project>
Note: See TracChangeset for help on using the changeset viewer.