1
+ plugins {
2
+ id " com.android.application"
3
+ id " kotlin-android"
4
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5
+ id " dev.flutter.flutter-gradle-plugin"
6
+ }
7
+
1
8
def localProperties = new Properties ()
2
- def localPropertiesFile = rootProject. file(' local.properties' )
9
+ def localPropertiesFile = rootProject. file(" local.properties" )
3
10
if (localPropertiesFile. exists()) {
4
- localPropertiesFile. withReader(' UTF-8' ) { reader ->
11
+ localPropertiesFile. withReader(" UTF-8" ) { reader ->
5
12
localProperties. load(reader)
6
13
}
7
14
}
@@ -17,71 +24,60 @@ if (flutterRoot == null) {
17
24
throw new GradleException (" Flutter SDK not found. Define location with flutter.sdk in the local.properties file." )
18
25
}
19
26
20
- def flutterVersionCode = localProperties. getProperty(' flutter.versionCode' )
27
+ def flutterVersionCode = localProperties. getProperty(" flutter.versionCode" )
21
28
if (flutterVersionCode == null ) {
22
- flutterVersionCode = ' 1 '
29
+ flutterVersionCode = " 1 "
23
30
}
24
31
25
- def flutterVersionName = localProperties. getProperty(' flutter.versionName' )
32
+ def flutterVersionName = localProperties. getProperty(" flutter.versionName" )
26
33
if (flutterVersionName == null ) {
27
- flutterVersionName = ' 1.0'
34
+ flutterVersionName = " 1.0"
28
35
}
29
36
30
- apply plugin : ' com.android.application'
31
- apply plugin : ' kotlin-android'
32
- apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
33
-
34
37
android {
35
- compileSdkVersion flutter. compileSdkVersion
38
+ namespace = " com.example.chemobile"
39
+ compileSdk = flutter. compileSdkVersion
40
+ ndkVersion = flutter. ndkVersion
36
41
37
42
compileOptions {
38
- sourceCompatibility JavaVersion . VERSION_1_8
39
- targetCompatibility JavaVersion . VERSION_1_8
40
- }
41
-
42
- kotlinOptions {
43
- jvmTarget = ' 1.8'
44
- }
45
-
46
- sourceSets {
47
- main. java. srcDirs + = ' src/main/kotlin'
43
+ sourceCompatibility = JavaVersion . VERSION_1_8
44
+ targetCompatibility = JavaVersion . VERSION_1_8
48
45
}
49
46
50
47
defaultConfig {
51
- applicationId " com.chemotion.chemobile"
52
- minSdkVersion localProperties. getProperty(' flutter.minSdkVersion' ). toInteger()
53
- targetSdkVersion localProperties. getProperty(' flutter.targetSdkVersion' ). toInteger()
54
- versionCode flutterVersionCode. toInteger()
55
- versionName flutterVersionName
48
+ // You can update the following values to match your application needs.
49
+ // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
50
+ applicationId = " com.chemotion.chemobile"
51
+ minSdk = localProperties. getProperty(' flutter.minSdkVersion' ). toInteger()
52
+ targetSdk = localProperties. getProperty(' flutter.targetSdkVersion' ). toInteger()
53
+ versionCode = flutterVersionCode. toInteger()
54
+ versionName = flutterVersionName
56
55
}
57
56
58
57
signingConfigs {
59
58
release {
60
59
if (keystorePropertiesFile. exists()) {
61
- keyAlias keystoreProperties[' keyAlias' ]
62
- keyPassword keystoreProperties[' keyPassword' ]
63
- storeFile keystoreProperties[' storeFile' ] ? file(keystoreProperties[' storeFile' ]) : null
64
- storePassword keystoreProperties[' storePassword' ]
60
+ keyAlias = keystoreProperties[' keyAlias' ]
61
+ keyPassword = keystoreProperties[' keyPassword' ]
62
+ storeFile = keystoreProperties[' storeFile' ] ? file(keystoreProperties[' storeFile' ]) : null
63
+ storePassword = keystoreProperties[' storePassword' ]
65
64
}
66
65
}
67
66
}
67
+
68
68
buildTypes {
69
69
release {
70
- if (keystorePropertiesFile. exists()) {
71
- println " Signing with key.properties"
72
- signingConfig signingConfigs. release
70
+ if (keystorePropertiesFile. exists()) {
71
+ println " Signing with key.properties"
72
+ signingConfig = signingConfigs. release
73
73
} else {
74
- println " Signing with debug keys"
75
- signingConfig signingConfigs. debug
74
+ println " Signing with debug keys"
75
+ signingConfig = signingConfigs. debug
76
76
}
77
77
}
78
78
}
79
79
}
80
80
81
81
flutter {
82
- source ' ../..'
83
- }
84
-
85
- dependencies {
86
- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
82
+ source = " ../.."
87
83
}
0 commit comments