73 lines
2.1 KiB
Kotlin
73 lines
2.1 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("kotlin-android")
|
|
id("dev.flutter.flutter-gradle-plugin")
|
|
}
|
|
|
|
import java.util.Properties
|
|
|
|
val keystoreProperties = Properties()
|
|
val keystorePropertiesFile = rootProject.file("key.properties")
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystorePropertiesFile.inputStream().use { keystoreProperties.load(it) }
|
|
}
|
|
|
|
fun secret(name: String, propertyName: String): String? =
|
|
keystoreProperties.getProperty(propertyName)?.takeIf { it.isNotBlank() }
|
|
?: System.getenv(name)?.takeIf { it.isNotBlank() }
|
|
|
|
android {
|
|
namespace = "es.freetimelab.pluriwave"
|
|
compileSdk = flutter.compileSdkVersion
|
|
ndkVersion = flutter.ndkVersion
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = "es.freetimelab.pluriwave"
|
|
minSdk = flutter.minSdkVersion
|
|
targetSdk = flutter.targetSdkVersion
|
|
versionCode = flutter.versionCode
|
|
versionName = flutter.versionName
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
val storeFilePath = secret("KEYSTORE_PATH", "storeFile")
|
|
val storePasswordValue = secret("KEYSTORE_PASSWORD", "storePassword")
|
|
val keyAliasValue = secret("KEYSTORE_ALIAS", "keyAlias")
|
|
val keyPasswordValue = secret("KEY_PASSWORD", "keyPassword")
|
|
|
|
if (!storeFilePath.isNullOrBlank()) {
|
|
storeFile = file(storeFilePath)
|
|
}
|
|
if (!storePasswordValue.isNullOrBlank()) {
|
|
storePassword = storePasswordValue
|
|
}
|
|
if (!keyAliasValue.isNullOrBlank()) {
|
|
keyAlias = keyAliasValue
|
|
}
|
|
if (!keyPasswordValue.isNullOrBlank()) {
|
|
keyPassword = keyPasswordValue
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
signingConfig = signingConfigs.getByName("release")
|
|
}
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source = "../.."
|
|
}
|