Build: Compile resource bundles from ant, not msgfmt,

speeding up builds with translations by 20x
This commit is contained in:
zzz
2016-05-01 20:19:56 +00:00
parent 2fe1f97ee0
commit 33629d0744
17 changed files with 168 additions and 41 deletions

View File

@@ -136,6 +136,11 @@
<exec executable="sh" osfamily="windows" failifexecutionfails="false" >
<arg value="./bundle-messages.sh" />
</exec>
<javac source="${javac.version}" target="${javac.version}"
includeAntRuntime="false"
srcdir="build/messages-src" destdir="../jsp/WEB-INF/classes">
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>
<target name="poupdate" depends="compile, precompilejsp">
@@ -169,6 +174,11 @@
<exec executable="sh" osfamily="windows" failifexecutionfails="false" >
<arg value="./bundle-messages-proxy.sh" />
</exec>
<javac source="${javac.version}" target="${javac.version}"
includeAntRuntime="false"
srcdir="build/messages-proxy-src" destdir="build/obj">
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>
<target name="extractProxyTags">

View File

@@ -99,7 +99,13 @@ do
echo "Generating ${CLASS}_$LG ResourceBundle..."
# convert to class files in build/obj
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
TD=build/messages-proxy-src-tmp
TDX=$TD/net/i2p/i2ptunnel/proxy
TD2=build/messages-proxy-src
TDY=$TD2/net/i2p/i2ptunnel/proxy
rm -rf $TD
mkdir -p $TD $TDY
msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
@@ -108,6 +114,8 @@ do
RC=1
break
fi
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
done
rm -f $TMPFILE

View File

@@ -98,7 +98,13 @@ do
echo "Generating ${CLASS}_$LG ResourceBundle..."
# convert to class files in build/obj
msgfmt --java --statistics -r $CLASS -l $LG -d ../jsp/WEB-INF/classes $i
TD=build/messages-src-tmp
TDX=$TD/net/i2p/i2ptunnel/web
TD2=build/messages-src
TDY=$TD2/net/i2p/i2ptunnel/web
rm -rf $TD
mkdir -p $TD $TDY
msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
@@ -107,6 +113,8 @@ do
RC=1
break
fi
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
done
rm -f $TMPFILE