summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml16
-rwxr-xr-xscripts/build_deps.sh (renamed from build_deps.sh)0
-rwxr-xr-xscripts/cleanGit.sh (renamed from cleanGit.sh)0
-rwxr-xr-xscripts/cleanProject.sh12
-rwxr-xr-xscripts/fix_gradle_lock.sh (renamed from fix_gradle_lock.sh)0
-rwxr-xr-xscripts/prepareForDistribution.sh (renamed from prepareForDistribution.sh)52
6 files changed, 47 insertions, 33 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b9ac51a6..1d358b22 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -102,9 +102,9 @@ build:
image: "0xacab.org:4567/leap/bitmask_android/android-ndk:latest"
stage: build
script:
- - ./cleanProject.sh
- - ./build_deps.sh >> build_deps.log 2>&1
- - ./gradlew clean assembleNormalProductionFatDebug --stacktrace >> build.log 2>&1
+ - ./scripts/cleanProject.sh
+ - ./scripts/build_deps.sh >> build_deps.log 2>&1
+ - ./scripts/gradlew clean assembleNormalProductionFatDebug --stacktrace >> build.log 2>&1
artifacts:
paths:
- app/build/outputs/
@@ -117,7 +117,7 @@ build_release:
image: "0xacab.org:4567/leap/bitmask_android/android-ndk:latest"
stage: build
script:
- - ./prepareForDistribution.sh build -no-tag >> normalRelease.log 2>&1
+ - ./scripts/prepareForDistribution.sh build -no-tag >> normalRelease.log 2>&1
artifacts:
paths:
- app/build/outputs/
@@ -131,7 +131,7 @@ build_fdroid_beta_release:
image: "0xacab.org:4567/leap/bitmask_android/android-ndk:latest"
stage: build
script:
- - ./prepareForDistribution.sh build -no-tag -beta >> normalBeta.log 2>&1
+ - ./scripts/prepareForDistribution.sh build -no-tag -beta >> normalBeta.log 2>&1
artifacts:
paths:
- app/build/outputs/
@@ -145,7 +145,7 @@ build_custom_release:
image: "0xacab.org:4567/leap/bitmask_android/android-ndk:latest"
stage: build
script:
- - ./prepareForDistribution.sh build -no-tag -custom >> customRelease.log 2>&1
+ - ./scripts/prepareForDistribution.sh build -no-tag -custom >> customRelease.log 2>&1
artifacts:
paths:
- app/build/outputs/
@@ -159,7 +159,7 @@ build_fdroid_custom_beta_release:
image: "0xacab.org:4567/leap/bitmask_android/android-ndk:latest"
stage: build
script:
- - ./prepareForDistribution.sh build -no-tag -beta -custom >> customBeta.log 2>&1
+ - ./scripts/prepareForDistribution.sh build -no-tag -beta -custom >> customBeta.log 2>&1
artifacts:
paths:
- app/build/outputs/
@@ -167,4 +167,4 @@ build_fdroid_custom_beta_release:
- customBeta.log
when: always
expire_in: 1 week
- when: manual \ No newline at end of file
+ when: manual
diff --git a/build_deps.sh b/scripts/build_deps.sh
index beb5e13e..beb5e13e 100755
--- a/build_deps.sh
+++ b/scripts/build_deps.sh
diff --git a/cleanGit.sh b/scripts/cleanGit.sh
index 3c0b9271..3c0b9271 100755
--- a/cleanGit.sh
+++ b/scripts/cleanGit.sh
diff --git a/scripts/cleanProject.sh b/scripts/cleanProject.sh
new file mode 100755
index 00000000..703788cc
--- /dev/null
+++ b/scripts/cleanProject.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+git checkout -- \*
+git checkout -- \.\*
+
+rm -r ./ics-openvpn
+rm -r ./build
+rm -r ./app/build
+rm -r ./go/lib/*
+rm -r ./currentReleases
+git submodule sync --recursive
+git submodule update --init --recursive
diff --git a/fix_gradle_lock.sh b/scripts/fix_gradle_lock.sh
index 4361f3b5..4361f3b5 100755
--- a/fix_gradle_lock.sh
+++ b/scripts/fix_gradle_lock.sh
diff --git a/prepareForDistribution.sh b/scripts/prepareForDistribution.sh
index 5e39bb5c..cf2aafea 100755
--- a/prepareForDistribution.sh
+++ b/scripts/prepareForDistribution.sh
@@ -245,8 +245,10 @@ then
exit
fi
-BASE_FILE_DIR="$(pwd)/app/build/outputs/apk"
-RELEASES_FILE_DIR="$(pwd)/currentReleases"
+SCRIPT_DIR=$(dirname "$0")
+BASE_DIR="$SCRIPT_DIR/../"
+BASE_FILE_DIR="$BASE_DIR/app/build/outputs/apk"
+RELEASES_FILE_DIR="$BASE_DIR/currentReleases"
if [[ ${DO_BUILD} == true ]]
then
@@ -267,9 +269,9 @@ then
fi
fi
- ./cleanProject.sh || quit
- ./build_deps.sh || quit
- ./fix_gradle_lock.sh || quit
+ $SCRIPT_DIR/cleanProject.sh || quit
+ $SCRIPT_DIR/build_deps.sh || quit
+ $SCRIPT_DIR/fix_gradle_lock.sh || quit
if [[ ! -d $RELEASES_FILE_DIR ]]
then
@@ -279,51 +281,51 @@ then
if [[ ${BETA} == true ]]
then
- echo -e "${GREEN} -> build beta releases for flavor ${FLAVOR}${NC}"
- ./gradlew clean assemble${FLAVOR}ProductionFatBeta --stacktrace || quit
+ echo "${GREEN} -> build beta releases for flavor ${FLAVOR}${NC}"
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionFatBeta --stacktrace || quit
# echo "copy file: $(ls $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionFat/beta/*.apk)"
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionFat/beta/*.apk $RELEASES_FILE_DIR/.
# custom builds might have disabled split apks -> check if build task exist
- if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionX86Beta) ]]; then
- ./gradlew clean assemble${FLAVOR}ProductionX86Beta --stacktrace || quit
+ if [[ $($BASE_DIR/gradlew tasks --console plain | grep ${FLAVOR}ProductionX86Beta) ]]; then
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionX86Beta --stacktrace || quit
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionX86/beta/*.apk $RELEASES_FILE_DIR/.
fi
- if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionX86_64Beta) ]]; then
- ./gradlew clean assemble${FLAVOR}ProductionX86_64Beta --stacktrace || quit
+ if [[ $($BASE_DIR/gradlew tasks --console plain | grep ${FLAVOR}ProductionX86_64Beta) ]]; then
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionX86_64Beta --stacktrace || quit
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionX86_64/beta/*.apk $RELEASES_FILE_DIR/.
fi
- if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionArmv7Beta) ]]; then
- ./gradlew clean assemble${FLAVOR}ProductionArmv7Beta --stacktrace || quit
+ if [[ $($BASE_DIR/gradlew tasks --console plain | grep ${FLAVOR}ProductionArmv7Beta) ]]; then
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionArmv7Beta --stacktrace || quit
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionArmv7/beta/*.apk $RELEASES_FILE_DIR/.
fi
- if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionArmv7Beta) ]]; then
- ./gradlew clean assemble${FLAVOR}ProductionArm64Beta --stacktrace || quit
+ if [[ $($BASE_DIR/gradlew tasks --console plain | grep ${FLAVOR}ProductionArmv7Beta) ]]; then
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionArm64Beta --stacktrace || quit
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionArm64/beta/*.apk $RELEASES_FILE_DIR/.
fi
else
echo -e "${GREEN} -> build stable releases for flavor ${FLAVOR}${NC}"
- ./gradlew clean assemble${FLAVOR}ProductionFatRelease --stacktrace || quit
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionFatRelease --stacktrace || quit
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionFat/release/*.apk $RELEASES_FILE_DIR/.
- ./gradlew clean assemble${FLAVOR}ProductionFatwebRelease --stacktrace || quit
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionFatwebRelease --stacktrace || quit
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionFatweb/release/*.apk $RELEASES_FILE_DIR/.
# custom builds might have disabled split apks -> check if build task exist
- if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionX86Release) ]]; then
- ./gradlew clean assemble${FLAVOR}ProductionX86Release --stacktrace || quit
+ if [[ $($BASE_DIR/gradlew tasks --console plain | grep ${FLAVOR}ProductionX86Release) ]]; then
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionX86Release --stacktrace || quit
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionX86/release/*.apk $RELEASES_FILE_DIR/.
fi
- if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionX86_64Release) ]]; then
- ./gradlew clean assemble${FLAVOR}ProductionX86_64Release --stacktrace || quit
+ if [[ $($BASE_DIR/gradlew tasks --console plain | grep ${FLAVOR}ProductionX86_64Release) ]]; then
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionX86_64Release --stacktrace || quit
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionX86_64/release/*.apk $RELEASES_FILE_DIR/.
fi
- if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionArmv7Release) ]]; then
- ./gradlew clean assemble${FLAVOR}ProductionArmv7Release --stacktrace || quit
+ if [[ $($BASE_DIR/gradlew tasks --console plain | grep ${FLAVOR}ProductionArmv7Release) ]]; then
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionArmv7Release --stacktrace || quit
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionArmv7/release/*.apk $RELEASES_FILE_DIR/.
fi
- if [[ $(./gradlew tasks --console plain | grep ${FLAVOR}ProductionArm64Release) ]]; then
- ./gradlew clean assemble${FLAVOR}ProductionArm64Release --stacktrace || quit
+ if [[ $($BASE_DIR/gradlew tasks --console plain | grep ${FLAVOR}ProductionArm64Release) ]]; then
+ $BASE_DIR/gradlew clean assemble${FLAVOR}ProductionArm64Release --stacktrace || quit
cp $BASE_FILE_DIR/${FLAVOR_LOWERCASE}ProductionArm64/release/*.apk $RELEASES_FILE_DIR/.
fi
fi