Skip to content

Commit

Permalink
feat: [android] Implement flutter texture rendering (#1246)
Browse files Browse the repository at this point in the history
* feat: [android] Implement flutter texture rendering
  • Loading branch information
littleGnAl authored Aug 10, 2023
1 parent 32af54a commit 7fd8fee
Show file tree
Hide file tree
Showing 70 changed files with 27,640 additions and 139 deletions.
104 changes: 51 additions & 53 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,61 +146,59 @@ jobs:
run: flutter build ios --no-codesign
working-directory: example

# Temporarily disable android screenshot test at this time, see EP-232.
# rendering_test_android:
# name: Run Flutter Android Integration Tests
# strategy:
# matrix:
# version: ['3.0.0']
# runs-on: macos-12
# timeout-minutes: 120
# env:
# TEST_APP_ID: ${{ secrets.MY_APP_ID }}
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-java@v1
# with:
# java-version: '11'
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: ${{ matrix.version }}
# cache: true
# - name: Checkout hoe
# uses: actions/checkout@v3
# with:
# repository: littleGnAl/hoe
# ref: littlegnal/update
# path: hoe
# - name: Download iris artifacts
# if: ${{ contains(github.event.pull_request.labels.*.name, 'integration_test:iris_artifacts') }}
# run: |
# source scripts/artifacts_version.sh
# Run android rendering test in macos is more stable
rendering_test_android:
name: Run Flutter Android Rendering Tests
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
runs-on: macos-12
timeout-minutes: 120
env:
TEST_APP_ID: ${{ secrets.MY_APP_ID }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: '11'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.0.0'
cache: true
- name: Checkout hoe
uses: actions/checkout@v3
with:
repository: littleGnAl/hoe
ref: littlegnal/update
path: hoe
- name: Download iris artifacts
if: ${{ contains(github.event.pull_request.labels.*.name, 'integration_test:iris_artifacts') }}
run: |
source scripts/artifacts_version.sh
# PROJECT_DIR=$(pwd)
PROJECT_DIR=$(pwd)
# mkdir -p output
# cd hoe
# dart pub get
# dart run bin/hoe.dart build-agora-flutter-example \
# --setup-local-dev \
# --project-dir=${PROJECT_DIR} \
# --artifacts-output-dir=${PROJECT_DIR}/output \
# --platforms=android,macos \
# --apple-package-name=io.agora.agoraRtcEngineExample \
# --flutter-package-name=agora_rtc_engine \
# --iris-android-cdn-url=${IRIS_CDN_URL_ANDROID} \
# --iris-macos-cdn-url=${IRIS_CDN_URL_MACOS}
# - run: flutter config --enable-macos-desktop
# - name: run flutter android integration tests
# uses: reactivecircus/android-emulator-runner@v2.21.0
# with:
# api-level: 31
# arch: x86_64
# profile: Nexus 6
# ram-size: 2048M
# heap-size: 4096M
# disk-size: 8192M
# script: bash ci/rendering_test_android.sh
mkdir -p output
cd hoe
dart pub get
dart run bin/hoe.dart build-agora-flutter-example \
--setup-local-dev \
--project-dir=${PROJECT_DIR} \
--artifacts-output-dir=${PROJECT_DIR}/output \
--platforms=android,macos \
--apple-package-name=io.agora.agoraRtcEngineExample \
--flutter-package-name=agora_rtc_engine \
--iris-android-cdn-url=${IRIS_CDN_URL_ANDROID} \
--iris-macos-cdn-url=${IRIS_CDN_URL_MACOS}
- run: flutter config --enable-macos-desktop
- name: run flutter android integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
arch: x86_64
profile: pixel_5
ram-size: 2048M
heap-size: 4096M
disk-size: 8192M
script: bash ci/rendering_test_android.sh

rendering_test_macos:
name: Run Flutter macOS Rendering Tests
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
.packages
build/
third_party/
!android/src/main/cpp/third_party/

**/flutter/ephemeral/*
**/generated_plugin_registrant.cc
**/generated_plugin_registrant.h
**/generated_plugins.cmake
**/GeneratedPluginRegistrant.swift
**/.plugin_dev

.ccls-cache/
6 changes: 6 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ android {
main.jniLibs.srcDirs += 'libs'
}
}

externalNativeBuild {
cmake {
path 'src/main/cpp/CMakeLists.txt'
}
}
}

dependencies {
Expand Down
39 changes: 39 additions & 0 deletions android/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# The Flutter tooling requires that developers have CMake 3.10 or later
# installed. You should not increase this version, as doing so will cause
# the plugin to fail to compile for some customers of the plugin.
cmake_minimum_required(VERSION 3.10)

set(LIBRARY_NAME iris_rendering_android)

set(LIBRARY_VERSION "0.1.0")

project(${LIBRARY_NAME} VERSION ${LIBRARY_VERSION})

set(SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/vm_util.h"
"${CMAKE_CURRENT_SOURCE_DIR}/iris_rtc_rendering_android.cc"
)

add_library(${LIBRARY_NAME} SHARED
${SOURCES}
)

find_library(log-lib log)
find_library(android-lib android)
target_link_libraries(${LIBRARY_NAME}
PRIVATE
${log-lib}
${android-lib}
GLESv2
EGL
)

set(THIRD_PARTY_INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/include/iris"
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/include/agora_rtc"
)

target_include_directories(${LIBRARY_NAME} PRIVATE
"$<BUILD_INTERFACE:${THIRD_PARTY_INCLUDE_DIRS}>"
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>"
)
Loading

0 comments on commit 7fd8fee

Please sign in to comment.