Vagrantfile tweaks
[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
56e3efbc 4TERMUX_PKG_REVISION=1
59f0d218
FF
5TERMUX_PKG_PLATFORM_INDEPENDENT=true
6
7termux_step_make_install () {
56e3efbc
FF
8 # Rewrite packages to avoid using com.android.* classes which may clash with
9 # classes in the Android runtime on devices (see #1801):
10 local JARJAR=$TERMUX_PKG_CACHEDIR/jarjar.jar
11 local RULEFILE=$TERMUX_PKG_TMPDIR/jarjar-rule.txt
12 local REWRITTEN_DX=$TERMUX_PKG_TMPDIR/dx-rewritten.jar
13 termux_download \
14 http://central.maven.org/maven2/com/googlecode/jarjar/jarjar/1.3/jarjar-1.3.jar \
15 $JARJAR \
16 4225c8ee1bf3079c4b07c76fe03c3e28809a22204db6249c9417efa4f804b3a7
17 echo 'rule com.android.** dx.@1' > $RULEFILE
18 java -jar $JARJAR process $RULEFILE \
19 $ANDROID_HOME/build-tools/${TERMUX_PKG_VERSION}/lib/dx.jar \
20 $REWRITTEN_DX
21
22 # Dex the rewritten jar file:
18fbaa06 23 mkdir -p $TERMUX_PREFIX/share/dex
dab4f215
FF
24 $TERMUX_DX --dex \
25 --output $TERMUX_PREFIX/share/dex/dx.dex \
56e3efbc 26 $REWRITTEN_DX
59f0d218
FF
27
28 install $TERMUX_PKG_BUILDER_DIR/dx $TERMUX_PREFIX/bin/dx
6501186f 29 perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dx
59f0d218 30}