|  | 
|  | 1 | +import java.util.Properties | 
|  | 2 | +import java.io.FileInputStream | 
|  | 3 | + | 
|  | 4 | +plugins { | 
|  | 5 | +    id("com.android.application") | 
|  | 6 | +    id("kotlin-android") | 
|  | 7 | +    // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. | 
|  | 8 | +    id("dev.flutter.flutter-gradle-plugin") | 
|  | 9 | +} | 
|  | 10 | + | 
|  | 11 | +val keystoreProperties = Properties() | 
|  | 12 | +val keystorePropertiesFile = rootProject.file("key.properties") | 
|  | 13 | +if (keystorePropertiesFile.exists()) { | 
|  | 14 | +    keystoreProperties.load(FileInputStream(keystorePropertiesFile)) | 
|  | 15 | +} | 
|  | 16 | + | 
|  | 17 | +android { | 
|  | 18 | +    namespace = "dev.flchart.app" | 
|  | 19 | +    compileSdk = flutter.compileSdkVersion | 
|  | 20 | +    ndkVersion = flutter.ndkVersion | 
|  | 21 | + | 
|  | 22 | +    compileOptions { | 
|  | 23 | +        sourceCompatibility = JavaVersion.VERSION_11 | 
|  | 24 | +        targetCompatibility = JavaVersion.VERSION_11 | 
|  | 25 | +    } | 
|  | 26 | + | 
|  | 27 | +    kotlinOptions { | 
|  | 28 | +        jvmTarget = JavaVersion.VERSION_11.toString() | 
|  | 29 | +    } | 
|  | 30 | + | 
|  | 31 | +    defaultConfig { | 
|  | 32 | +        applicationId = "dev.flchart.app" | 
|  | 33 | +        minSdk = flutter.minSdkVersion | 
|  | 34 | +        targetSdk = flutter.targetSdkVersion | 
|  | 35 | +        versionCode = flutter.versionCode | 
|  | 36 | +        versionName = flutter.versionName | 
|  | 37 | +    } | 
|  | 38 | + | 
|  | 39 | +    signingConfigs { | 
|  | 40 | +        create("release") { | 
|  | 41 | +            keyAlias = keystoreProperties["keyAlias"] as String | 
|  | 42 | +            keyPassword = keystoreProperties["keyPassword"] as String | 
|  | 43 | +            storeFile = keystoreProperties["storeFile"]?.let { file(it) } | 
|  | 44 | +            storePassword = keystoreProperties["storePassword"] as String | 
|  | 45 | +        } | 
|  | 46 | +    } | 
|  | 47 | + | 
|  | 48 | +    buildTypes { | 
|  | 49 | +        release { | 
|  | 50 | +            signingConfig = signingConfigs.getByName("release") | 
|  | 51 | +        } | 
|  | 52 | +    } | 
|  | 53 | +} | 
|  | 54 | + | 
|  | 55 | +flutter { | 
|  | 56 | +    source = "../.." | 
|  | 57 | +} | 
0 commit comments