lemmur-app-android/android/app/build.gradle

120 lines
3.0 KiB
Groovy
Raw Normal View History

2020-08-02 13:34:42 +02:00
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
2022-04-30 15:44:03 +02:00
compileSdkVersion 31
lintOptions {
disable 'InvalidPackage'
}
2020-08-02 13:34:42 +02:00
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
2020-08-02 13:34:42 +02:00
}
kotlinOptions {
jvmTarget = '1.8'
}
2020-08-02 13:34:42 +02:00
defaultConfig {
2021-01-30 14:40:43 +01:00
applicationId "com.krawieck.lemmur"
2020-08-02 13:34:42 +02:00
minSdkVersion 16
2021-01-30 14:40:43 +01:00
targetSdkVersion 30
2020-08-02 13:34:42 +02:00
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
2021-01-30 14:40:43 +01:00
signingConfigs {
if (System.getenv("ANDROID_STORE_PATH")) {
prod {
keyAlias System.getenv("ANDROID_KEY_ALIAS")
keyPassword System.getenv("ANDROID_KEY_PASSWORD")
storeFile file(System.getenv("ANDROID_STORE_PATH"))
storePassword System.getenv("ANDROID_STORE_PASSWORD")
}
} else {
prod {
keyAlias signingConfigs.debug.keyAlias
keyPassword signingConfigs.debug.keyPassword
storeFile signingConfigs.debug.storeFile
storePassword signingConfigs.debug.storePassword
}
2021-02-05 20:21:51 +01:00
}
}
flavorDimensions "app"
productFlavors {
dev {
dimension "app"
applicationIdSuffix ".dev"
versionNameSuffix "-dev"
manifestPlaceholders = [
appName: "lemmur DEV"
]
signingConfig signingConfigs.debug
}
prod {
dimension "app"
manifestPlaceholders = [
appName: "lemmur"
]
signingConfig signingConfigs.prod
}
}
2021-01-30 14:40:43 +01:00
2021-02-05 20:29:10 +01:00
buildTypes {
debug {
testCoverageEnabled true
debuggable true
minifyEnabled false
signingConfig null
}
2021-02-05 20:29:10 +01:00
release {
debuggable false
minifyEnabled true
shrinkResources false
zipAlignEnabled true
2021-02-05 20:29:10 +01:00
}
}
2020-08-02 13:34:42 +02:00
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}