| 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 flutter.compileSdkVersion |
| ndkVersion flutter.ndkVersion |
| namespace 'io.flutter.cronet_http_example' |
| |
| compileOptions { |
| sourceCompatibility JavaVersion.VERSION_1_8 |
| targetCompatibility JavaVersion.VERSION_1_8 |
| } |
| |
| kotlinOptions { |
| jvmTarget = '1.8' |
| } |
| |
| sourceSets { |
| main.java.srcDirs += 'src/main/kotlin' |
| } |
| |
| defaultConfig { |
| applicationId "io.flutter.cronet_http_example" |
| // api-level/minSdkVersion should be help in sync in: |
| // - .github/workflows/cronet.yml |
| // - pkgs/cronet_http/android/build.gradle |
| // - pkgs/cronet_http/example/android/app/build.gradle |
| minSdkVersion 21 |
| targetSdkVersion flutter.targetSdkVersion |
| versionCode flutterVersionCode.toInteger() |
| versionName flutterVersionName |
| } |
| |
| buildTypes { |
| release { |
| // TODO: Add your own signing config for the release build. |
| // Signing with the debug keys for now, so `flutter run --release` works. |
| signingConfig signingConfigs.debug |
| } |
| } |
| } |
| |
| flutter { |
| source '../..' |
| } |
| |
| dependencies { |
| // TODO(#1112): org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. |
| // This should be removed when https://github.com/flutter/flutter/issues/125062 is fixed. |
| implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) |
| // ""com.google.android.gms:play-services-cronet" is only present so that |
| // `jnigen` will work. Applications should not include this line. |
| // The version should be synced with `pkgs/cronet_http/android/build.gradle`. |
| implementation "com.google.android.gms:play-services-cronet:18.0.1" |
| } |