jack: Clean up build

This commit is contained in:
Fredrik Fornwall 2016-07-26 08:55:25 -04:00
parent 382cfb780c
commit 2cbdeb5e71
2 changed files with 14 additions and 13 deletions

View File

@ -7,15 +7,13 @@ TERMUX_PKG_VERSION=$TERMUX_ANDROID_BUILD_TOOLS_VERSION
TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_PLATFORM_INDEPENDENT=true
termux_step_make () { termux_step_make () {
JACK_JAR=$ANDROID_HOME/build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/jack.jar
JILL_JAR=$ANDROID_HOME/build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/jill.jar
# Create $USR/share/dex for dex files, and $USR/share/jack for .jack library files produced by jill: # Create $USR/share/dex for dex files, and $USR/share/jack for .jack library files produced by jill:
mkdir -p $TERMUX_PREFIX/share/{dex,jack} mkdir -p $TERMUX_PREFIX/share/{dex,jack}
$TERMUX_DX \ $TERMUX_DX \
-JXmx4096M --num-threads=4 \
--dex \ --dex \
--output=$TERMUX_PREFIX/share/dex/jack.jar \ --output=$TERMUX_PREFIX/share/dex/jack.jar \
$JACK_JAR $TERMUX_JACK
cd $TERMUX_PKG_TMPDIR cd $TERMUX_PKG_TMPDIR
rm -rf android-jar rm -rf android-jar
@ -25,11 +23,11 @@ termux_step_make () {
# We need the android.jar clases in jill format (.jack extension) for jack to compile against. # We need the android.jar clases in jill format (.jack extension) for jack to compile against.
cp $ANDROID_HOME/platforms/android-23/android.jar . cp $ANDROID_HOME/platforms/android-23/android.jar .
# Remove resources not needed for compilation to reduce size: # Remove resources not needed for compilation to reduce size:
unzip android.jar unzip -q android.jar
rm -Rf android.jar resources.arsc res assets rm -Rf android.jar resources.arsc res assets
zip -r android.jar . zip -r -q android.jar .
java -jar $JILL_JAR $TERMUX_PKG_TMPDIR/android-jar/android.jar --output $TERMUX_PREFIX/share/jack/android.jack java -jar $TERMUX_JILL $TERMUX_PKG_TMPDIR/android-jar/android.jar --output $TERMUX_PREFIX/share/jack/android.jack
mkdir -p $TERMUX_PREFIX/bin mkdir -p $TERMUX_PREFIX/bin
install $TERMUX_PKG_BUILDER_DIR/jack.sh $TERMUX_PREFIX/bin/jack install $TERMUX_PKG_BUILDER_DIR/jack.sh $TERMUX_PREFIX/bin/jack
perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/jack perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/jack

View File

@ -2,9 +2,12 @@
exec dalvikvm -Xmx256m \ exec dalvikvm -Xmx256m \
-Djava.io.tmpdir=@TERMUX_PREFIX@/tmp \ -Djava.io.tmpdir=@TERMUX_PREFIX@/tmp \
-cp @TERMUX_PREFIX@/share/dex/jack.jar com.android.jack.Main \ -cp @TERMUX_PREFIX@/share/dex/jack.jar \
com.android.jack.Main \
-cp @TERMUX_PREFIX@/share/jack/android.jack \ -cp @TERMUX_PREFIX@/share/jack/android.jack \
-D jack.library.digest.algo=MD5 -D sched.vfs.case-insensitive.algo=MD5 \ -D jack.library.digest.algo=MD5 \
-D jack.source.digest.algo=MD5 \
-D sched.vfs.case-insensitive.algo=MD5 \
-D jack.annotation-processor=off \ -D jack.annotation-processor=off \
--output-dex=`pwd` \ --output-dex=`pwd` \
$@ $@