From 56256e3b4eb95bbcd47a6c92b1ede2cedbd7474f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Harrault?= <benoit@harrault.fr>
Date: Thu, 5 Oct 2023 10:36:29 +0200
Subject: [PATCH] Upgrade framework, build tools and dependencies

---
 .gitlab-ci.yml                                |   2 +-
 android/app/build.gradle                      |   7 +-
 android/build.gradle                          |   4 +-
 android/gradle.properties                     |   5 +-
 .../gradle/wrapper/gradle-wrapper.properties  |   3 +-
 android/settings.gradle                       |  18 +--
 .../metadata/android/en-US/changelogs/17.txt  |   1 +
 .../metadata/android/fr-FR/changelogs/17.txt  |   1 +
 lib/main.dart                                 |   2 +-
 lib/models/TileModel.dart                     |   2 +-
 pubspec.lock                                  | 127 ++++--------------
 pubspec.yaml                                  |  10 +-
 12 files changed, 50 insertions(+), 132 deletions(-)
 create mode 100644 fastlane/metadata/android/en-US/changelogs/17.txt
 create mode 100644 fastlane/metadata/android/fr-FR/changelogs/17.txt

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9d0e11e..69e9954 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-image: cirrusci/flutter:latest
+image: ghcr.io/cirruslabs/flutter:latest
 
 stages:
   - update
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 87d9194..915bbb8 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -16,7 +16,7 @@ if (gradlePropertiesFile.exists()) {
 
 def flutterRoot = localProperties.getProperty('flutter.sdk')
 if (flutterRoot == null) {
-    throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
+    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
 }
 
 def appVersionCode = gradleProperties.getProperty('app.versionCode')
@@ -40,7 +40,8 @@ if (keystorePropertiesFile.exists()) {
 }
 
 android {
-    compileSdkVersion 28
+    compileSdkVersion 33
+    namespace "org.benoitharrault.memory"
 
     sourceSets {
         main.java.srcDirs += 'src/main/kotlin'
@@ -53,7 +54,7 @@ android {
     defaultConfig {
         applicationId "org.benoitharrault.memory"
         minSdkVersion 16
-        targetSdkVersion 28
+        targetSdkVersion 30
         versionCode appVersionCode.toInteger()
         versionName appVersionName
         archivesBaseName = "$applicationId" + "_" + "$versionCode"
diff --git a/android/build.gradle b/android/build.gradle
index 3100ad2..3716909 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -6,7 +6,7 @@ buildscript {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.5.0'
+        classpath 'com.android.tools.build:gradle:7.2.2'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
     }
 }
@@ -26,6 +26,6 @@ subprojects {
     project.evaluationDependsOn(':app')
 }
 
-task clean(type: Delete) {
+tasks.register("clean", Delete) {
     delete rootProject.buildDir
 }
diff --git a/android/gradle.properties b/android/gradle.properties
index 03c56f6..a910253 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1,6 +1,5 @@
 org.gradle.jvmargs=-Xmx1536M
-android.enableR8=true
 android.useAndroidX=true
 android.enableJetifier=true
-app.versionName=1.0.15
-app.versionCode=16
+app.versionName=1.0.16
+app.versionCode=17
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 296b146..b1159fc 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Fri Jun 23 08:50:38 CEST 2017
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
diff --git a/android/settings.gradle b/android/settings.gradle
index 5a2f14f..44e62bc 100644
--- a/android/settings.gradle
+++ b/android/settings.gradle
@@ -1,15 +1,11 @@
 include ':app'
 
-def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
+def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
+def properties = new Properties()
 
-def plugins = new Properties()
-def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
-if (pluginsFile.exists()) {
-    pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
-}
+assert localPropertiesFile.exists()
+localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
 
-plugins.each { name, path ->
-    def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
-    include ":$name"
-    project(":$name").projectDir = pluginDirectory
-}
+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"
diff --git a/fastlane/metadata/android/en-US/changelogs/17.txt b/fastlane/metadata/android/en-US/changelogs/17.txt
new file mode 100644
index 0000000..209bc5e
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/17.txt
@@ -0,0 +1 @@
+Upgrade framework, build tools and dependencies
diff --git a/fastlane/metadata/android/fr-FR/changelogs/17.txt b/fastlane/metadata/android/fr-FR/changelogs/17.txt
new file mode 100644
index 0000000..f318ef5
--- /dev/null
+++ b/fastlane/metadata/android/fr-FR/changelogs/17.txt
@@ -0,0 +1 @@
+Mise à jour du framework, des outils de construction et des dépendances
diff --git a/lib/main.dart b/lib/main.dart
index 0fa8e72..79bd62e 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -147,7 +147,7 @@ class Tile extends StatefulWidget {
   final int tileIndex;
   final _HomeState? parent;
 
-  Tile({this.imagePathUrl: '', this.tileIndex: 0, this.parent});
+  Tile({this.imagePathUrl = '', this.tileIndex = 0, this.parent});
 
   @override
   _TileState createState() => _TileState();
diff --git a/lib/models/TileModel.dart b/lib/models/TileModel.dart
index 3566639..3df6327 100644
--- a/lib/models/TileModel.dart
+++ b/lib/models/TileModel.dart
@@ -2,7 +2,7 @@ class TileModel {
   String imageAssetPath = "";
   bool isSelected = false;
 
-  TileModel({this.imageAssetPath: "", this.isSelected: false});
+  TileModel({this.imageAssetPath = "", this.isSelected = false});
 
   void setImageAssetPath(String getImageAssetPath) {
     imageAssetPath = getImageAssetPath;
diff --git a/pubspec.lock b/pubspec.lock
index cdd695f..af8a051 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -1,146 +1,71 @@
 # Generated by pub
 # See https://dart.dev/tools/pub/glossary#lockfile
 packages:
-  async:
-    dependency: transitive
-    description:
-      name: async
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "2.9.0"
-  boolean_selector:
-    dependency: transitive
-    description:
-      name: boolean_selector
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "2.1.0"
   characters:
     dependency: transitive
     description:
       name: characters
-      url: "https://pub.dartlang.org"
+      sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
+      url: "https://pub.dev"
     source: hosted
-    version: "1.2.1"
-  clock:
-    dependency: transitive
-    description:
-      name: clock
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "1.1.1"
+    version: "1.3.0"
   collection:
     dependency: transitive
     description:
       name: collection
-      url: "https://pub.dartlang.org"
+      sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
+      url: "https://pub.dev"
     source: hosted
-    version: "1.16.0"
+    version: "1.17.2"
   cupertino_icons:
     dependency: "direct main"
     description:
       name: cupertino_icons
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "1.0.5"
-  fake_async:
-    dependency: transitive
-    description:
-      name: fake_async
-      url: "https://pub.dartlang.org"
+      sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
+      url: "https://pub.dev"
     source: hosted
-    version: "1.3.1"
+    version: "1.0.6"
   flutter:
     dependency: "direct main"
     description: flutter
     source: sdk
     version: "0.0.0"
-  flutter_test:
-    dependency: "direct dev"
-    description: flutter
-    source: sdk
-    version: "0.0.0"
-  matcher:
-    dependency: transitive
-    description:
-      name: matcher
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "0.12.12"
   material_color_utilities:
     dependency: transitive
     description:
       name: material_color_utilities
-      url: "https://pub.dartlang.org"
+      sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
+      url: "https://pub.dev"
     source: hosted
-    version: "0.1.5"
+    version: "0.5.0"
   meta:
     dependency: transitive
     description:
       name: meta
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "1.8.0"
-  path:
-    dependency: transitive
-    description:
-      name: path
-      url: "https://pub.dartlang.org"
+      sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
+      url: "https://pub.dev"
     source: hosted
-    version: "1.8.2"
+    version: "1.9.1"
   sky_engine:
     dependency: transitive
     description: flutter
     source: sdk
     version: "0.0.99"
-  source_span:
-    dependency: transitive
-    description:
-      name: source_span
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "1.9.0"
-  stack_trace:
-    dependency: transitive
-    description:
-      name: stack_trace
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "1.10.0"
-  stream_channel:
-    dependency: transitive
-    description:
-      name: stream_channel
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "2.1.0"
-  string_scanner:
-    dependency: transitive
-    description:
-      name: string_scanner
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "1.1.1"
-  term_glyph:
-    dependency: transitive
-    description:
-      name: term_glyph
-      url: "https://pub.dartlang.org"
-    source: hosted
-    version: "1.2.1"
-  test_api:
+  vector_math:
     dependency: transitive
     description:
-      name: test_api
-      url: "https://pub.dartlang.org"
+      name: vector_math
+      sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
+      url: "https://pub.dev"
     source: hosted
-    version: "0.4.12"
-  vector_math:
+    version: "2.1.4"
+  web:
     dependency: transitive
     description:
-      name: vector_math
-      url: "https://pub.dartlang.org"
+      name: web
+      sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
+      url: "https://pub.dev"
     source: hosted
-    version: "2.1.2"
+    version: "0.1.4-beta"
 sdks:
-  dart: ">=2.17.0-0 <3.0.0"
+  dart: ">=3.1.0-185.0.dev <4.0.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index 3602587..fece5c8 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,19 +1,15 @@
 name: memory
 description: A simple and classic memory game.
-
+publish_to: 'none'
 version: 1.0.0+1
 
 environment:
-  sdk: ">=2.16.1 <3.0.0"
+  sdk: '^3.0.0'
 
 dependencies:
   flutter:
     sdk: flutter
-  cupertino_icons: ^1.0.5
-
-dev_dependencies:
-  flutter_test:
-    sdk: flutter
+  cupertino_icons: ^1.0.6
 
 flutter:
   uses-material-design: true
-- 
GitLab