Changeset 5d93ca1 for apps/ministreaming


Ignore:
Timestamp:
May 7, 2016 12:57:49 PM (5 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/ministreaming/java
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.