Changeset 34687 in osm for applications


Ignore:
Timestamp:
2018-10-21T17:40:44+02:00 (6 years ago)
Author:
simon04
Message:

JOSM/i18n: use xgettext --exclude-file feature

This brings down the time for the task po/josm.pot from 70s to 10s.

see #josm8645

Location:
applications/editors/josm/i18n
Files:
1 added
1 edited

Legend:

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

    r34686 r34687  
    6868    </target>
    6969    <target name="po/josm.pot" description="Extracts message keys from the source code" depends="trans_.java,init,filterpluginsources">
    70         <gettext-extract keysFile="josm.raw.pot" poDirectory="po" keywords="${gettext.keywords}">
     70        <gettext-extract keysFile="josm.pot" poDirectory="po" keywords="${gettext.keywords} --exclude-file=excludes.pot">
    7171            <!-- core.pot -->
    7272            <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
     
    8484            <fileset dir="${i18n.build.dir}" includes="trans_tag2link.java"/>
    8585        </gettext-extract>
    86         <exec executable="msggrep" failonerror="true">
    87             <arg line="--msgid --regexp='---DUMMY-MARKER---' --invert-match --output-file=po/josm.pot po/josm.raw.pot"/>
    88         </exec>
    89         <delete file="po/josm.raw.pot"/>
    9086    </target>
    9187    <target name="po/core.pot" description="Extracts message keys from the JOSM core source code" depends="trans_.java,init">
    92         <gettext-extract keysFile="core.pot" poDirectory="po" keywords="${gettext.keywords}">
     88        <gettext-extract keysFile="core.pot" poDirectory="po" keywords="${gettext.keywords} --exclude-file=excludes.pot">
    9389            <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
    9490            <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
     
    10197    </target>
    10298    <target name="po/data.pot" description="Extracts message keys from data files, e.g., presets, imagery (minus core strings)" depends="trans_.java,po/core.pot,init">
    103         <gettext-extract keysFile="data.raw.pot" poDirectory="${i18n.build.dir}" keywords="${gettext.keywords}">
     99        <gettext-extract keysFile="data.pot" poDirectory="po" keywords="${gettext.keywords} --exclude-file=excludes.pot --exclude-file=po/core.pot">
    104100            <fileset dir="${i18n.build.dir}" includes="trans_plugins.java"/>
    105101            <!-- <fileset dir="${i18n.build.dir}/josmfiles" includes="trans_*.*"/> -->
    106102        </gettext-extract>
    107         <copy todir="${po.build.dir}">
    108             <fileset dir="po" includes="core.pot"/>
    109         </copy>
    110         <exec executable="msgcomm" failonerror="true" output="po/data.pot">
    111             <arg line="--unique po/core.pot ${po.build.dir}/core.pot ${i18n.build.dir}/data.raw.pot"/>
    112         </exec>
    113         <delete file="${po.build.dir}/core.pot"/>
    114         <delete file="${po.build.dir}/data.raw.pot"/>
    115103    </target>
    116104    <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">
    117         <gettext-extract keysFile="plugins.raw.pot" poDirectory="${i18n.build.dir}" keywords="${gettext.keywords}">
     105        <gettext-extract keysFile="plugins.pot" poDirectory="po" keywords="${gettext.keywords} --exclude-file=excludes.pot --exclude-file=po/core.pot">
    118106            <fileset dir="${plugin.dir}" includesfile="${po.build.dir}/pluginSrc.txt"/>
    119107            <fileset dir="${i18n.build.dir}" includes="trans_surveyor.java"/>
    120108            <fileset dir="${i18n.build.dir}" includes="trans_tag2link.java"/>
    121109        </gettext-extract>
    122         <copy todir="${po.build.dir}">
    123             <fileset dir="po" includes="core.pot"/>
    124             <fileset dir="po" includes="data.pot"/>
    125         </copy>
    126         <exec executable="msgcomm" failonerror="true" output="po/plugins.pot">
    127             <arg line="--unique po/core.pot ${po.build.dir}/core.pot po/data.pot ${po.build.dir}/data.pot ${i18n.build.dir}/plugins.raw.pot"/>
    128         </exec>
    129         <delete file="${po.build.dir}/core.pot"/>
    130         <delete file="${po.build.dir}/data.pot"/>
    131         <delete file="${po.build.dir}/plugins.raw.pot"/>
    132110    </target>
    133111    <target name="build" depends="pot,allpot">
Note: See TracChangeset for help on using the changeset viewer.