Skip to content

Commit ec8c730

Browse files
authored
Merge branch 'main' into dependabot/github_actions/peter-evans/create-pull-request-7.0.2
2 parents 85bcff4 + c1ac858 commit ec8c730

File tree

3 files changed

+28
-35
lines changed

3 files changed

+28
-35
lines changed

flutter_news_example/android/app/build.gradle

Lines changed: 6 additions & 10 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,10 +28,6 @@ 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 {
3532
compileSdkVersion 34
3633

@@ -108,7 +105,6 @@ flutter {
108105
}
109106

110107
dependencies {
111-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
112108
implementation 'com.google.guava:guava:27.0.1-android'
113109
implementation 'com.google.firebase:firebase-analytics:17.4.4'
114110
implementation 'com.google.firebase:firebase-crashlytics:17.1.1'

flutter_news_example/android/build.gradle

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.8.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.4.2'
10-
classpath 'com.google.gms:google-services:4.3.4'
11-
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'
12-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13-
}
14-
}
15-
161
allprojects {
172
repositories {
183
google()
Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
411

5-
def plugins = new Properties()
6-
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7-
if (pluginsFile.exists()) {
8-
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
917
}
1018

11-
plugins.each { name, path ->
12-
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13-
include ":$name"
14-
project(":$name").projectDir = pluginDirectory
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "7.4.2" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
23+
id "com.google.gms.google-services" version "4.3.4" apply false
24+
id "com.google.firebase.crashlytics" version "2.9.9" apply false
1525
}
26+
27+
include ":app"

0 commit comments

Comments
 (0)