summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--android/app/build.gradle.kts19
-rwxr-xr-xbuild-apk.sh34
-rwxr-xr-xci/buildserver-build-android.sh2
3 files changed, 46 insertions, 9 deletions
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index fa098430df..f2a76b6d8d 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -1,5 +1,6 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import com.android.build.gradle.internal.tasks.factory.dependsOn
+import com.github.triplet.gradle.androidpublisher.ReleaseStatus
import java.io.FileInputStream
import java.util.Properties
import org.gradle.internal.extensions.stdlib.capitalized
@@ -53,6 +54,12 @@ android {
}
}
+ playConfigs {
+ register("playStagemoleRelease") {
+ enabled = true
+ }
+ }
+
androidResources {
@Suppress("UnstableApiUsage")
generateLocaleConfig = true
@@ -315,7 +322,17 @@ tasks.create("printVersion") {
}
}
-play { serviceAccountCredentials.set(file("play-api-key.json")) }
+play {
+ serviceAccountCredentials.set(file("$credentialsPath/play-api-key.json"))
+ // Disable for all flavors by default. Only specific flavors should be enabled using PlayConfigs.
+ enabled = false
+ // This property refers to the Publishing API (not git).
+ commit = true
+ defaultToAppBundles = true
+ track = "internal"
+ releaseStatus = ReleaseStatus.COMPLETED
+ userFraction = 1.0
+}
dependencies {
implementation(projects.lib.common)
diff --git a/build-apk.sh b/build-apk.sh
index dbc6362e8f..4f11628075 100755
--- a/build-apk.sh
+++ b/build-apk.sh
@@ -14,9 +14,11 @@ echo ""
BUILD_TYPE="release"
GRADLE_BUILD_TYPE="release"
GRADLE_TASKS=(createOssProdReleaseDistApk createPlayProdReleaseDistApk)
+BUILD_BUNDLE="no"
BUNDLE_TASKS=(createPlayProdReleaseDistBundle)
+RUN_PLAY_PUBLISH_TASKS="no"
+PLAY_PUBLISH_TASKS=()
CARGO_ARGS=( "--release" )
-BUILD_BUNDLE="no"
CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-"target"}
SKIP_STRIPPING=${SKIP_STRIPPING:-"no"}
@@ -33,6 +35,8 @@ while [ -n "${1:-""}" ]; do
BUNDLE_TASKS=(createOssProdFdroidDistBundle)
elif [[ "${1:-""}" == "--app-bundle" ]]; then
BUILD_BUNDLE="yes"
+ elif [[ "${1:-""}" == "--enable-play-publishing" ]]; then
+ RUN_PLAY_PUBLISH_TASKS="yes"
elif [[ "${1:-""}" == "--skip-stripping" ]]; then
SKIP_STRIPPING="yes"
fi
@@ -48,14 +52,26 @@ if [[ "$GRADLE_BUILD_TYPE" == "release" ]]; then
fi
fi
-if [[ "$BUILD_TYPE" == "release" && "$PRODUCT_VERSION" != *"-dev-"* ]]; then
- echo "Removing old Rust build artifacts"
- cargo clean
- CARGO_ARGS+=( "--locked" )
+if [[ "$BUILD_TYPE" == "release" ]]; then
+ if [[ "$PRODUCT_VERSION" == *"-dev-"* ]]; then
+ CARGO_ARGS+=( "--features" "api-override" )
+ GRADLE_TASKS+=(createPlayDevmoleReleaseDistApk createPlayStagemoleReleaseDistApk)
+ BUNDLE_TASKS+=(createPlayDevmoleReleaseDistBundle createPlayStagemoleReleaseDistBundle)
+ elif [[ "$PRODUCT_VERSION" == *"-alpha"* ]]; then
+ echo "Removing old Rust build artifacts"
+ CARGO_ARGS+=( "--locked" )
+ cargo clean
+ CARGO_ARGS+=( "--features" "api-override" )
+ GRADLE_TASKS+=(createPlayStagemoleReleaseDistApk)
+ BUNDLE_TASKS+=(createPlayStagemoleReleaseDistBundle)
+ PLAY_PUBLISH_TASKS=(publishPlayStagemoleReleaseBundle)
+ else
+ echo "Removing old Rust build artifacts"
+ CARGO_ARGS+=( "--locked" )
+ cargo clean
+ fi
else
CARGO_ARGS+=( "--features" "api-override" )
- GRADLE_TASKS+=(createPlayDevmoleReleaseDistApk createPlayStagemoleReleaseDistApk)
- BUNDLE_TASKS+=(createPlayDevmoleReleaseDistBundle createPlayStagemoleReleaseDistBundle)
fi
pushd "$SCRIPT_DIR/android"
@@ -124,6 +140,10 @@ if [[ "$BUILD_BUNDLE" == "yes" ]]; then
$GRADLE_CMD --console plain "${BUNDLE_TASKS[@]}"
fi
+if [[ "$RUN_PLAY_PUBLISH_TASKS" == "yes" && "${#PLAY_PUBLISH_TASKS[@]}" -ne 0 ]]; then
+ $GRADLE_CMD --console plain "${PLAY_PUBLISH_TASKS[@]}"
+fi
+
echo "**********************************"
echo ""
echo " The build finished successfully! "
diff --git a/ci/buildserver-build-android.sh b/ci/buildserver-build-android.sh
index bada3011ee..0010161ead 100755
--- a/ci/buildserver-build-android.sh
+++ b/ci/buildserver-build-android.sh
@@ -39,7 +39,7 @@ function build {
CARGO_TARGET_VOLUME_NAME="cargo-target-android" \
CARGO_REGISTRY_VOLUME_NAME="cargo-registry-android" \
USE_MOLD=false \
- ./building/containerized-build.sh android --app-bundle || return 1
+ ./building/containerized-build.sh android --app-bundle --enable-play-publishing || return 1
mv dist/*.{aab,apk} "$artifact_dir" || return 1
}