Changeset 5d93ca1


Ignore:
Timestamp:
May 7, 2016 12:57:49 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
05012a9
Parents:
7d11ec2f
Message:

Build: Add back the old, slow way to build bundles
for gettext < 0.19

Location:
apps
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • apps/desktopgui/build.xml

    r7d11ec2f r5d93ca1  
    1717        <target name="init">
    1818        <mkdir dir="${build}"/>
     19        <mkdir dir="${build}/messages-src"/>
    1920        <mkdir dir="${dist}"/>
    2021        </target>
     
    3839        </target>
    3940
    40         <target name="bundle" unless="no.bundle">
     41        <target name="bundle" unless="no.bundle" depends="init">
    4142            <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
    4243                <env key="JAVA_HOME" value="${java.home}" />
  • apps/desktopgui/bundle-messages.sh

    r7d11ec2f r5d93ca1  
    106106        echo "Generating ${CLASS}_$LG ResourceBundle..."
    107107
    108         # convert to class files in build
    109         TD=build/messages-src-tmp
    110         TDX=$TD/net/i2p/desktopgui
    111         TD2=build/messages-src
    112         TDY=$TD2/net/i2p/desktopgui
    113         rm -rf $TD
    114         mkdir -p $TD $TDY
    115         msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     108        msgfmt -V | grep -q '0\.19'
    116109        if [ $? -ne 0 ]
    117110        then
    118             echo "ERROR - msgfmt failed on ${i}, not updating translations"
    119             # msgfmt leaves the class file there so the build would work the next time
    120             find build -name messages_${LG}.class -exec rm -f {} \;
    121             RC=1
    122             break
     111            # slow way
     112            # convert to class files in build
     113            msgfmt --java --statistics -r $CLASS -l $LG -d build $i
     114            if [ $? -ne 0 ]
     115            then
     116                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     117                # msgfmt leaves the class file there so the build would work the next time
     118                find build -name messages_${LG}.class -exec rm -f {} \;
     119                RC=1
     120                break
     121            fi
     122        else
     123            # fast way
     124            # convert to java files in build/messages-src
     125            TD=build/messages-src-tmp
     126            TDX=$TD/net/i2p/desktopgui
     127            TD2=build/messages-src
     128            TDY=$TD2/net/i2p/desktopgui
     129            rm -rf $TD
     130            mkdir -p $TD $TDY
     131            msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     132            if [ $? -ne 0 ]
     133            then
     134                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     135                # msgfmt leaves the class file there so the build would work the next time
     136                find build -name messages_${LG}.class -exec rm -f {} \;
     137                RC=1
     138                break
     139            fi
     140            mv $TDX/messages_$LG.java $TDY
     141            rm -rf $TD
    123142        fi
    124         mv $TDX/messages_$LG.java $TDY
    125         rm -rf $TD
    126143    fi
    127144done
  • apps/i2psnark/java/build.xml

    r7d11ec2f r5d93ca1  
    138138   
    139139    <target name="bundle" depends="compile" unless="no.bundle">
     140        <mkdir dir="build/messages-src" />
    140141        <!-- Update the messages_*.po files.
    141142             We need to supply the bat file for windows, and then change the fail property to true -->
  • apps/i2psnark/java/bundle-messages.sh

    r7d11ec2f r5d93ca1  
    9797        echo "Generating ${CLASS}_$LG ResourceBundle..."
    9898
    99         # convert to class files in build/obj
    100         TD=build/messages-src-tmp
    101         TDX=$TD/org/klomp/snark/web
    102         TD2=build/messages-src
    103         TDY=$TD2/org/klomp/snark/web
    104         rm -rf $TD
    105         mkdir -p $TD $TDY
    106         msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     99        msgfmt -V | grep -q '0\.19'
    107100        if [ $? -ne 0 ]
    108101        then
    109             echo "ERROR - msgfmt failed on ${i}, not updating translations"
    110             # msgfmt leaves the class file there so the build would work the next time
    111             find build/obj -name messages_${LG}.class -exec rm -f {} \;
    112             RC=1
    113             break
     102            # slow way
     103            # convert to class files in build/obj
     104            msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
     105            if [ $? -ne 0 ]
     106            then
     107                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     108                # msgfmt leaves the class file there so the build would work the next time
     109                find build -name messages_${LG}.class -exec rm -f {} \;
     110                RC=1
     111                break
     112            fi
     113        else
     114            # fast way
     115            # convert to java files in build/messages-src
     116            TD=build/messages-src-tmp
     117            TDX=$TD/org/klomp/snark/web
     118            TD2=build/messages-src
     119            TDY=$TD2/org/klomp/snark/web
     120            rm -rf $TD
     121            mkdir -p $TD $TDY
     122            msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     123            if [ $? -ne 0 ]
     124            then
     125                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     126                # msgfmt leaves the class file there so the build would work the next time
     127                find build/obj -name messages_${LG}.class -exec rm -f {} \;
     128                RC=1
     129                break
     130            fi
     131            mv $TDX/messages_$LG.java $TDY
     132            rm -rf $TD
    114133        fi
    115         mv $TDX/messages_$LG.java $TDY
    116         rm -rf $TD
    117134    fi
    118135done
  • apps/i2ptunnel/java/build.xml

    r7d11ec2f r5d93ca1  
    124124    <!-- servlet translations go in the war, not the jar -->
    125125    <target name="bundle" depends="compile, precompilejsp" unless="no.bundle">
     126        <mkdir dir="build/messages-src" />
    126127        <!-- Update the messages_*.po files.
    127128             We need to supply the bat file for windows, and then change the fail property to true -->
     
    162163    <!-- proxy error page translations go in the jar, not the war -->
    163164    <target name="bundle-proxy" unless="no.bundle">
     165        <mkdir dir="build/messages-proxy-src" />
    164166        <!-- Update the messages_*.po files.
    165167             We need to supply the bat file for windows, and then change the fail property to true -->
  • apps/i2ptunnel/java/bundle-messages-proxy.sh

    r7d11ec2f r5d93ca1  
    9999        echo "Generating ${CLASS}_$LG ResourceBundle..."
    100100
    101         # convert to class files in build/obj
    102         TD=build/messages-proxy-src-tmp
    103         TDX=$TD/net/i2p/i2ptunnel/proxy
    104         TD2=build/messages-proxy-src
    105         TDY=$TD2/net/i2p/i2ptunnel/proxy
    106         rm -rf $TD
    107         mkdir -p $TD $TDY
    108         msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     101        msgfmt -V | grep -q '0\.19'
    109102        if [ $? -ne 0 ]
    110103        then
    111             echo "ERROR - msgfmt failed on ${i}, not updating translations"
    112             # msgfmt leaves the class file there so the build would work the next time
    113             find build/obj -name messages_${LG}.class -exec rm -f {} \;
    114             RC=1
    115             break
     104            # slow way
     105            # convert to class files in build/obj
     106            msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
     107            if [ $? -ne 0 ]
     108            then
     109                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     110                # msgfmt leaves the class file there so the build would work the next time
     111                find build -name messages_${LG}.class -exec rm -f {} \;
     112                RC=1
     113                break
     114            fi
     115        else
     116            # fast way
     117            # convert to java files in build/messages-proxy-src
     118            TD=build/messages-proxy-src-tmp
     119            TDX=$TD/net/i2p/i2ptunnel/proxy
     120            TD2=build/messages-proxy-src
     121            TDY=$TD2/net/i2p/i2ptunnel/proxy
     122            rm -rf $TD
     123            mkdir -p $TD $TDY
     124            msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     125            if [ $? -ne 0 ]
     126            then
     127                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     128                # msgfmt leaves the class file there so the build would work the next time
     129                find build/obj -name messages_${LG}.class -exec rm -f {} \;
     130                RC=1
     131                break
     132            fi
     133            mv $TDX/messages_$LG.java $TDY
     134            rm -rf $TD
    116135        fi
    117         mv $TDX/messages_$LG.java $TDY
    118         rm -rf $TD
    119136    fi
    120137done
  • apps/i2ptunnel/java/bundle-messages.sh

    r7d11ec2f r5d93ca1  
    9898        echo "Generating ${CLASS}_$LG ResourceBundle..."
    9999
    100         # convert to class files in build/obj
    101         TD=build/messages-src-tmp
    102         TDX=$TD/net/i2p/i2ptunnel/web
    103         TD2=build/messages-src
    104         TDY=$TD2/net/i2p/i2ptunnel/web
    105         rm -rf $TD
    106         mkdir -p $TD $TDY
    107         msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     100        msgfmt -V | grep -q '0\.19'
    108101        if [ $? -ne 0 ]
    109102        then
    110             echo "ERROR - msgfmt failed on ${i}, not updating translations"
    111             # msgfmt leaves the class file there so the build would work the next time
    112             find src/WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
    113             RC=1
    114             break
     103            # slow way
     104            # convert to class files in jsp/WEB-INF/classes
     105            msgfmt --java --statistics -r $CLASS -l $LG -d ../jsp/WEB-INF/classes $i
     106            if [ $? -ne 0 ]
     107            then
     108                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     109                # msgfmt leaves the class file there so the build would work the next time
     110                find build -name messages_${LG}.class -exec rm -f {} \;
     111                RC=1
     112                break
     113            fi
     114        else
     115            # fast way
     116            # convert to java files in build/messages-src
     117            TD=build/messages-src-tmp
     118            TDX=$TD/net/i2p/i2ptunnel/web
     119            TD2=build/messages-src
     120            TDY=$TD2/net/i2p/i2ptunnel/web
     121            rm -rf $TD
     122            mkdir -p $TD $TDY
     123            msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     124            if [ $? -ne 0 ]
     125            then
     126                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     127                # msgfmt leaves the class file there so the build would work the next time
     128                find src/WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
     129                RC=1
     130                break
     131            fi
     132            mv $TDX/messages_$LG.java $TDY
     133            rm -rf $TD
    115134        fi
    116         mv $TDX/messages_$LG.java $TDY
    117         rm -rf $TD
    118135    fi
    119136done
  • apps/ministreaming/java/build.xml

    r7d11ec2f r5d93ca1  
    101101   
    102102    <target name="bundle" depends="compile" unless="no.bundle">
     103        <mkdir dir="build/messages-src" />
    103104        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
    104105            <env key="JAVA_HOME" value="${java.home}" />
  • apps/ministreaming/java/bundle-messages.sh

    r7d11ec2f r5d93ca1  
    9797        echo "Generating ${CLASS}_$LG ResourceBundle..."
    9898
    99         # convert to class files in build/obj
    100         TD=build/messages-src-tmp
    101         TDX=$TD/net/i2p/client/streaming
    102         TD2=build/messages-src
    103         TDY=$TD2/net/i2p/client/streaming
    104         rm -rf $TD
    105         mkdir -p $TD $TDY
    106         msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     99        msgfmt -V | grep -q '0\.19'
    107100        if [ $? -ne 0 ]
    108101        then
    109             echo "ERROR - msgfmt failed on ${i}, not updating translations"
    110             # msgfmt leaves the class file there so the build would work the next time
    111             find build/obj -name messages_${LG}.class -exec rm -f {} \;
    112             RC=1
    113             break
     102            # slow way
     103            # convert to class files in build/obj
     104            msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
     105            if [ $? -ne 0 ]
     106            then
     107                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     108                # msgfmt leaves the class file there so the build would work the next time
     109                find build -name messages_${LG}.class -exec rm -f {} \;
     110                RC=1
     111                break
     112            fi
     113        else
     114            # fast way
     115            # convert to java files in build/messages-src
     116            TD=build/messages-src-tmp
     117            TDX=$TD/net/i2p/client/streaming
     118            TD2=build/messages-src
     119            TDY=$TD2/net/i2p/client/streaming
     120            rm -rf $TD
     121            mkdir -p $TD $TDY
     122            msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     123            if [ $? -ne 0 ]
     124            then
     125                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     126                # msgfmt leaves the class file there so the build would work the next time
     127                find build/obj -name messages_${LG}.class -exec rm -f {} \;
     128                RC=1
     129                break
     130            fi
     131            mv $TDX/messages_$LG.java $TDY
     132            rm -rf $TD
    114133        fi
    115         mv $TDX/messages_$LG.java $TDY
    116         rm -rf $TD
    117134    fi
    118135done
  • apps/routerconsole/java/build.xml

    r7d11ec2f r5d93ca1  
    146146    <!-- this is tricky because the message classes go in the jar, not in the war -->
    147147    <target name="bundle" depends="jar1, precompilejsp" unless="no.bundle">
     148        <mkdir dir="build/messages-src" />
    148149        <!-- Update the messages_*.po files.
    149150             We need to supply the bat file for windows, and then change the fail property to true -->
     
    200201
    201202    <target name="bundle-news" unless="no.bundle">
     203        <mkdir dir="build/messages-news-src" />
    202204        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
    203205            <env key="JAVA_HOME" value="${java.home}" />
     
    218220
    219221    <target name="bundle-countries" unless="no.bundle">
     222        <mkdir dir="build/messages-countries-src" />
    220223        <exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
    221224            <env key="JAVA_HOME" value="${java.home}" />
  • apps/routerconsole/java/bundle-messages-countries.sh

    r7d11ec2f r5d93ca1  
    113113        echo "Generating ${CLASS}_$LG ResourceBundle..."
    114114
    115         # convert to class files in build/obj
    116         TD=build/messages-countries-src-tmp
    117         TDX=$TD/net/i2p/router/countries
    118         TD2=build/messages-countries-src
    119         TDY=$TD2/net/i2p/router/countries
    120         rm -rf $TD
    121         mkdir -p $TD $TDY
    122         msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     115        msgfmt -V | grep -q '0\.19'
    123116        if [ $? -ne 0 ]
    124117        then
    125             echo "ERROR - msgfmt failed on ${i}, not updating translations"
    126             # msgfmt leaves the class file there so the build would work the next time
    127             find build/obj -name messages_${LG}.class -exec rm -f {} \;
    128             RC=1
    129             break
     118            # slow way
     119            # convert to class files in build/obj
     120            msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
     121            if [ $? -ne 0 ]
     122            then
     123                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     124                # msgfmt leaves the class file there so the build would work the next time
     125                find build -name messages_${LG}.class -exec rm -f {} \;
     126                RC=1
     127                break
     128            fi
     129        else
     130            # fast way
     131            # convert to java files in build/messages-countries-src
     132            TD=build/messages-countries-src-tmp
     133            TDX=$TD/net/i2p/router/countries
     134            TD2=build/messages-countries-src
     135            TDY=$TD2/net/i2p/router/countries
     136            rm -rf $TD
     137            mkdir -p $TD $TDY
     138            msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     139            if [ $? -ne 0 ]
     140            then
     141                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     142                # msgfmt leaves the class file there so the build would work the next time
     143                find build/obj -name messages_${LG}.class -exec rm -f {} \;
     144                RC=1
     145                break
     146            fi
     147            mv $TDX/messages_$LG.java $TDY
     148            rm -rf $TD
    130149        fi
    131         mv $TDX/messages_$LG.java $TDY
    132         rm -rf $TD
    133150    fi
    134151done
  • apps/routerconsole/java/bundle-messages-news.sh

    r7d11ec2f r5d93ca1  
    9999        echo "Generating ${CLASS}_$LG ResourceBundle..."
    100100
    101         # convert to class files in build/obj
    102         TD=build/messages-news-src-tmp
    103         TDX=$TD/net/i2p/router/news
    104         TD2=build/messages-news-src
    105         TDY=$TD2/net/i2p/router/news
    106         rm -rf $TD
    107         mkdir -p $TD $TDY
    108         msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     101        msgfmt -V | grep -q '0\.19'
    109102        if [ $? -ne 0 ]
    110103        then
    111             echo "ERROR - msgfmt failed on ${i}, not updating translations"
    112             # msgfmt leaves the class file there so the build would work the next time
    113             find build/obj -name messages_${LG}.class -exec rm -f {} \;
    114             RC=1
    115             break
     104            # slow way
     105            # convert to class files in build/obj
     106            msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
     107            if [ $? -ne 0 ]
     108            then
     109                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     110                # msgfmt leaves the class file there so the build would work the next time
     111                find build -name messages_${LG}.class -exec rm -f {} \;
     112                RC=1
     113                break
     114            fi
     115        else
     116            # fast way
     117            # convert to java files in build/messages-news-src
     118            TD=build/messages-news-src-tmp
     119            TDX=$TD/net/i2p/router/news
     120            TD2=build/messages-news-src
     121            TDY=$TD2/net/i2p/router/news
     122            rm -rf $TD
     123            mkdir -p $TD $TDY
     124            msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     125            if [ $? -ne 0 ]
     126            then
     127                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     128                # msgfmt leaves the class file there so the build would work the next time
     129                find build/obj -name messages_${LG}.class -exec rm -f {} \;
     130                RC=1
     131                break
     132            fi
     133            mv $TDX/messages_$LG.java $TDY
     134            rm -rf $TD
    116135        fi
    117         mv $TDX/messages_$LG.java $TDY
    118         rm -rf $TD
    119136    fi
    120137done
  • apps/routerconsole/java/bundle-messages.sh

    r7d11ec2f r5d93ca1  
    126126        echo "Generating ${CLASS}_$LG ResourceBundle..."
    127127
    128         # convert to class files in build/obj
    129         TD=build/messages-src-tmp
    130         TDX=$TD/net/i2p/router/web
    131         TD2=build/messages-src
    132         TDY=$TD2/net/i2p/router/web
    133         rm -rf $TD
    134         mkdir -p $TD $TDY
    135         msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     128        msgfmt -V | grep -q '0\.19'
    136129        if [ $? -ne 0 ]
    137130        then
    138             echo "ERROR - msgfmt failed on ${i}, not updating translations"
    139             # msgfmt leaves the class file there so the build would work the next time
    140             find build/obj -name messages_${LG}.class -exec rm -f {} \;
    141             RC=1
    142             break
     131            # slow way
     132            # convert to class files in build/obj
     133            msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
     134            if [ $? -ne 0 ]
     135            then
     136                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     137                # msgfmt leaves the class file there so the build would work the next time
     138                find build -name messages_${LG}.class -exec rm -f {} \;
     139                RC=1
     140                break
     141            fi
     142        else
     143            # fast way
     144            # convert to java files in build/messages-src
     145            TD=build/messages-src-tmp
     146            TDX=$TD/net/i2p/router/web
     147            TD2=build/messages-src
     148            TDY=$TD2/net/i2p/router/web
     149            rm -rf $TD
     150            mkdir -p $TD $TDY
     151            msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     152            if [ $? -ne 0 ]
     153            then
     154                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     155                # msgfmt leaves the class file there so the build would work the next time
     156                find build/obj -name messages_${LG}.class -exec rm -f {} \;
     157                RC=1
     158                break
     159            fi
     160            mv $TDX/messages_$LG.java $TDY
     161            rm -rf $TD
    143162        fi
    144         mv $TDX/messages_$LG.java $TDY
    145         rm -rf $TD
    146163    fi
    147164done
  • apps/susidns/src/build.xml

    r7d11ec2f r5d93ca1  
    137137
    138138    <target name="bundle" depends="compile, precompilejsp" unless="no.bundle">
     139        <mkdir dir="build/messages-src" />
    139140        <!-- Update the messages_*.po files.
    140141             We need to supply the bat file for windows, and then change the fail property to true -->
  • apps/susidns/src/bundle-messages.sh

    r7d11ec2f r5d93ca1  
    9999        echo "Generating ${CLASS}_$LG ResourceBundle..."
    100100
    101         # convert to class files in build/obj
    102         TD=build/messages-src-tmp
    103         TDX=$TD/i2p/susi/dns
    104         TD2=build/messages-src
    105         TDY=$TD2/i2p/susi/dns
    106         rm -rf $TD
    107         mkdir -p $TD $TDY
    108         msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     101        msgfmt -V | grep -q '0\.19'
    109102        if [ $? -ne 0 ]
    110103        then
    111             echo "ERROR - msgfmt failed on ${i}, not updating translations"
    112             # msgfmt leaves the class file there so the build would work the next time
    113             find WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
    114             RC=1
    115             break
     104            # slow way
     105            # convert to class files in WEB-INF/classes
     106            msgfmt --java --statistics -r $CLASS -l $LG -d WEB-INF/classes $i
     107            if [ $? -ne 0 ]
     108            then
     109                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     110                # msgfmt leaves the class file there so the build would work the next time
     111                find src/WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
     112                RC=1
     113                break
     114            fi
     115        else
     116            # fast way
     117            # convert to java files in build/messages-src
     118            TD=build/messages-src-tmp
     119            TDX=$TD/i2p/susi/dns
     120            TD2=build/messages-src
     121            TDY=$TD2/i2p/susi/dns
     122            rm -rf $TD
     123            mkdir -p $TD $TDY
     124            msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     125            if [ $? -ne 0 ]
     126            then
     127                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     128                # msgfmt leaves the class file there so the build would work the next time
     129                find WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
     130                RC=1
     131                break
     132            fi
     133            mv $TDX/messages_$LG.java $TDY
     134            rm -rf $TD
    116135        fi
    117         mv $TDX/messages_$LG.java $TDY
    118         rm -rf $TD
    119136    fi
    120137done
  • apps/susimail/build.xml

    r7d11ec2f r5d93ca1  
    101101
    102102    <target name="bundle" depends="compile" unless="no.bundle">
     103        <mkdir dir="build/messages-src" />
    103104        <!-- Update the messages_*.po files.
    104105             We need to supply the bat file for windows, and then change the fail property to true -->
  • apps/susimail/bundle-messages.sh

    r7d11ec2f r5d93ca1  
    9797        echo "Generating ${CLASS}_$LG ResourceBundle..."
    9898
    99         # convert to class files in build/obj
    100         TD=build/messages-src-tmp
    101         TDX=$TD/i2p/susi/webmail
    102         TD2=build/messages-src
    103         TDY=$TD2/i2p/susi/webmail
    104         rm -rf $TD
    105         mkdir -p $TD $TDY
    106         msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     99        msgfmt -V | grep -q '0\.19'
    107100        if [ $? -ne 0 ]
    108101        then
    109             echo "ERROR - msgfmt failed on ${i}, not updating translations"
    110             # msgfmt leaves the class file there so the build would work the next time
    111             find src/WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
    112             RC=1
    113             break
     102            # slow way
     103            # convert to class files in src/WEB-INF/classes
     104            msgfmt --java --statistics -r $CLASS -l $LG -d src/WEB-INF/classes $i
     105            if [ $? -ne 0 ]
     106            then
     107                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     108                # msgfmt leaves the class file there so the build would work the next time
     109                find src/WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
     110                RC=1
     111                break
     112            fi
     113        else
     114            # fast way
     115            # convert to java files in build/messages-src
     116            TD=build/messages-src-tmp
     117            TDX=$TD/i2p/susi/webmail
     118            TD2=build/messages-src
     119            TDY=$TD2/i2p/susi/webmail
     120            rm -rf $TD
     121            mkdir -p $TD $TDY
     122            msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
     123            if [ $? -ne 0 ]
     124            then
     125                echo "ERROR - msgfmt failed on ${i}, not updating translations"
     126                # msgfmt leaves the class file there so the build would work the next time
     127                find src/WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
     128                RC=1
     129                break
     130            fi
     131            mv $TDX/messages_$LG.java $TDY
     132            rm -rf $TD
    114133        fi
    115         mv $TDX/messages_$LG.java $TDY
    116         rm -rf $TD
    117134    fi
    118135done
Note: See TracChangeset for help on using the changeset viewer.