diff --git a/build-package.sh b/build-package.sh index 290faa959..93b9eff59 100755 --- a/build-package.sh +++ b/build-package.sh @@ -259,7 +259,7 @@ termux_step_setup_variables() { : "${TERMUX_ANDROID_HOME:="/data/data/com.termux/files/home"}" : "${TERMUX_DEBUG:=""}" : "${TERMUX_PKG_API_LEVEL:="21"}" - : "${TERMUX_ANDROID_BUILD_TOOLS_VERSION:="27.0.3"}" + : "${TERMUX_ANDROID_BUILD_TOOLS_VERSION:="28.0.1"}" : "${TERMUX_NDK_VERSION:="17"}" if [ "x86_64" = "$TERMUX_ARCH" ] || [ "aarch64" = "$TERMUX_ARCH" ]; then @@ -284,7 +284,7 @@ termux_step_setup_variables() { # We do not put all of build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/ into PATH # to avoid stuff like arm-linux-androideabi-ld there to conflict with ones from # the standalone toolchain. - TERMUX_DX=$ANDROID_HOME/build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/dx + TERMUX_D8=$ANDROID_HOME/build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/d8 TERMUX_COMMON_CACHEDIR="$TERMUX_TOPDIR/_cache" TERMUX_DEBDIR="$TERMUX_SCRIPTDIR/debs" diff --git a/packages/apksigner/build.sh b/packages/apksigner/build.sh index 4f67ac338..e7bb7da27 100644 --- a/packages/apksigner/build.sh +++ b/packages/apksigner/build.sh @@ -1,6 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://github.com/fornwall/apksigner TERMUX_PKG_DESCRIPTION="APK signing tool" TERMUX_PKG_VERSION=0.7 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=340560c4f75af3501f037452bcf184fa48fd18bc877a4cce9a51a3fa047b4b38 TERMUX_PKG_SRCURL=https://github.com/fornwall/apksigner/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=yes @@ -9,11 +10,21 @@ TERMUX_PKG_PLATFORM_INDEPENDENT=true termux_step_make () { mkdir -p $TERMUX_PREFIX/share/{dex,man/man1} - ./gradlew - $TERMUX_DX --dex --output $TERMUX_PREFIX/share/dex/apksigner.dex ./build/libs/src-all.jar - echo '#!/bin/sh' > $TERMUX_PREFIX/bin/apksigner - echo "dalvikvm -cp $TERMUX_PREFIX/share/dex/apksigner.dex net.fornwall.apksigner.Main \$@" >> $TERMUX_PREFIX/bin/apksigner - chmod +x $TERMUX_PREFIX/bin/apksigner - cp apksigner.1 $TERMUX_PREFIX/share/man/man1/ + + ./gradlew + $TERMUX_D8 \ + --classpath $ANDROID_HOME/platforms/android-$TERMUX_PKG_API_LEVEL/android.jar \ + --release \ + --min-api $TERMUX_PKG_API_LEVEL \ + --output $TERMUX_PKG_TMPDIR \ + ./build/libs/src-all.jar + + cd $TERMUX_PKG_TMPDIR + jar cf apksigner.jar classes.dex + mv apksigner.jar $TERMUX_PREFIX/share/dex/apksigner.jar + + echo '#!/bin/sh' > $TERMUX_PREFIX/bin/apksigner + echo "dalvikvm -cp $TERMUX_PREFIX/share/dex/apksigner.jar net.fornwall.apksigner.Main \$@" >> $TERMUX_PREFIX/bin/apksigner + chmod +x $TERMUX_PREFIX/bin/apksigner } diff --git a/packages/dx/build.sh b/packages/dx/build.sh index b7af1b627..ad5ff8ce1 100755 --- a/packages/dx/build.sh +++ b/packages/dx/build.sh @@ -20,10 +20,16 @@ termux_step_make_install () { # Dex the rewritten jar file: mkdir -p $TERMUX_PREFIX/share/dex - $TERMUX_DX --dex \ - --output $TERMUX_PREFIX/share/dex/dx.dex \ + $TERMUX_D8 \ + --release \ + --min-api 21 \ + --output $TERMUX_PKG_TMPDIR \ $REWRITTEN_DX + cd $TERMUX_PKG_TMPDIR + jar cf dx.jar classes.dex + mv dx.jar $TERMUX_PREFIX/share/dex/dx.jar + install $TERMUX_PKG_BUILDER_DIR/dx $TERMUX_PREFIX/bin/dx perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dx } diff --git a/packages/dx/dx b/packages/dx/dx index d6d35a016..221159860 100755 --- a/packages/dx/dx +++ b/packages/dx/dx @@ -2,5 +2,5 @@ exec dalvikvm \ -Xmx256m \ - -cp @TERMUX_PREFIX@/share/dex/dx.dex \ + -cp @TERMUX_PREFIX@/share/dex/dx.jar \ dx.dx.command.Main $@ diff --git a/packages/ecj/build.sh b/packages/ecj/build.sh index a7b226525..9c2591e14 100755 --- a/packages/ecj/build.sh +++ b/packages/ecj/build.sh @@ -4,6 +4,7 @@ TERMUX_PKG_VERSION=4.6.2 _date=201611241400 TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=http://eclipse.mirror.wearetriple.com/eclipse/downloads/drops${TERMUX_PKG_VERSION:0:1}/R-${TERMUX_PKG_VERSION}-${_date}/ecj-${TERMUX_PKG_VERSION}.jar +# http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.7.2-201711300510/ecj-4.7.2.jar TERMUX_PKG_SHA256=9953dc2be829732e1b939106a71de018f660891220dbca559a5c7bff84883e51 TERMUX_PKG_PLATFORM_INDEPENDENT=true @@ -12,19 +13,37 @@ termux_step_extract_package () { } termux_step_make () { - RAW_JAR=$TERMUX_PKG_CACHEDIR/ecj-${TERMUX_PKG_VERSION}.jar - if [ ! -f $RAW_JAR ]; then - termux_download $TERMUX_PKG_SRCURL $RAW_JAR \ - $TERMUX_PKG_SHA256 - fi + local RAW_JAR=$TERMUX_PKG_CACHEDIR/ecj-${TERMUX_PKG_VERSION}.jar + termux_download $TERMUX_PKG_SRCURL \ + $RAW_JAR \ + $TERMUX_PKG_SHA256 - mkdir -p $TERMUX_PREFIX/share/{dex,java} - $TERMUX_DX \ - --dex \ - --output=$TERMUX_PREFIX/share/dex/ecj.jar \ + mkdir -p $TERMUX_PREFIX/share/{dex,java} + $TERMUX_D8 \ + --release \ + --min-api 21 \ + --output $TERMUX_PKG_TMPDIR \ $RAW_JAR + # Package classes.dex into jar: cd $TERMUX_PKG_TMPDIR + jar cf ecj.jar classes.dex + # Add needed properties file to jar file: + jar xf $RAW_JAR org/eclipse/jdt/internal/compiler/batch/messages.properties + jar uf ecj.jar org/eclipse/jdt/internal/compiler/batch/messages.properties + jar xf $RAW_JAR org/eclipse/jdt/internal/compiler/problem/messages.properties + jar uf ecj.jar org/eclipse/jdt/internal/compiler/problem/messages.properties + jar xf $RAW_JAR org/eclipse/jdt/internal/compiler/messages.properties + jar uf ecj.jar org/eclipse/jdt/internal/compiler/messages.properties + jar xf $RAW_JAR org/eclipse/jdt/internal/compiler/parser/readableNames.props + jar uf ecj.jar org/eclipse/jdt/internal/compiler/parser/readableNames.props + for i in `seq 1 24`; do + jar xf $RAW_JAR org/eclipse/jdt/internal/compiler/parser/parser$i.rsc + jar uf ecj.jar org/eclipse/jdt/internal/compiler/parser/parser$i.rsc + done + # Move into place: + mv ecj.jar $TERMUX_PREFIX/share/dex/ecj.jar + rm -rf android-jar mkdir android-jar cd android-jar diff --git a/scripts/generate-repology-metadata.sh b/scripts/generate-repology-metadata.sh index 6d265d45a..6dcf28252 100755 --- a/scripts/generate-repology-metadata.sh +++ b/scripts/generate-repology-metadata.sh @@ -35,7 +35,7 @@ check_package() { # path export TERMUX_ARCH=aarch64 export TERMUX_NDK_VERSION=17 -TERMUX_ANDROID_BUILD_TOOLS_VERSION=27.0.3 +TERMUX_ANDROID_BUILD_TOOLS_VERSION=28.0.1 echo '[' diff --git a/scripts/list-versions.sh b/scripts/list-versions.sh index bada14c78..e37d945dc 100755 --- a/scripts/list-versions.sh +++ b/scripts/list-versions.sh @@ -6,7 +6,7 @@ check_package() { # path TERMUX_PKG_REVISION=0 TERMUX_ARCH=aarch64 TERMUX_NDK_VERSION=17 - TERMUX_ANDROID_BUILD_TOOLS_VERSION=27.0.3 + TERMUX_ANDROID_BUILD_TOOLS_VERSION=28.0.1 . $path/build.sh if [ "$TERMUX_PKG_REVISION" != "0" ] || [ "$TERMUX_PKG_VERSION" != "${TERMUX_PKG_VERSION/-/}" ]; then TERMUX_PKG_VERSION+="-$TERMUX_PKG_REVISION" diff --git a/scripts/setup-android-sdk.sh b/scripts/setup-android-sdk.sh index 3138ea512..3cfb9331c 100755 --- a/scripts/setup-android-sdk.sh +++ b/scripts/setup-android-sdk.sh @@ -38,4 +38,4 @@ fi yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses # The android-21 platform is used in the ecj package: -$ANDROID_HOME/tools/bin/sdkmanager "build-tools;27.0.3" "platforms;android-27" "platforms;android-21" +$ANDROID_HOME/tools/bin/sdkmanager "build-tools;28.0.1" "platforms;android-27" "platforms;android-21"