|
| 1 | +def localProperties = new Properties() |
| 2 | +def localPropertiesFile = rootProject.file('local.properties') |
| 3 | +if (localPropertiesFile.exists()) { |
| 4 | + localPropertiesFile.withReader('UTF-8') { reader -> |
| 5 | + localProperties.load(reader) |
| 6 | + } |
| 7 | +} |
| 8 | +def keystoreProperties = new Properties() |
| 9 | +def keystorePropertiesFile = rootProject.file('key.properties') |
| 10 | +if (keystorePropertiesFile.exists()) { |
| 11 | + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) |
| 12 | +} |
| 13 | + |
| 14 | +def flutterRoot = localProperties.getProperty('flutter.sdk') |
| 15 | +if (flutterRoot == null) { |
| 16 | + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") |
| 17 | +} |
| 18 | + |
| 19 | +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') |
| 20 | +if (flutterVersionCode == null) { |
| 21 | + flutterVersionCode = '1' |
| 22 | +} |
| 23 | + |
| 24 | +def flutterVersionName = localProperties.getProperty('flutter.versionName') |
| 25 | +if (flutterVersionName == null) { |
| 26 | + flutterVersionName = '1.0' |
| 27 | +} |
| 28 | + |
| 29 | +apply plugin: 'com.android.application' |
| 30 | +apply plugin: 'kotlin-android' |
| 31 | +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" |
| 32 | + |
| 33 | +android { |
| 34 | + namespace "standby.stillkonfuzed.com.standby_screen" |
| 35 | + compileSdkVersion flutter.compileSdkVersion |
| 36 | + ndkVersion flutter.ndkVersion |
| 37 | + |
| 38 | + compileOptions { |
| 39 | + sourceCompatibility JavaVersion.VERSION_1_8 |
| 40 | + targetCompatibility JavaVersion.VERSION_1_8 |
| 41 | + } |
| 42 | + |
| 43 | + kotlinOptions { |
| 44 | + jvmTarget = '1.8' |
| 45 | + } |
| 46 | + |
| 47 | + sourceSets { |
| 48 | + main.java.srcDirs += 'src/main/kotlin' |
| 49 | + } |
| 50 | + |
| 51 | + defaultConfig { |
| 52 | + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). |
| 53 | + applicationId "standby.stillkonfuzed.com.standby_screen" |
| 54 | + // You can update the following values to match your application needs. |
| 55 | + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.//flutter.minSdkVersion |
| 56 | + minSdkVersion 19 |
| 57 | + targetSdkVersion flutter.targetSdkVersion |
| 58 | + versionCode flutterVersionCode.toInteger() |
| 59 | + versionName flutterVersionName |
| 60 | + } |
| 61 | + signingConfigs { |
| 62 | + release { |
| 63 | + keyAlias keystoreProperties['keyAlias'] |
| 64 | + keyPassword keystoreProperties['keyPassword'] |
| 65 | + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null |
| 66 | + storePassword keystoreProperties['storePassword'] |
| 67 | + } |
| 68 | + } |
| 69 | + buildTypes { |
| 70 | + release { |
| 71 | + // TODO: Add your own signing config for the release build. |
| 72 | + // Signing with the debug keys for now, so `flutter run --release` works. |
| 73 | + signingConfig signingConfigs.release |
| 74 | + } |
| 75 | + } |
| 76 | +} |
| 77 | + |
| 78 | +flutter { |
| 79 | + source '../..' |
| 80 | +} |
| 81 | + |
| 82 | +dependencies { |
| 83 | + //implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" |
| 84 | + constraints { |
| 85 | + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") { |
| 86 | + because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib") |
| 87 | + } |
| 88 | + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") { |
| 89 | + because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib") |
| 90 | + } |
| 91 | + } |
| 92 | +} |
0 commit comments