Build: Add back the old, slow way to build bundles

for gettext < 0.19
This commit is contained in:
zzz
2016-05-07 12:57:49 +00:00
parent 7d11ec2f08
commit 5d93ca19f8
17 changed files with 331 additions and 151 deletions

View File

@ -16,6 +16,7 @@
<target name="init">
<mkdir dir="${build}"/>
<mkdir dir="${build}/messages-src"/>
<mkdir dir="${dist}"/>
</target>
@ -37,7 +38,7 @@
</javac>
</target>
<target name="bundle" unless="no.bundle">
<target name="bundle" unless="no.bundle" depends="init">
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
<env key="JAVA_HOME" value="${java.home}" />
<arg value="./bundle-messages.sh" />

View File

@ -105,7 +105,23 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in build
msgfmt --java --statistics -r $CLASS -l $LG -d build $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-src
TD=build/messages-src-tmp
TDX=$TD/net/i2p/desktopgui
TD2=build/messages-src
@ -124,6 +140,7 @@ do
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
rm -f $TMPFILE
exit $RC

View File

@ -137,6 +137,7 @@
</target>
<target name="bundle" depends="compile" unless="no.bundle">
<mkdir dir="build/messages-src" />
<!-- Update the messages_*.po files.
We need to supply the bat file for windows, and then change the fail property to true -->
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >

View File

@ -96,7 +96,23 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in build/obj
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-src
TD=build/messages-src-tmp
TDX=$TD/org/klomp/snark/web
TD2=build/messages-src
@ -115,6 +131,7 @@ do
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
rm -f $TMPFILE
exit $RC

View File

@ -123,6 +123,7 @@
<!-- servlet translations go in the war, not the jar -->
<target name="bundle" depends="compile, precompilejsp" unless="no.bundle">
<mkdir dir="build/messages-src" />
<!-- Update the messages_*.po files.
We need to supply the bat file for windows, and then change the fail property to true -->
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
@ -161,6 +162,7 @@
<!-- proxy error page translations go in the jar, not the war -->
<target name="bundle-proxy" unless="no.bundle">
<mkdir dir="build/messages-proxy-src" />
<!-- Update the messages_*.po files.
We need to supply the bat file for windows, and then change the fail property to true -->
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >

View File

@ -98,7 +98,23 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in build/obj
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-proxy-src
TD=build/messages-proxy-src-tmp
TDX=$TD/net/i2p/i2ptunnel/proxy
TD2=build/messages-proxy-src
@ -117,6 +133,7 @@ do
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
rm -f $TMPFILE
exit $RC

View File

@ -97,7 +97,23 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
# convert to class files in build/obj
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in jsp/WEB-INF/classes
msgfmt --java --statistics -r $CLASS -l $LG -d ../jsp/WEB-INF/classes $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-src
TD=build/messages-src-tmp
TDX=$TD/net/i2p/i2ptunnel/web
TD2=build/messages-src
@ -116,6 +132,7 @@ do
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
rm -f $TMPFILE
exit $RC

View File

@ -100,6 +100,7 @@
</target>
<target name="bundle" depends="compile" unless="no.bundle">
<mkdir dir="build/messages-src" />
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
<env key="JAVA_HOME" value="${java.home}" />
<arg value="./bundle-messages.sh" />

View File

@ -96,7 +96,23 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in build/obj
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-src
TD=build/messages-src-tmp
TDX=$TD/net/i2p/client/streaming
TD2=build/messages-src
@ -115,6 +131,7 @@ do
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
rm -f $TMPFILE
exit $RC

View File

@ -145,6 +145,7 @@
<!-- this is tricky because the message classes go in the jar, not in the war -->
<target name="bundle" depends="jar1, precompilejsp" unless="no.bundle">
<mkdir dir="build/messages-src" />
<!-- Update the messages_*.po files.
We need to supply the bat file for windows, and then change the fail property to true -->
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
@ -199,6 +200,7 @@
</target>
<target name="bundle-news" unless="no.bundle">
<mkdir dir="build/messages-news-src" />
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
<env key="JAVA_HOME" value="${java.home}" />
<arg value="./bundle-messages-news.sh" />
@ -217,6 +219,7 @@
</target>
<target name="bundle-countries" unless="no.bundle">
<mkdir dir="build/messages-countries-src" />
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
<env key="JAVA_HOME" value="${java.home}" />
<arg value="./bundle-messages-countries.sh" />

View File

@ -112,7 +112,23 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in build/obj
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-countries-src
TD=build/messages-countries-src-tmp
TDX=$TD/net/i2p/router/countries
TD2=build/messages-countries-src
@ -131,6 +147,7 @@ do
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
rm -f $TMPFILE
exit $RC

View File

@ -98,7 +98,23 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in build/obj
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-news-src
TD=build/messages-news-src-tmp
TDX=$TD/net/i2p/router/news
TD2=build/messages-news-src
@ -117,6 +133,7 @@ do
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
rm -f $TMPFILE
exit $RC

View File

@ -125,7 +125,23 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in build/obj
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-src
TD=build/messages-src-tmp
TDX=$TD/net/i2p/router/web
TD2=build/messages-src
@ -144,6 +160,7 @@ do
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
rm -f $TMPFILE
exit $RC

View File

@ -136,6 +136,7 @@
</target>
<target name="bundle" depends="compile, precompilejsp" unless="no.bundle">
<mkdir dir="build/messages-src" />
<!-- Update the messages_*.po files.
We need to supply the bat file for windows, and then change the fail property to true -->
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >

View File

@ -98,7 +98,23 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
# convert to class files in build/obj
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in WEB-INF/classes
msgfmt --java --statistics -r $CLASS -l $LG -d WEB-INF/classes $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find src/WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-src
TD=build/messages-src-tmp
TDX=$TD/i2p/susi/dns
TD2=build/messages-src
@ -117,6 +133,7 @@ do
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
rm -f $TMPFILE
exit $RC

View File

@ -100,6 +100,7 @@
</target>
<target name="bundle" depends="compile" unless="no.bundle">
<mkdir dir="build/messages-src" />
<!-- Update the messages_*.po files.
We need to supply the bat file for windows, and then change the fail property to true -->
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >

View File

@ -96,7 +96,23 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."
# convert to class files in build/obj
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
# slow way
# convert to class files in src/WEB-INF/classes
msgfmt --java --statistics -r $CLASS -l $LG -d src/WEB-INF/classes $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find src/WEB-INF/classes -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-src
TD=build/messages-src-tmp
TDX=$TD/i2p/susi/webmail
TD2=build/messages-src
@ -115,6 +131,7 @@ do
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
rm -f $TMPFILE
# todo: return failure