From 390f5642222b1f7d119f293f895154284c4f52a0 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Tue, 3 Sep 2024 16:58:00 -0400 Subject: [PATCH 1/2] Update to latest gradle file formats --- android/app/build.gradle | 66 ++++++++++++---------------------------- android/build.gradle | 36 +++++++++++++--------- android/settings.gradle | 30 +++++++++++++----- pubspec.lock | 20 ++++++------ pubspec.yaml | 6 ++-- 5 files changed, 76 insertions(+), 82 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 53178d0..19567c4 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,24 +1,8 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -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 = '3' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '0.9.0' +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 keystoreProperties = new Properties() @@ -27,36 +11,29 @@ if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion 34 - ndkVersion flutter.ndkVersion + namespace = "social.myportal.relatica" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + jvmTarget = JavaVersion.VERSION_1_8 } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "social.myportal.relatica" + applicationId = "social.myportal.relatica" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion 21 - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName } signingConfigs { @@ -75,19 +52,16 @@ android { } } + buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.release + signingConfig = signingConfigs.release } } } flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + source = "../.." } diff --git a/android/build.gradle b/android/build.gradle index f475bc5..cb184a1 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,16 +1,3 @@ -buildscript { - ext.kotlin_version = '1.9.10' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.1.3' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() @@ -18,12 +5,31 @@ allprojects { } } -rootProject.buildDir = '../build' +rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { - project.evaluationDependsOn(':app') + // fix for verifyReleaseResources + // ============ + afterEvaluate { project -> + if (project.plugins.hasPlugin("com.android.application") || + project.plugins.hasPlugin("com.android.library")) { + project.android { + compileSdkVersion 34 + buildToolsVersion "34.0.0" + } + } + if (project.hasProperty("android")) { + project.android { + if (namespace == null) { + namespace project.group + } + } + } + } + // ============ + project.evaluationDependsOn(":app") } tasks.register("clean", Delete) { diff --git a/android/settings.gradle b/android/settings.gradle index 44e62bc..536165d 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -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.7.10" apply false +} + +include ":app" diff --git a/pubspec.lock b/pubspec.lock index c37f5b5..d763ca8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -852,10 +852,10 @@ packages: dependency: "direct main" description: name: media_kit - sha256: "3289062540e3b8b9746e5c50d95bd78a9289826b7227e253dff806d002b9e67a" + sha256: "1f1deee148533d75129a6f38251ff8388e33ee05fc2d20a6a80e57d6051b7b62" url: "https://pub.dev" source: hosted - version: "1.1.10+1" + version: "1.1.11" media_kit_libs_android_video: dependency: transitive description: @@ -892,34 +892,34 @@ packages: dependency: "direct main" description: name: media_kit_libs_video - sha256: "3688e0c31482074578652bf038ce6301a5d21e1eda6b54fc3117ffeb4bdba067" + sha256: "20bb4aefa8fece282b59580e1cd8528117297083a6640c98c2e98cfc96b93288" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" media_kit_libs_windows_video: dependency: transitive description: name: media_kit_libs_windows_video - sha256: "7bace5f35d9afcc7f9b5cdadb7541d2191a66bb3fc71bfa11c1395b3360f6122" + sha256: "32654572167825c42c55466f5d08eee23ea11061c84aa91b09d0e0f69bdd0887" url: "https://pub.dev" source: hosted - version: "1.0.9" + version: "1.0.10" media_kit_native_event_loop: dependency: transitive description: name: media_kit_native_event_loop - sha256: a605cf185499d14d58935b8784955a92a4bf0ff4e19a23de3d17a9106303930e + sha256: "7d82e3b3e9ded5c35c3146c5ba1da3118d1dd8ac3435bac7f29f458181471b40" url: "https://pub.dev" source: hosted - version: "1.0.8" + version: "1.0.9" media_kit_video: dependency: "direct main" description: name: media_kit_video - sha256: c048d11a19e379aebbe810647636e3fc6d18374637e2ae12def4ff8a4b99a882 + sha256: "2cc3b966679963ba25a4ce5b771e532a521ebde7c6aa20e9802bec95d9916c8f" url: "https://pub.dev" source: hosted - version: "1.2.4" + version: "1.2.5" meta: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 47c2abf..1def432 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,9 +37,9 @@ dependencies: logging: ^1.2.0 markdown: ^7.2.2 ## TODO Media Kit Update - media_kit: ^1.1.10 # Primary package. - media_kit_libs_video: ^1.0.4 # Native video dependencies. - media_kit_video: ^1.2.4 # For video rendering. + media_kit: ^1.1.11 # Primary package. + media_kit_libs_video: ^1.0.5 # Native video dependencies. + media_kit_video: ^1.2.5 # For video rendering. multi_trigger_autocomplete: ^1.0.0 network_to_file_image: ^6.0.1 objectbox: ^4.0.1 From 86d2943602ab1ede11752b211b5956d53e435c97 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Tue, 3 Sep 2024 16:58:48 -0400 Subject: [PATCH 2/2] Update install.md with new versions and location --- install.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.md b/install.md index 144e9dc..345b685 100644 --- a/install.md +++ b/install.md @@ -6,12 +6,12 @@ For more information about the current beta testing program # Latest Binaries: -* Android v0.11.0 Is available by invitation through Play Store beta (please see me for access) - or [this self-installable ZIP file](https://mysocialportal-relatica.nyc3.cdn.digitaloceanspaces.com/v0.11.0/relatica_v0.11.0.apk.zip) -* iPhone/iPad v0.11.0: This is only available through TestFlight. Please contact me for access. -* [Windows (Intel) v0.11.0](https://mysocialportal-relatica.nyc3.cdn.digitaloceanspaces.com/v0.11.0/relatica_v0.11.0_win_x64.zip) -* macOS v0.11.0:This is only available through TestFlight. Please contact me for access. -* [Linux v0.11.0 (tested on Ubuntu 20 and 22)](https://mysocialportal-relatica.nyc3.cdn.digitaloceanspaces.com/v0.11.0/relatica_v0.11.0_linux_x64.zip) +* Android v0.12.0 Is available by invitation through Play Store beta (please see me for access) + or [this self-installable ZIP file](https://mysocialportal-relatica.nyc3.cdn.digitaloceanspaces.com/v0.12.0/relatica_v0.12.0.apk.zip) +* iPhone/iPad v0.12.0: This is only available through TestFlight. Please contact me for access. +* [Windows (Intel) v0.12.0](https://mysocialportal-relatica.nyc3.cdn.digitaloceanspaces.com/v0.12.0/relatica_v0.12.0_win_x64.zip) +* macOS v0.12.0:This is only available through TestFlight. Please contact me for access. +* [Linux v0.12.0 (tested on Ubuntu 20 and 22)](https://mysocialportal-relatica.nyc3.cdn.digitaloceanspaces.com/v0.12.0/relatica_v0.12.0_linux_x64.zip) ## Mobile