Skip to content

Commit

Permalink
Merge pull request #161 from a-mabe/dep-imperative-apply
Browse files Browse the repository at this point in the history
Changes for deprecated imperative apply of Flutter's Gradle plugins
  • Loading branch information
a-mabe authored Aug 11, 2024
2 parents 76cd6aa + 15e2380 commit 5c709e1
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 65 deletions.
16 changes: 6 additions & 10 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,10 +22,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()) {
Expand Down Expand Up @@ -89,6 +86,5 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.multidex:multidex:2.0.0"
}
13 changes: 0 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '2.0.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand Down
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
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
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

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"
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.9.24" apply false
}

include ":app"
46 changes: 15 additions & 31 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ packages:
source: hosted
version: "0.1.21"
audioplayers:
dependency: "direct main"
dependency: transitive
description:
name: audioplayers
sha256: "752039d6aa752597c98ec212e9759519061759e402e7da59a511f39d43aa07d2"
Expand Down Expand Up @@ -101,10 +101,10 @@ packages:
dependency: "direct main"
description:
name: background_hiit_timer
sha256: "5ddd1a49f46cd15bd60c0ef647ac822a0494bf0a7a854d75468274686a08c63a"
sha256: de6b085e5a845a55433a0637da98e0b6da2e81d9b0c5549122b326cea0ae5e56
url: "https://pub.dev"
source: hosted
version: "1.0.0-dev.5"
version: "1.0.0-dev.6"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -286,14 +286,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_fgbg:
dependency: transitive
description:
name: flutter_fgbg
sha256: "08c4d2fd229e3df26083d5aecc3dea9ff4f2d188f8cd57aaf2b3f047bd08a047"
url: "https://pub.dev"
source: hosted
version: "0.3.0"
flutter_launcher_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -452,18 +444,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -508,18 +500,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.15.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -720,14 +712,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.8"
real_volume:
dependency: "direct main"
description:
name: real_volume
sha256: "62eed4f0e79f5f18f8ade65073043e1566c10e35e01b3c75ff60462d6f76bcdc"
url: "https://pub.dev"
source: hosted
version: "1.0.8"
rxdart:
dependency: transitive
description:
Expand Down Expand Up @@ -953,10 +937,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
version: "0.7.2"
timer_count_down:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1033,10 +1017,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
url: "https://pub.dev"
source: hosted
version: "14.2.1"
version: "14.2.4"
wakelock_plus:
dependency: "direct main"
description:
Expand Down
4 changes: 1 addition & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ dependencies:
sqflite: ^2.2.8+2
uuid: ^4.2.2
timer_count_down: ^2.2.2
audioplayers: ^6.0.0
confetti: ^0.7.0
sqflite_common_ffi: ^2.2.5
wakelock_plus: ^1.0.0
flutter_launcher_icons: ^0.13.1
coverage: ^1.6.3
flutter_material_color_picker: ^1.2.0

background_hiit_timer: 1.0.0-dev.5
background_hiit_timer: 1.0.0-dev.6
just_audio: ^0.9.35
soundpool: ^2.4.1
auto_size_text: ^3.0.0
Expand All @@ -62,7 +61,6 @@ dependencies:
fluttertoast: ^8.2.5
file_saver: ^0.2.13
permission_handler: ^11.3.1
real_volume: ^1.0.8
shared_preferences: ^2.2.3

flutter_launcher_icons:
Expand Down

0 comments on commit 5c709e1

Please sign in to comment.