From 12eb85832683d37a6be56eb30bffe1689411b630 Mon Sep 17 00:00:00 2001 From: Felipe Bueno Date: Fri, 7 Jun 2024 12:43:47 -0300 Subject: [PATCH] Bump Java & Gradle stuff --- .metadata | 23 ++++++---- android/app/build.gradle | 23 +++++----- .../stacker/stacker_news_app/MainActivity.kt | 5 +++ android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 42 +++++++++++++++---- 6 files changed, 69 insertions(+), 30 deletions(-) create mode 100644 android/app/src/main/kotlin/news/stacker/stacker_news_app/MainActivity.kt diff --git a/.metadata b/.metadata index 1bcecf0..5f9ea5e 100644 --- a/.metadata +++ b/.metadata @@ -1,11 +1,11 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled. +# This file should be version controlled and should not be manually edited. version: - revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 - channel: stable + revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3" + channel: "stable" project_type: app @@ -13,11 +13,17 @@ project_type: app migration: platforms: - platform: root - create_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 - base_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: android + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + - platform: linux + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 - platform: web - create_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 - base_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2 + create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 # User provided section @@ -26,5 +32,4 @@ migration: # # Files that are not part of the templates will be ignored by default. unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' + - "lib/main.dart" diff --git a/android/app/build.gradle b/android/app/build.gradle index e0b60fd..bc8b778 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,3 +1,10 @@ +plugins { + id "com.android.application" + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,10 +28,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { @@ -37,12 +40,12 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '17' } sourceSets { @@ -82,6 +85,6 @@ flutter { source '../..' } -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} +// dependencies { +// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +// } diff --git a/android/app/src/main/kotlin/news/stacker/stacker_news_app/MainActivity.kt b/android/app/src/main/kotlin/news/stacker/stacker_news_app/MainActivity.kt new file mode 100644 index 0000000..d477d40 --- /dev/null +++ b/android/app/src/main/kotlin/news/stacker/stacker_news_app/MainActivity.kt @@ -0,0 +1,5 @@ +package news.stacker.stacker_news_app + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/android/build.gradle b/android/build.gradle index 2611d1c..d19cbf6 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.8.22' + ext.kotlin_version = '1.7.22' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.3.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..5e6b542 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 44e62bc..211f947 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,11 +1,37 @@ -include ':app' +// include ':app' -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() +// def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +// def properties = new Properties() -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +// assert localPropertiesFile.exists() +// localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +// def flutterSdkPath = properties.getProperty("flutter.sdk") +// assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +// apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" + +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false +} + +include ":app"