Bug 1352599 - Part 1: Add a Proguard toolchain task for Android builds. r=froydnj

MozReview-Commit-ID: 5lyHGLkzyg

--HG--
extra : rebase_source : dc75874944d9559a69f495cbca5f492bf464c9d4
This commit is contained in:
Nick Alexander 2017-10-02 13:27:51 -07:00
parent c1d5ef8386
commit f5c43c8ddc
4 changed files with 76 additions and 0 deletions

View File

@ -39,6 +39,8 @@ android-dependencies/opt:
custom-build-variant-cfg: api-16-gradle-dependencies
tooltool-downloads: internal
job-script: taskcluster/scripts/builder/build-android-dependencies.sh
toolchains:
- proguard-jar
optimization:
skip-unless-changed:
- "mobile/android/config/**"
@ -82,6 +84,8 @@ android-test/opt:
secrets: true
custom-build-variant-cfg: android-test
tooltool-downloads: internal
toolchains:
- proguard-jar
optimization:
skip-unless-changed:
- "mobile/android/base/**"
@ -140,6 +144,8 @@ android-lint/opt:
secrets: true
custom-build-variant-cfg: android-lint
tooltool-downloads: internal
toolchains:
- proguard-jar
optimization:
skip-unless-changed:
- "mobile/android/**/*.java"
@ -192,6 +198,8 @@ android-checkstyle/opt:
secrets: true
custom-build-variant-cfg: android-checkstyle
tooltool-downloads: internal
toolchains:
- proguard-jar
optimization:
skip-unless-changed:
- "mobile/android/**/checkstyle.xml"
@ -246,6 +254,8 @@ android-findbugs/opt:
secrets: true
custom-build-variant-cfg: android-findbugs
tooltool-downloads: internal
toolchains:
- proguard-jar
optimization:
skip-unless-changed:
- "mobile/android/**/*.java"

View File

@ -26,6 +26,7 @@ android-api-16/debug:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-x86/opt:
description: "Android 4.2 x86 Opt"
@ -55,6 +56,7 @@ android-x86/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-x86-nightly/opt:
description: "Android 4.2 x86 Nightly"
@ -88,6 +90,7 @@ android-x86-nightly/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-api-16/opt:
description: "Android 4.0 api-16+ Opt"
@ -117,6 +120,7 @@ android-api-16/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-api-16-nightly/opt:
description: "Android 4.0 api-16+ Nightly"
@ -150,6 +154,7 @@ android-api-16-nightly/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-x86-old-id/opt:
description: "Android 4.2 x86 Opt OldId"
@ -180,6 +185,7 @@ android-x86-old-id/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-x86-old-id-nightly/opt:
description: "Android 4.2 x86 OldId Nightly"
@ -214,6 +220,7 @@ android-x86-old-id-nightly/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-api-16-old-id/opt:
description: "Android 4.0 api-16+ Opt OldId"
@ -244,6 +251,7 @@ android-api-16-old-id/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-api-16-old-id-nightly/opt:
description: "Android 4.0 api-16+ OldId Nightly"
@ -278,6 +286,7 @@ android-api-16-old-id-nightly/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-api-16-gradle/opt:
description: "Android 4.0 api-16+ (Gradle) Opt"
@ -320,6 +329,7 @@ android-api-16-gradle/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-aarch64/opt:
description: "Android 5.0 AArch64 Opt"
@ -349,6 +359,7 @@ android-aarch64/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar
android-aarch64-nightly/opt:
description: "Android 5.0 AArch64 Nightly"
@ -382,3 +393,4 @@ android-aarch64-nightly/opt:
toolchains:
- linux64-rust-android
- linux64-sccache
- proguard-jar

View File

@ -185,6 +185,23 @@ linux64-libdmg:
script: build-libdmg-hfsplus.sh
toolchain-artifact: public/build/dmg.tar.xz
linux64-proguard-jar-repack:
description: "proguard.jar repack toolchain build"
treeherder:
kind: build
platform: toolchains/opt
symbol: TL(proguard-jar)
tier: 1
worker-type: aws-provisioner-v1/gecko-{level}-b-linux
worker:
docker-image: {in-tree: desktop-build}
max-run-time: 36000
run:
using: toolchain-script
script: repack-proguard-jar.sh
toolchain-artifact: public/build/proguard-jar.tar.xz
toolchain-alias: proguard-jar
linux64-rust-1.19:
description: "rust repack"
treeherder:

View File

@ -0,0 +1,37 @@
#!/bin/bash
set -x -e -v
# This script is for repacking Proguard to get the `proguard.jar`
# needed to shrink Android packages.
WORKSPACE=$HOME/workspace
STAGE=$WORKSPACE/proguard
UPLOAD_DIR=$HOME/artifacts
VERSION=5.3.3
URL=https://newcontinuum.dl.sourceforge.net/project/proguard/proguard/5.3/proguard$VERSION.tar.gz
ARCHIVE=proguard$VERSION.tar.gz
DIR=proguard$VERSION
SHA256SUM=95bf9580107f00d0e26f01026dcfe9e7a772e5449488b03ba832836c3760b3af
mkdir -p $UPLOAD_DIR $STAGE
cd $WORKSPACE
wget $URL
echo "$SHA256SUM $ARCHIVE" | sha256sum -c -
# Just the file we need.
tar zxvf $ARCHIVE '*/proguard.jar'
# The archive is to satisfy source distribution requirements.
mv $ARCHIVE $UPLOAD_DIR
# This leaves us with $STAGE/lib/proguard.jar.
mv $DIR/lib $STAGE
cat >$STAGE/README<<EOF
proguard.jar extracted from ${URL}.
That archive, which includes source, is available as a taskcluster artifact:
https://queue.taskcluster.net/v1/task/$TASK_ID/artifacts/public/$ARCHIVE
EOF
tar cf - -C $WORKSPACE `basename $STAGE` | xz > $UPLOAD_DIR/proguard-jar.tar.xz