android-wrapper/scripts/compile_version.sh

16 lines
572 B
Bash
Executable file

#! /bin/bash
# Edit the 'build.gradle' file to a certain target sdk
TAG="$1"
LABEL="$2"
VERSION="$3"
echo "Setting $VERSION"
# sed -i "s/compileSdkVersion *[0-9]\+/compileSdkVersion $VERSION/" app/build.gradle
sed -i "s/minSdk *[0-9]\+/minSdk $VERSION/" app/build.gradle
sed -i "s/targetSdkVersion *[0-9]\+/targetSdkVersion $VERSION/" app/build.gradle
./gradlew build
scp app/build/outputs/apk/release/app-release.apk hetzner:~/public/apk/mapcomplete-$TAG-$LABEL.apk
ssh hetzner "cp ~/public/apk/mapcomplete-$TAG-$LABEL.apk ~/public/apk/mapcomplete-latest-$LABEL.apk"