From 49c3d78764d2fdbc0e58bce62a2ea8439e89d7e7 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Mon, 5 Feb 2018 14:07:39 +0100 Subject: 8832 custom build script that builds first :ics-openvpn:main and afterwards :app --- .gitlab-ci.yml | 12 ++++++------ app/build.gradle | 28 +++++----------------------- app/src/main/cpp | 1 + build.sh | 5 +++++ cleanProject.sh | 10 ++++++++++ ics-openvpn | 2 +- settings.gradle | 4 ++-- 7 files changed, 30 insertions(+), 32 deletions(-) create mode 120000 app/src/main/cpp create mode 100755 build.sh create mode 100755 cleanProject.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b3b7de0a..ff5f559c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -97,9 +97,8 @@ build: image: "0xacab.org:4567/leap/bitmask_android/android-ndk:latest" stage: build script: - - git submodule sync --recursive - - git submodule update --init --recursive - - ./gradlew clean assembleDebug + - ./cleanProject.sh + - ./build.sh artifacts: paths: - app/build/outputs/ @@ -108,9 +107,10 @@ build_release: image: "0xacab.org:4567/leap/bitmask_android/android-ndk:latest" stage: build script: - - git submodule sync --recursive - - git submodule update --init --recursive - - ./gradlew clean + - ./cleanProject.sh + - cd ./ics-openvpn + - ./gradlew clean main:externalNativeBuildCleanNoovpn3Release main:externalNativeBuildNoovpn3Release + - cd .. - ./gradlew assembleProductionRelease - ./gradlew assembleProductionBeta artifacts: diff --git a/app/build.gradle b/app/build.gradle index 8732c4df..c2a42d3d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,15 +35,6 @@ android { insecure { dimension "implementation" } -/* - noovpn3 { - //dimension "implementation" - } - - normal { - //dimension "implementation" - } -*/ } buildTypes { @@ -56,6 +47,7 @@ android { initWith release applicationIdSuffix ".beta" resValue "string", "app_name", "Bitmask Beta" + matchingFallbacks = ['release'] } debug { testCoverageEnabled = true @@ -68,8 +60,8 @@ android { sourceSets { main { - assets.srcDirs = ['assets', 'ovpnlibs/assets'] - jniLibs.srcDirs = ['ovpnlibs/jniLibs'] + assets.srcDirs = ['assets', 'ovpnlibs/assets', '../ics-openvpn/main/build/ovpnassets'] + jniLibs.srcDirs = ['../ics-openvpn/main/build/intermediates/cmake/noovpn3/release/obj'] jni.srcDirs = [] //disable automatic ndk-build } debug { @@ -292,11 +284,9 @@ task mergeUntranslatable( type: Copy ) { delete ics_openvpn_untranslatable } -task copyIcsOpenVPNFiles( type: Exec ) { +task copyIcsOpenVPNFiles( type: Copy ) { println "copyIcsOpenVPNFiles" - def currentPath = System.getProperty("user.dir") - commandLine 'bash', currentPath+'/managePatches.sh' - copyIcsOpenVPNClasses.execute() + //copyIcsOpenVPNClasses.execute() copyIcsOpenVPNXml.execute() copyIcsOpenVPNImages.execute() //mergeUntranslatable.execute() @@ -309,12 +299,6 @@ task updateIcsOpenVpn( type: Exec ) { copyIcsOpenVPNFiles.execute() } -/* -task buildNative ( type: Exec ) { - println "buildNative" - //commandLine 'sh', 'misc/build-native.sh', 'USE_BREAKPAD=0', '-j 8' -} -*/ task cleanNative( type: Delete ) { def shouldClean = getCurrentFlavorForBetaOrRelease() == "production" @@ -353,5 +337,3 @@ def getCurrentFlavorForBetaOrRelease() { return ""; } } - -//preBuild.dependsOn buildNative diff --git a/app/src/main/cpp b/app/src/main/cpp new file mode 120000 index 00000000..e445d43e --- /dev/null +++ b/app/src/main/cpp @@ -0,0 +1 @@ +../../../ics-openvpn/main/src/main/cpp/ \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..070ba686 --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cd ./ics-openvpn +./gradlew clean main:externalNativeBuildCleanNoovpn3Release main:externalNativeBuildNoovpn3Release +cd .. +./gradlew clean assembleDebug --stacktrace diff --git a/cleanProject.sh b/cleanProject.sh new file mode 100755 index 00000000..e4707215 --- /dev/null +++ b/cleanProject.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +git checkout -- \* +git checkout -- \.\* + +rm -r ./ics-openvpn +rm -r ./build +rm -r ./app/build +git submodule sync --recursive +git submodule update --init --recursive diff --git a/ics-openvpn b/ics-openvpn index 369ac22a..97e2e667 160000 --- a/ics-openvpn +++ b/ics-openvpn @@ -1 +1 @@ -Subproject commit 369ac22a4405bf2139c6e93439c2050411d92b10 +Subproject commit 97e2e6674ad1aff81b7b7d94e96594a532c40367 diff --git a/settings.gradle b/settings.gradle index cae9d1b7..25c342e6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,3 @@ include ':app' -include ':ics-openvpn' -include ':ics-openvpn:main' \ No newline at end of file +//include ':ics-openvpn' +//include ':ics-openvpn:main' \ No newline at end of file -- cgit v1.2.3