| 1 | TERMUX_PKG_HOMEPAGE=http://developer.android.com/tools/help/index.html |
| 2 | TERMUX_PKG_DESCRIPTION="Command which takes in class files and reformulates them for usage on Android" |
| 3 | TERMUX_PKG_VERSION=$TERMUX_ANDROID_BUILD_TOOLS_VERSION |
| 4 | TERMUX_PKG_PLATFORM_INDEPENDENT=true |
| 5 | |
| 6 | termux_step_make_install () { |
| 7 | # As of build tools 24 the dx tool is implemented using java 8, but |
| 8 | # as dx itself does not support java 8 (class file format 52) |
| 9 | # we go the .class -> jill -> jack route. |
| 10 | local DX_JACK=$TERMUX_PKG_TMPDIR/dx.jack |
| 11 | java -jar $TERMUX_JILL \ |
| 12 | --output=$DX_JACK \ |
| 13 | $ANDROID_HOME/build-tools/${TERMUX_PKG_VERSION}/lib/dx.jar |
| 14 | java -jar $TERMUX_JACK \ |
| 15 | --output-dex $TERMUX_PKG_TMPDIR \ |
| 16 | --import $DX_JACK |
| 17 | |
| 18 | mkdir -p $TERMUX_PREFIX/share/dex |
| 19 | mv $TERMUX_PKG_TMPDIR/classes.dex $TERMUX_PREFIX/share/dex/dx.dex |
| 20 | |
| 21 | install $TERMUX_PKG_BUILDER_DIR/dx $TERMUX_PREFIX/bin/dx |
| 22 | perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dx |
| 23 | } |