Skip to content

Commit c076259

Browse files
chore: generate flutter_news_template (#1310)
1 parent 111d587 commit c076259

File tree

1 file changed

+17
-12
lines changed
  • flutter_news_template/__brick__/{{project_name.snakeCase()}}/android/app

1 file changed

+17
-12
lines changed

flutter_news_template/__brick__/{{project_name.snakeCase()}}/android/app/build.gradle

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -27,12 +28,17 @@ if (keystorePropertiesFile.exists()) {
2728
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
2829
}
2930

30-
apply plugin: 'com.android.application'
31-
apply plugin: 'kotlin-android'
32-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
33-
3431
android {
35-
compileSdkVersion 33
32+
compileSdkVersion 34
33+
34+
compileOptions {
35+
sourceCompatibility JavaVersion.VERSION_17
36+
targetCompatibility JavaVersion.VERSION_17
37+
}
38+
39+
kotlinOptions {
40+
jvmTarget = '17'
41+
}
3642

3743
sourceSets {
3844
main.java.srcDirs += 'src/main/kotlin'
@@ -45,7 +51,7 @@ android {
4551

4652
defaultConfig {
4753
applicationId "{{reverse_domain}}"
48-
minSdkVersion 23
54+
minSdkVersion 24
4955
targetSdkVersion 31
5056
versionCode flutterVersionCode.toInteger()
5157
versionName flutterVersionName
@@ -94,7 +100,6 @@ flutter {
94100
}
95101

96102
dependencies {
97-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
98103
implementation 'com.google.guava:guava:27.0.1-android'
99104
implementation 'com.google.firebase:firebase-analytics:17.4.4'
100105
implementation 'com.google.firebase:firebase-crashlytics:17.1.1'

0 commit comments

Comments
 (0)