From 6dae99d311b588e16cd42743eb8be79ece63acb5 Mon Sep 17 00:00:00 2001 From: Odweta Date: Sun, 22 Dec 2024 20:28:50 +0100 Subject: [PATCH] updated deploying --- deploy.sh | 12 ++++++++---- mobile/app/build.gradle.kts | 20 ++++++++++++++++++++ mobile/build.gradle.kts | 2 +- mobile/prepare_release.sh | 3 --- 4 files changed, 29 insertions(+), 8 deletions(-) delete mode 100755 mobile/prepare_release.sh diff --git a/deploy.sh b/deploy.sh index bc38a7a..2839835 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,18 +1,22 @@ #!/bin/bash -echo -n "version number: " -read ver - echo -n "glpat: " read glpat +echo -n "keystore password: " +read ks_pass + cd ./mobile +ver=$(./gradlew printVersionName -q) + # build ./gradlew assembleRelease # sign -~/Android/Sdk/build-tools/35.0.0/apksigner sign --alignment-preserved --ks ~/Documents/android-keystore.jks app/build/outputs/apk/release/com.odweta.solon_$ver.apk +~/Android/Sdk/build-tools/35.0.0/apksigner sign --alignment-preserved --ks ~/Documents/android-keystore.jks --ks-pass pass:$ks_pass app/build/outputs/apk/release/com.odweta.solon_$ver.apk + +exit # add, commit, push git add .. diff --git a/mobile/app/build.gradle.kts b/mobile/app/build.gradle.kts index 1c2bc20..8614826 100644 --- a/mobile/app/build.gradle.kts +++ b/mobile/app/build.gradle.kts @@ -4,6 +4,26 @@ plugins { alias(libs.plugins.kotlin.compose) } +tasks.register("printVersionName") { + doLast { + println(android.defaultConfig.versionName) + } +} + +tasks.register("deploy") { + dependsOn("assembleDebug") + dependsOn("installDebug") + doLast { + exec { + commandLine("adb", "shell", "am", "start", "-n", "com.odweta.solon/.MainActivity") + } + } +} + +tasks.register("b") { + dependsOn("assembleDebug") +} + android { namespace = "com.odweta.solon" compileSdk = 34 diff --git a/mobile/build.gradle.kts b/mobile/build.gradle.kts index 952b930..5c98ad0 100644 --- a/mobile/build.gradle.kts +++ b/mobile/build.gradle.kts @@ -3,4 +3,4 @@ plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.compose) apply false -} \ No newline at end of file +} diff --git a/mobile/prepare_release.sh b/mobile/prepare_release.sh deleted file mode 100755 index 6e1c110..0000000 --- a/mobile/prepare_release.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -cp app/build/outputs/apk/release/com.odweta.solon_$1.apk ../release/