Add fastlane

This commit is contained in:
Rafał Kobyłko 2023-10-01 14:43:04 +02:00
parent 8f9a980431
commit 56159f8c12
4 changed files with 18 additions and 17 deletions

5
.gitignore vendored
View File

@ -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

View File

@ -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")
}

View File

@ -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<Project> {
@ -18,10 +17,6 @@ class TwoFasAndroidApplicationPlugin : Plugin<Project> {
apply("org.jetbrains.kotlin.android")
}
extensions.configure<BasePluginExtension> {
archivesName.set(AppConfig.apkName)
}
extensions.configure<ApplicationExtension> {
applyKotlinAndroid(this)
applySigningConfigs(this)
@ -30,8 +25,6 @@ class TwoFasAndroidApplicationPlugin : Plugin<Project> {
defaultConfig {
multiDexEnabled = true
targetSdk = AppConfig.targetSdk
versionCode = AppConfig.versionCode
versionName = AppConfig.versionName
vectorDrawables.useSupportLibrary = true
}

View File

@ -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}"
}