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 { compileSdkVersion 30 sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { disable 'InvalidPackage' } defaultConfig { applicationId "com.krawieck.lemmur" minSdkVersion 16 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } signingConfigs { dev { } 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 { } } } 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 } } buildTypes { debug { testCoverageEnabled true debuggable true minifyEnabled false signingConfig null } release { debuggable false minifyEnabled true shrinkResources false zipAlignEnabled true } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" }