From 56159f8c12c6cd9cdde571055f77d2b8fdda2406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=C2=A0Koby=C5=82ko?= Date: Sun, 1 Oct 2023 14:43:04 +0200 Subject: [PATCH] Add fastlane --- .gitignore | 5 +++++ app/build.gradle.kts | 14 +++++++++++++- .../buildlogic/TwoFasAndroidApplicationPlugin.kt | 7 ------- .../com/twofasapp/buildlogic/version/AppConfig.kt | 9 --------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 3e9b36de..affef424 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,11 @@ /local.properties .DS_Store /build +/artifacts +/fastlane /captures +Gemfile +Gemfile.lock # Built application files /*/build/ @@ -32,6 +36,7 @@ local.properties ehthumbs.db Thumbs.db + scripts/json-to-kotlin/.idea/ # Secrets diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8971df7c..6232689e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.archivesName + @Suppress("DSL_SCOPE_VIOLATION") plugins { alias(libs.plugins.twofasAndroidApplication) @@ -13,6 +15,16 @@ plugins { android { namespace = "com.twofasapp" + defaultConfig { + applicationId = "com.twofasapp" + versionName = "4.7.0" + versionCode = 5000000 + + val versionCodeOffset = 5000000 + + archivesName.set("TwoFas-$versionName-${versionCode!! - versionCodeOffset}") + } + ksp { arg("room.schemaLocation", "$projectDir/schemas") } @@ -96,4 +108,4 @@ dependencies { releaseImplementation("io.objectbox:objectbox-android:2.9.1") implementation("io.objectbox:objectbox-kotlin:2.9.1") kapt("io.objectbox:objectbox-processor:2.9.1") -} \ No newline at end of file +} diff --git a/buildlogic/src/main/java/com/twofasapp/buildlogic/TwoFasAndroidApplicationPlugin.kt b/buildlogic/src/main/java/com/twofasapp/buildlogic/TwoFasAndroidApplicationPlugin.kt index 1823ac0f..ec8f0416 100644 --- a/buildlogic/src/main/java/com/twofasapp/buildlogic/TwoFasAndroidApplicationPlugin.kt +++ b/buildlogic/src/main/java/com/twofasapp/buildlogic/TwoFasAndroidApplicationPlugin.kt @@ -7,7 +7,6 @@ import com.twofasapp.buildlogic.extension.applySigningConfigs import com.twofasapp.buildlogic.version.AppConfig import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.plugins.BasePluginExtension import org.gradle.kotlin.dsl.configure class TwoFasAndroidApplicationPlugin : Plugin { @@ -18,10 +17,6 @@ class TwoFasAndroidApplicationPlugin : Plugin { apply("org.jetbrains.kotlin.android") } - extensions.configure { - archivesName.set(AppConfig.apkName) - } - extensions.configure { applyKotlinAndroid(this) applySigningConfigs(this) @@ -30,8 +25,6 @@ class TwoFasAndroidApplicationPlugin : Plugin { defaultConfig { multiDexEnabled = true targetSdk = AppConfig.targetSdk - versionCode = AppConfig.versionCode - versionName = AppConfig.versionName vectorDrawables.useSupportLibrary = true } diff --git a/buildlogic/src/main/java/com/twofasapp/buildlogic/version/AppConfig.kt b/buildlogic/src/main/java/com/twofasapp/buildlogic/version/AppConfig.kt index 8607d8b0..4d6ba057 100644 --- a/buildlogic/src/main/java/com/twofasapp/buildlogic/version/AppConfig.kt +++ b/buildlogic/src/main/java/com/twofasapp/buildlogic/version/AppConfig.kt @@ -4,13 +4,4 @@ object AppConfig { const val minSdk = 23 const val targetSdk = 34 const val compileSdk = 34 - - private const val verMajor = 4 - private const val verMinor = 7 - private const val verPatch = 0 - private const val verInternal = 0 - - const val versionCode = verMajor * 1000000 + verMinor * 10000 + verPatch * 100 + verInternal - const val versionName = "${verMajor}.${verMinor}.${verPatch}" - const val apkName = "TwoFas-${verMajor}.${verMinor}.${verPatch}-${verInternal}" } \ No newline at end of file