diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index e38482646..b2657d3bb 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -6,6 +6,12 @@ concurrency: on: workflow_call: + inputs: + flutter-versions: + description: 'Flutter versions to test (JSON array)' + required: false + default: '["3.32.5"]' + type: string secrets: APP_ID: required: true @@ -71,6 +77,7 @@ jobs: with: name: agora_rtc_engine_docs.zip path: agora_rtc_engine_docs.zip + pub_publish_check: name: pub publish check if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} @@ -84,12 +91,12 @@ jobs: - run: bash ci/dart_pub_publish_check.sh integration_test_android: - name: Run Flutter Android Integration Tests + name: Run Flutter Android Integration Tests ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: fail-fast: false matrix: - version: ["3.7.0", "3.24.5"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: ubuntu-latest timeout-minutes: 120 env: @@ -122,12 +129,12 @@ jobs: script: bash ci/run_flutter_integration_test_android.sh integration_test_ios: - name: Run Flutter iOS Integration Tests + name: Run Flutter iOS Integration Tests ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: fail-fast: false matrix: - version: ["3.7.0", "3.16"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: macos-latest timeout-minutes: 120 env: @@ -164,12 +171,12 @@ jobs: path: logs-ios/* integration_test_macos: - name: Run Flutter macOS Integration Tests + name: Run Flutter macOS Integration Tests ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: fail-fast: false matrix: - version: ["3.7.0"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: macos-latest timeout-minutes: 120 env: @@ -210,7 +217,7 @@ jobs: path: iris-logs-macos/* integration_test_swiftpm: - name: Run Flutter SwiftPM Integration Tests + name: Run Flutter SwiftPM Integration Tests (${{ matrix.os }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: fail-fast: false @@ -238,12 +245,12 @@ jobs: working-directory: test_shard/integration_test_swiftpm integration_test_windows: - name: Run Flutter Windows Integration Tests + name: Run Flutter Windows Integration Tests ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: fail-fast: false matrix: - version: ["3.7.0", "3.24.5"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: windows-2022 timeout-minutes: 120 env: @@ -271,11 +278,12 @@ jobs: path: ./CrashDumps/* integration_test_web: - name: Run Flutter Web Integration Tests + name: Run Flutter Web Integration Tests ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: + fail-fast: false matrix: - version: ["3.24.5"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: ubuntu-latest timeout-minutes: 60 env: @@ -293,12 +301,12 @@ jobs: bash ci/run_flutter_integration_test_web.sh build_android_ubuntu: - name: Build Android on Ubuntu + name: Build Android on Ubuntu ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: fail-fast: false matrix: - version: ["3.7.12", "3.24.5"] # Need 3.7.12 to build with Gradle 8.x https://github.com/flutter/flutter/issues/124838 + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -317,12 +325,12 @@ jobs: working-directory: example build_android_windows: - name: Build Android on Windows + name: Build Android on Windows ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: fail-fast: false matrix: - version: ["3.7.12", "3.24.5"] # Need 3.7.12 to build with Gradle 8.x https://github.com/flutter/flutter/issues/124838 + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: windows-2022 steps: - uses: actions/checkout@v3 @@ -341,12 +349,12 @@ jobs: working-directory: example build_ios: - name: Build iOS + name: Build iOS ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: fail-fast: false matrix: - version: ["3.7.12"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: macos-latest timeout-minutes: 120 steps: @@ -362,11 +370,12 @@ jobs: # This job aim to cover https://github.com/flutter/flutter/issues/135739 build_ios_xcode_15: - name: Build iOS with xcode 15.x + name: Build iOS with xcode 15.x ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: + fail-fast: false matrix: - version: ["3.24.5"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: macos-13 timeout-minutes: 120 steps: @@ -387,12 +396,12 @@ jobs: working-directory: example build_web: - name: Build Web + name: Build Web ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: fail-fast: false matrix: - version: ["3.7.0", "3.24.5"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: ubuntu-latest timeout-minutes: 120 steps: @@ -409,10 +418,16 @@ jobs: rendering_test_android: name: Run Flutter Android Rendering Tests if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: ubuntu-latest timeout-minutes: 120 env: TEST_APP_ID: ${{ secrets.APP_ID }} + GRADLE_OPTS: "-Xmx4096M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" + ORG_GRADLE_PROJECT_GRADLE_OPTS: "-Xmx4096M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" steps: - uses: actions/checkout@v3 - name: Install JDK @@ -422,7 +437,7 @@ jobs: java-version: '17' - uses: subosito/flutter-action@v2 with: - flutter-version: "3.24.5" + flutter-version: ${{ matrix.version }} cache: true - name: Enable KVM run: | @@ -447,11 +462,12 @@ jobs: path: test_shard/rendering_test/screenshot/*.debug.png rendering_test_ios: - name: Run Flutter iOS Rendering Tests + name: Run Flutter iOS Rendering Tests ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: + fail-fast: false matrix: - version: ["3.24.5"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: macos-13 # Rendering test on ios simulator need macos 13+ timeout-minutes: 60 env: @@ -474,11 +490,12 @@ jobs: path: test_shard/rendering_test/screenshot/*.debug.png rendering_test_macos: - name: Run Flutter macOS Rendering Tests + name: Run Flutter macOS Rendering Tests ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: + fail-fast: false matrix: - version: ["3.24.5"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: macos-latest timeout-minutes: 120 env: @@ -501,11 +518,12 @@ jobs: path: test_shard/rendering_test/screenshot/*.debug.png rendering_test_windows: - name: Run Flutter Windows Rendering Tests + name: Run Flutter Windows Rendering Tests ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: + fail-fast: false matrix: - version: ["3.24.5"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: windows-2022 timeout-minutes: 120 env: @@ -530,11 +548,12 @@ jobs: path: test_shard/rendering_test/screenshot/*.debug.png rendering_test_web: - name: Run Flutter Web Rendering Tests + name: Run Flutter Web Rendering Tests ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: + fail-fast: false matrix: - version: ["3.24.5"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: ubuntu-latest timeout-minutes: 60 env: @@ -560,11 +579,12 @@ jobs: path: test_shard/rendering_test/screenshot/*.debug.png check_android15_16k_page_alignment: - name: Check android15 16k page size alignment + name: Check android15 16k page size alignment ( ${{ matrix.version }}) if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} strategy: + fail-fast: false matrix: - version: ["3.24.5"] + version: ${{ fromJSON(inputs.flutter-versions) }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index fd7ed07e6..bf75a4527 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,3 +1,8 @@ +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()) { @@ -21,14 +26,10 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "io.agora.agora_rtc_ng_example" - compileSdkVersion 34 + compileSdkVersion 35 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -47,7 +48,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "io.agora.agora_rtc_ng_example" minSdkVersion 21 - targetSdkVersion flutter.targetSdkVersion + targetSdkVersion 35 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/example/android/settings.gradle b/example/android/settings.gradle index f860b7645..73ec5fcd8 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,11 +1,27 @@ -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 + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.9.10" apply false +} + +include ':app' -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" \ No newline at end of file diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 66b5c579c..f92762580 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -30,7 +30,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 - permission_handler: ^10.2.0 + permission_handler: ^11.3.0 path_provider: ^2.0.8 dev_dependencies: @@ -42,7 +42,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^1.0.0 + flutter_lints: ^3.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/lib/src/impl/platform/web/global_video_view_controller_platform_web.dart b/lib/src/impl/platform/web/global_video_view_controller_platform_web.dart index faf673aa0..3f828cbe1 100644 --- a/lib/src/impl/platform/web/global_video_view_controller_platform_web.dart +++ b/lib/src/impl/platform/web/global_video_view_controller_platform_web.dart @@ -1,10 +1,9 @@ import 'dart:async'; import 'dart:html' as html; -import 'dart:ui' as ui; +import 'dart:ui_web' as ui; import '/agora_rtc_engine.dart'; import '/src/impl/platform/global_video_view_controller_platform.dart'; -import 'package:iris_method_channel/iris_method_channel.dart'; // ignore_for_file: public_member_api_docs @@ -47,8 +46,7 @@ final Map _viewMap = {}; class GlobalVideoViewControllerWeb extends GlobalVideoViewControllerPlatfrom { GlobalVideoViewControllerWeb( - IrisMethodChannel irisMethodChannel, RtcEngine rtcEngine) - : super(irisMethodChannel, rtcEngine) { + super.irisMethodChannel, super.rtcEngine) { // ignore: undefined_prefixed_name ui.platformViewRegistry.registerViewFactory(_platformRendererViewType, (int viewId) { diff --git a/pubspec.yaml b/pubspec.yaml index d6e152be1..ac3ba2393 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ version: 6.5.2-sp.452140.b.1 homepage: https://www.agora.io repository: https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/tree/main environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=2.19.0 <4.0.0' flutter: '>=3.7.0' dependencies: flutter: diff --git a/test_shard/fake_test_app/android/app/build.gradle b/test_shard/fake_test_app/android/app/build.gradle index c5a9b1b13..cfc9710b4 100644 --- a/test_shard/fake_test_app/android/app/build.gradle +++ b/test_shard/fake_test_app/android/app/build.gradle @@ -1,3 +1,8 @@ +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()) { @@ -21,11 +26,11 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { + // Conditional for compatibility with AGP <4.2. + if (project.android.hasProperty("namespace")) { + namespace 'com.example.fake_test_app' + } compileSdkVersion flutter.compileSdkVersion compileOptions { diff --git a/test_shard/fake_test_app/android/gradle/wrapper/gradle-wrapper.properties b/test_shard/fake_test_app/android/gradle/wrapper/gradle-wrapper.properties index cc5527d78..514d9bb54 100644 --- a/test_shard/fake_test_app/android/gradle/wrapper/gradle-wrapper.properties +++ b/test_shard/fake_test_app/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip diff --git a/test_shard/fake_test_app/android/settings.gradle b/test_shard/fake_test_app/android/settings.gradle index 44e62bcf0..73ec5fcd8 100644 --- a/test_shard/fake_test_app/android/settings.gradle +++ b/test_shard/fake_test_app/android/settings.gradle @@ -1,11 +1,27 @@ -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 + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.9.10" apply false +} + +include ':app' -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/test_shard/integration_test_app/android/app/build.gradle b/test_shard/integration_test_app/android/app/build.gradle index b5d21dc08..f3ca4d703 100644 --- a/test_shard/integration_test_app/android/app/build.gradle +++ b/test_shard/integration_test_app/android/app/build.gradle @@ -1,3 +1,8 @@ +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()) { @@ -21,12 +26,12 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion 34 + // Conditional for compatibility with AGP <4.2. + if (project.android.hasProperty("namespace")) { + namespace 'io.agora.integration_test_app.integration_test_app' + } + compileSdkVersion 35 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/test_shard/integration_test_app/android/gradle/wrapper/gradle-wrapper.properties b/test_shard/integration_test_app/android/gradle/wrapper/gradle-wrapper.properties index cc5527d78..514d9bb54 100644 --- a/test_shard/integration_test_app/android/gradle/wrapper/gradle-wrapper.properties +++ b/test_shard/integration_test_app/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip diff --git a/test_shard/integration_test_app/android/settings.gradle b/test_shard/integration_test_app/android/settings.gradle index 44e62bcf0..73ec5fcd8 100644 --- a/test_shard/integration_test_app/android/settings.gradle +++ b/test_shard/integration_test_app/android/settings.gradle @@ -1,11 +1,27 @@ -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 + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.9.10" apply false +} + +include ':app' -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/test_shard/integration_test_app/pubspec.yaml b/test_shard/integration_test_app/pubspec.yaml index eccf0e41c..0a62b0959 100644 --- a/test_shard/integration_test_app/pubspec.yaml +++ b/test_shard/integration_test_app/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 path_provider: ^2.0.8 - permission_handler: ^8.3.0 + permission_handler: ^11.3.0 dev_dependencies: integration_test: diff --git a/test_shard/iris_tester/android/build.gradle b/test_shard/iris_tester/android/build.gradle index 9ed52b4e5..083346138 100644 --- a/test_shard/iris_tester/android/build.gradle +++ b/test_shard/iris_tester/android/build.gradle @@ -26,7 +26,10 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 34 + if (project.android.hasProperty("namespace")) { + namespace 'com.example.iris_tester' + } + compileSdkVersion 35 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/test_shard/iris_tester/example/android/app/build.gradle b/test_shard/iris_tester/example/android/app/build.gradle index ed16e9786..221bb00bc 100644 --- a/test_shard/iris_tester/example/android/app/build.gradle +++ b/test_shard/iris_tester/example/android/app/build.gradle @@ -1,3 +1,8 @@ +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()) { @@ -21,10 +26,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" - android { compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion diff --git a/test_shard/iris_tester/example/android/gradle/wrapper/gradle-wrapper.properties b/test_shard/iris_tester/example/android/gradle/wrapper/gradle-wrapper.properties index cc5527d78..514d9bb54 100644 --- a/test_shard/iris_tester/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/test_shard/iris_tester/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip diff --git a/test_shard/iris_tester/example/android/settings.gradle b/test_shard/iris_tester/example/android/settings.gradle index 44e62bcf0..73ec5fcd8 100644 --- a/test_shard/iris_tester/example/android/settings.gradle +++ b/test_shard/iris_tester/example/android/settings.gradle @@ -1,11 +1,27 @@ -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 + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.9.10" apply false +} + +include ':app' -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/test_shard/rendering_test/android/app/build.gradle b/test_shard/rendering_test/android/app/build.gradle index ad8cc0050..a728bd699 100644 --- a/test_shard/rendering_test/android/app/build.gradle +++ b/test_shard/rendering_test/android/app/build.gradle @@ -1,3 +1,8 @@ +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()) { @@ -21,11 +26,12 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { + // Conditional for compatibility with AGP <4.2. + if (project.android.hasProperty("namespace")) { + namespace 'com.example.rendering_test' + } + compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion diff --git a/test_shard/rendering_test/android/gradle/wrapper/gradle-wrapper.properties b/test_shard/rendering_test/android/gradle/wrapper/gradle-wrapper.properties index cc5527d78..514d9bb54 100644 --- a/test_shard/rendering_test/android/gradle/wrapper/gradle-wrapper.properties +++ b/test_shard/rendering_test/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip diff --git a/test_shard/rendering_test/android/settings.gradle b/test_shard/rendering_test/android/settings.gradle index 44e62bcf0..73ec5fcd8 100644 --- a/test_shard/rendering_test/android/settings.gradle +++ b/test_shard/rendering_test/android/settings.gradle @@ -1,11 +1,27 @@ -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 + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.9.10" apply false +} + +include ':app' -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"