@@ -11,24 +11,39 @@ if (flutterRoot == null) {
11
11
throw new GradleException (" Flutter SDK not found. Define location with flutter.sdk in the local.properties file." )
12
12
}
13
13
14
+ def flutterVersionCode = localProperties. getProperty(' flutter.versionCode' )
15
+ if (flutterVersionCode == null ) {
16
+ flutterVersionCode = ' 1'
17
+ }
18
+
19
+ def flutterVersionName = localProperties. getProperty(' flutter.versionName' )
20
+ if (flutterVersionName == null ) {
21
+ flutterVersionName = ' 1.0'
22
+ }
23
+
14
24
apply plugin : ' com.android.application'
25
+ apply plugin : ' kotlin-android'
15
26
apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
16
27
17
28
android {
18
- compileSdkVersion 27
29
+ compileSdkVersion 28
30
+
31
+ sourceSets {
32
+ main. java. srcDirs + = ' src/main/kotlin'
33
+ }
19
34
20
35
lintOptions {
21
36
disable ' InvalidPackage'
22
37
}
23
38
24
39
defaultConfig {
25
40
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
26
- applicationId " com.example.mdc100series "
41
+ applicationId " com.example.mdc_101_flutter "
27
42
minSdkVersion 16
28
- targetSdkVersion 27
29
- versionCode 1
30
- versionName " 1.0 "
31
- testInstrumentationRunner " android.support .test.runner.AndroidJUnitRunner"
43
+ targetSdkVersion 28
44
+ versionCode flutterVersionCode . toInteger()
45
+ versionName flutterVersionName
46
+ testInstrumentationRunner " androidx .test.runner.AndroidJUnitRunner"
32
47
}
33
48
34
49
buildTypes {
@@ -45,7 +60,8 @@ flutter {
45
60
}
46
61
47
62
dependencies {
63
+ implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
48
64
testImplementation ' junit:junit:4.12'
49
- androidTestImplementation ' com.android.support. test:runner:1.0 .1'
50
- androidTestImplementation ' com.android.support. test.espresso:espresso-core:3.0 .1'
65
+ androidTestImplementation ' androidx. test:runner:1.1 .1'
66
+ androidTestImplementation ' androidx. test.espresso:espresso-core:3.1 .1'
51
67
}
0 commit comments