From eb4ba4c50e5a6d883719f7a743b13a246cd466e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Fri, 31 May 2019 14:39:53 -0400 Subject: [PATCH] drop x86 and x86_64 for non-e2e or dev builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- Makefile | 13 ++++++++----- android/app/build.gradle | 7 ++----- android/gradle.properties | 3 +++ ci/android.groovy | 18 ++++++++++++------ 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 4833b44d9f5..123f2ed24aa 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,8 @@ HELP_FUN = \ } HOST_OS := $(shell uname | tr '[:upper:]' '[:lower:]') +# Defines which variables will be kept for Nix pure shell, use semicolon as divider +export NIX_KEEP ?= BUILD_ENV export NIX_CONF_DIR = $(PWD)/nix export REACT_SERVER_PORT ?= 5001 # any value different from default 5000 will work; this has to be specified for both the Node.JS server process and the Qt process @@ -101,21 +103,22 @@ prod-build: lein prod-build prod-build-android: export TARGET_OS ?= android +prod-build-android: export BUILD_ENV ?= prod prod-build-android: - BUILD_ENV=prod lein prod-build-android && \ + lein prod-build-android && \ node prepare-modules.js prod-build-ios: export TARGET_OS ?= ios -prod-build-ios: export BUILD_ENV = prod +prod-build-ios: export BUILD_ENV ?= prod prod-build-ios: - BUILD_ENV=prod lein prod-build-ios && \ + lein prod-build-ios && \ node prepare-modules.js prod-build-desktop: export TARGET_OS ?= $(HOST_OS) -prod-build-desktop: export BUILD_ENV = prod +prod-build-desktop: export BUILD_ENV ?= prod prod-build-desktop: git clean -qdxf -f ./index.desktop.js desktop/ && \ - BUILD_ENV=prod lein prod-build-desktop && \ + lein prod-build-desktop && \ node prepare-modules.js #-------------- diff --git a/android/app/build.gradle b/android/app/build.gradle index d0757b0f1ad..08ad9824a0b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -149,8 +149,6 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } - - defaultConfig { applicationId "im.status.ethereum" minSdkVersion 23 @@ -159,7 +157,7 @@ android { versionCode getVersionCode() versionName getVersionName() ndk { - abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86-64" + abiFilters getEnvOrConfig('NDK_ABI_FILTERS').split(';') } } /** @@ -179,7 +177,6 @@ android { exclude 'META-INF/rxjava.properties' exclude '/lib/mips64/**' exclude '/lib/arm64-v8a/**' - exclude '/lib/x86_64/**' /** Fix for: Execution failed for task ':app:transformNativeLibsWithStripDebugSymbolForDebug'. * with recent version of ndk (17.0.4754217) */ @@ -204,7 +201,7 @@ android { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK - include "armeabi-v7a", "x86" + include "armeabi-v7a", "arm64-v8a", "x86" } } buildTypes { diff --git a/android/gradle.properties b/android/gradle.properties index 807f12ecec7..58b2c9e43c5 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -24,4 +24,7 @@ STATUS_RELEASE_STORE_PASSWORD=password STATUS_RELEASE_KEY_ALIAS=status STATUS_RELEASE_KEY_PASSWORD=password +# platforms for which to build the Android bundle +NDK_ABI_FILTERS=armeabi-v7a;arm64-v8a;x86 + org.gradle.jvmargs=-Xmx8704M diff --git a/ci/android.groovy b/ci/android.groovy index 04509464954..854f8257e8d 100644 --- a/ci/android.groovy +++ b/ci/android.groovy @@ -6,13 +6,19 @@ def bundle() { /* Disable Gradle Daemon https://stackoverflow.com/questions/38710327/jenkins-builds-fail-using-the-gradle-daemon */ def gradleOpt = "-PbuildUrl='${currentBuild.absoluteUrl}' -Dorg.gradle.daemon=false " def target = "release" + /* we don't need x86 for any builds except e2e */ + env.NDK_ABI_FILTERS="armeabi-v7a;arm64-v8a" - if (params.BUILD_TYPE == 'pr') { - /* PR builds shouldn't replace normal releases */ - target = 'pr' - } else if (btype == 'release') { - gradleOpt += "-PreleaseVersion='${utils.getVersion()}'" + switch (btype) { + case 'pr': /* PR builds shouldn't replace normal releases */ + target = 'pr'; break; + case 'e2e': + target = 'pr'; + env.NDK_ABI_FILTERS="x86"; break + case 'release': + gradleOpt += "-PreleaseVersion='${utils.getVersion('mobile_files')}'" } + dir('android') { withCredentials([ string( @@ -28,7 +34,7 @@ def bundle() { nix.shell( "./gradlew assemble${target.capitalize()} ${gradleOpt}", keep: [ - 'REALM_DISABLE_ANALYTICS', + 'REALM_DISABLE_ANALYTICS', 'NDK_ABI_FILTERS', 'STATUS_RELEASE_STORE_FILE', 'STATUS_RELEASE_STORE_PASSWORD', 'STATUS_RELEASE_KEY_ALIAS', 'STATUS_RELEASE_KEY_PASSWORD' ]