From 78d5a99441fea8b999c9da8a35eb614e6e3c8da7 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 19 Aug 2020 18:09:37 +0100 Subject: [PATCH] Gradle fix (#978) --- .gitlab-ci.yml | 30 ++++++++++++++++++------------ app/build.gradle | 11 ++++------- yarn.lock | 4 ++++ 3 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 yarn.lock diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 310c930a..3137c361 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,9 +8,12 @@ build apk: stage: build image: lbry/android-base:platform-28 before_script: - - apt-get -y update && apt-get -y install build-essential ca-certificates curl git gpg-agent openjdk-8-jdk software-properties-common wget zipalign + - echo "$PGP_PRIVATE_KEY" | gpg --batch --import + - echo "deb https://dl.bintray.com/sobolevn/deb git-secret main" | tee -a /etc/apt/sources.list + - wget -O - https://api.bintray.com/users/sobolevn/keys/gpg/public.key | apt-key add - + - apt-get -y update && apt-get -y install build-essential ca-certificates curl git gpg-agent openjdk-8-jdk software-properties-common wget zipalign git-secret + - git secret reveal - chmod u+x $CI_PROJECT_DIR/gradlew - - export ANDROID_SDK_ROOT=~/.buildozer/android/platform/android-sdk-23 - export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -p $CI_PROJECT_DIR -q printVersionName --console=plain | tail -1) artifacts: paths: @@ -19,16 +22,11 @@ build apk: expire_in: 1 week script: - export PATH=/usr/bin:$PATH - - echo "$PGP_PRIVATE_KEY" | gpg --batch --import - - echo "deb https://dl.bintray.com/sobolevn/deb git-secret main" | tee -a /etc/apt/sources.list - - wget -O - https://api.bintray.com/users/sobolevn/keys/gpg/public.key | apt-key add - - - apt-get -y update && apt-get -y install git-secret - - git secret reveal - - yarn + - export ANDROID_SDK_ROOT=~/.buildozer/android/platform/android-sdk-23 - chmod u+x ./release.sh - ./release.sh - - cp bin/browser-$BUILD_VERSION-release__arm.apk $CI_PROJECT_DIR - - cp bin/browser-$BUILD_VERSION-release__arm64.apk $CI_PROJECT_DIR + - cp bin/browser-$BUILD_VERSION-release__arm.apk /dev/null + - cp bin/browser-$BUILD_VERSION-release__arm64.apk /dev/null deploy build.lbry.io: image: python:stretch @@ -36,9 +34,13 @@ deploy build.lbry.io: dependencies: - build apk before_script: - - apt-get -y update && apt-get -y install openjdk-8-jdk + - echo "$PGP_PRIVATE_KEY" | gpg --batch --import + - echo "deb https://dl.bintray.com/sobolevn/deb git-secret main" | tee -a /etc/apt/sources.list + - wget -O - https://api.bintray.com/users/sobolevn/keys/gpg/public.key | apt-key add - + - apt-get -y update && apt-get -y install openjdk-8-jdk git-secret - pip install awscli - chmod u+x $CI_PROJECT_DIR/gradlew + - git secret reveal - export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -p $CI_PROJECT_DIR -q printVersionName --console=plain | tail -1) - export BUILD_APK_FILENAME__32=browser-$BUILD_VERSION-release__arm.apk - export BUILD_APK_FILENAME__64=browser-$BUILD_VERSION-release__arm64.apk @@ -55,8 +57,12 @@ release apk: dependencies: - build apk before_script: - - apt-get -y update && apt-get -y install openjdk-8-jdk + - echo "$PGP_PRIVATE_KEY" | gpg --batch --import + - echo "deb https://dl.bintray.com/sobolevn/deb git-secret main" | tee -a /etc/apt/sources.list + - wget -O - https://api.bintray.com/users/sobolevn/keys/gpg/public.key | apt-key add - + - apt-get -y update && apt-get -y install openjdk-8-jdk git-secret - pip install awscli githubrelease + - git secret reveal - chmod u+x $CI_PROJECT_DIR/gradlew - export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -p $CI_PROJECT_DIR -q printVersionName --console=plain | tail -1) - export BUILD_APK_FILENAME__32=browser-$BUILD_VERSION-release__arm.apk diff --git a/app/build.gradle b/app/build.gradle index 7a0542a4..a914f406 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,12 +1,5 @@ import com.google.gms.googleservices.GoogleServicesPlugin -Properties twitterProps = new Properties() -try { - twitterProps.load(project.file('twitter.properties').newDataInputStream()) -} catch (Exception ex) { - throw new GradleException("Missing twitter.properties.") -} - apply plugin: 'com.android.application' android { @@ -50,10 +43,14 @@ android { buildTypes { debug { + Properties twitterProps = new Properties() + twitterProps.load(project.file('twitter.properties').newDataInputStream()) resValue "string", "TWITTER_CONSUMER_KEY", "\"${twitterProps.getProperty("twitterConsumerKey")}\"" resValue "string", "TWITTER_CONSUMER_SECRET", "\"${twitterProps.getProperty("twitterConsumerSecret")}\"" } release { + Properties twitterProps = new Properties() + twitterProps.load(project.file('twitter.properties').newDataInputStream()) resValue "string", "TWITTER_CONSUMER_KEY", "\"${twitterProps.getProperty("twitterConsumerKey")}\"" resValue "string", "TWITTER_CONSUMER_SECRET", "\"${twitterProps.getProperty("twitterConsumerSecret")}\"" minifyEnabled false diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..fb57ccd1 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + +