Skip to content

chore: update example project gradle config #2382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 52 additions & 32 deletions .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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') }}
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down
13 changes: 7 additions & 6 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -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()) {
Expand All @@ -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
Expand All @@ -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
}
Expand Down
32 changes: 24 additions & 8 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -47,8 +46,7 @@ final Map<int, _View> _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) {
Expand Down
Loading
Loading