From fc8fd3af8055c4e0958fc480968dd0e93b052e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 12 Mar 2015 10:52:48 +0100 Subject: [PATCH 1/2] build the BUILDTYPE with gradle as well --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9ec88ec6c..e1382a7e1 100644 --- a/Makefile +++ b/Makefile @@ -173,11 +173,11 @@ android-lib: android-lib-$(ANDROID_ABI) # Builds the selected/default Android library android: android-lib-$(ANDROID_ABI) - cd android/java && ./gradlew --parallel-threads=$(JOBS) assembleRelease + cd android/java && ./gradlew --parallel-threads=$(JOBS) assemble$(BUILDTYPE) # Builds all android architectures. android-all: $(ANDROID_ABIS) - cd android/java && ./gradlew --parallel-threads=$(JOBS) assembleRelease + cd android/java && ./gradlew --parallel-threads=$(JOBS) assemble$(BUILDTYPE) # Full build of GL Core for each architecture, build the Android Library, publish to Maven Central android-deploy: $(ANDROID_ABIS) From d63281697056ad22a70a7c663bf09e55cbb5a4e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 12 Mar 2015 10:53:00 +0100 Subject: [PATCH 2/2] only upload the artifact we're building fixes #982 --- android/scripts/common.sh | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/android/scripts/common.sh b/android/scripts/common.sh index 48b441ba5..0d610909b 100755 --- a/android/scripts/common.sh +++ b/android/scripts/common.sh @@ -4,16 +4,37 @@ set -e set -o pipefail NAME=$1 -export JOBS=`nproc` + +case `uname -s` in + 'Darwin') export JOBS=`sysctl -n hw.ncpu` ;; + 'Linux') export JOBS=`nproc` ;; + *) export JOBS=1 ;; +esac + export CC=clang CXX=clang++ export MASON_PLATFORM=android -mkdir ./android/java/MapboxGLAndroidSDKTestApp/src/main/res/raw/ +mkdir -p ./android/java/MapboxGLAndroidSDKTestApp/src/main/res/raw/ echo "${MAPBOX_ACCESS_TOKEN}" >> ./android/java/MapboxGLAndroidSDKTestApp/src/main/res/raw/token.txt make android -j$JOBS BUILDTYPE=$BUILDTYPE JOBS=$JOBS -aws s3 cp ./build/android-${ANDROID_ABI}/${BUILDTYPE}/lib.target/libmapbox-gl.so s3://mapbox/mapbox-gl-native/android/build/${NAME}/libmapbox-gl.so -aws s3 cp ./android/java/MapboxGLAndroidSDKTestApp/build/outputs/apk/MapboxGLAndroidSDKTestApp-debug.apk s3://mapbox/mapbox-gl-native/android/build/${NAME}/MapboxGLAndroidSDKTestApp-debug.apk -aws s3 cp ./android/java/MapboxGLAndroidSDKTestApp/build/outputs/apk/MapboxGLAndroidSDKTestApp-release-unsigned.apk s3://mapbox/mapbox-gl-native/android/build/${NAME}/MapboxGLAndroidSDKTestApp-release-unsigned.apk +S3_PREFIX=s3://mapbox/mapbox-gl-native/android/build/${NAME} +APK_OUTPUTS=./android/java/MapboxGLAndroidSDKTestApp/build/outputs/apk + +# Upload the shared object. +aws s3 cp \ + ./build/android-${ANDROID_ABI}/${BUILDTYPE}/lib.target/libmapbox-gl.so \ + ${S3_PREFIX}/libmapbox-gl.so + +# Upload either the debug or the release build +if [ ${BUILDTYPE} == "Debug" ] ; then + aws s3 cp \ + ${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-debug.apk \ + ${S3_PREFIX}/MapboxGLAndroidSDKTestApp-debug.apk +elif [ ${BUILDTYPE} == "Release" ] ; then + aws s3 cp \ + ${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-release-unsigned.apk \ + ${S3_PREFIX}/MapboxGLAndroidSDKTestApp-release-unsigned.apk +fi