yandexads-flutter
67 строк · 1.8 Кб
1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4localPropertiesFile.withReader('UTF-8') { reader ->
5localProperties.load(reader)
6}
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27
28android {
29compileSdkVersion flutter.compileSdkVersion
30
31compileOptions {
32sourceCompatibility JavaVersion.VERSION_1_8
33targetCompatibility JavaVersion.VERSION_1_8
34}
35
36kotlinOptions {
37jvmTarget = '1.8'
38}
39
40sourceSets {
41main.java.srcDirs += 'src/main/kotlin'
42}
43
44defaultConfig {
45applicationId "ru.kovardin.flutter_yandex_ads_example"
46minSdkVersion 21
47targetSdkVersion flutter.targetSdkVersion
48versionCode flutterVersionCode.toInteger()
49versionName flutterVersionName
50}
51
52buildTypes {
53release {
54// TODO: Add your own signing config for the release build.
55// Signing with the debug keys for now, so `flutter run --release` works.
56signingConfig signingConfigs.debug
57}
58}
59}
60
61flutter {
62source '../..'
63}
64
65dependencies {
66implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
67}
68