Update SDK build tools to 24.0.1
[termux-packages] / packages / dx / build.sh
CommitLineData
59f0d218
FF
1TERMUX_PKG_HOMEPAGE=http://developer.android.com/tools/help/index.html
2TERMUX_PKG_DESCRIPTION="Command which takes in class files and reformulates them for usage on Android"
3TERMUX_PKG_VERSION=$TERMUX_ANDROID_BUILD_TOOLS_VERSION
4TERMUX_PKG_PLATFORM_INDEPENDENT=true
5
6termux_step_make_install () {
382cfb78
FF
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
59f0d218 18 mkdir -p $TERMUX_PREFIX/share/dex
382cfb78 19 mv $TERMUX_PKG_TMPDIR/classes.dex $TERMUX_PREFIX/share/dex/dx.dex
59f0d218
FF
20
21 install $TERMUX_PKG_BUILDER_DIR/dx $TERMUX_PREFIX/bin/dx
6501186f 22 perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dx
59f0d218 23}