-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Supports PLS & Skia renderer via a Kotlin flag! - Adds PLS in the build flow - Fix `premake` for Android adding in the architecture parameter to output the correct version - In `rive-android` the PLS repo name is stored in a secret variable but is effectively pointing to https://github.com/rive-app/rive-pls - Fixes a missing flag for logging in debug builds - Adds a new workflow for `rive-android` to build the AAR on push so we can easily test whether the build succeeds or fails before releasing - Some refactoring to rename some classes, methods, et al. - Some tests (definitely not enough of 'em here!) in Kotlin - Adds a custom runner to make sure we're running on a devices as PLS does not support emulators. Unfortunately, this means we can't run PLS View tests on the Emulator, which is a bit disappointing, but maybe we can figure that out at some point? Or stub it out if/when we *really* need it. - Other miscellaneous fixes Diffs= 9b75cdb96 Rive Renderer Android Integration (#5539) Co-authored-by: Umberto Sonnino <[email protected]>
- Loading branch information
1 parent
280bdc7
commit ab45d45
Showing
60 changed files
with
2,028 additions
and
1,199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
publish: | ||
name: Build the artifacts | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
token: ${{ secrets.PAT_GITHUB }} | ||
|
||
- name: Rive Renderer Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
repository: ${{ secrets.RIVE_RENDERER_REPO }} | ||
token: ${{ secrets.PAT_GITHUB }} | ||
path: ./submodules/pls | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-region: us-west-2 | ||
role-to-assume: ${{ secrets.ACTIONS_ROLE }} | ||
|
||
- name: Update Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "17" | ||
|
||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v2 | ||
|
||
- name: Install NDK & tools | ||
# Starts from: pwd => /home/runner/work/rive/rive | ||
# ANDROID_HOME => /usr/local/lib/android/sdk | ||
run: | | ||
set -x | ||
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'build-tools;30.0.3' platform-tools --sdk_root=${ANDROID_SDK_ROOT} | ||
cd ${ANDROID_HOME} | ||
wget -q https://dl.google.com/android/repository/android-ndk-r25b-linux.zip | ||
unzip -q android-ndk-r25b-linux.zip | ||
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'cmake;3.22.1' --channel=0 --sdk_root=${ANDROID_SDK_ROOT} | ||
- name: Installing pre-requisites | ||
run: | | ||
set -x | ||
# Install some dependencies & premake5 | ||
sudo apt update && sudo apt-get -y install build-essential cmake clang g++ libgl1-mesa-dev libvorbis-dev libvpx-dev ninja-build | ||
wget -q https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-linux.tar.gz | ||
tar -xf premake-5.0.0-alpha15-linux.tar.gz | ||
sudo mv premake5 /usr/local/bin | ||
- name: Build Android | ||
env: | ||
# ANDROID_SDK_ROOT has been in the env by 'setup-android' above | ||
# and is => /usr/local/lib/android/sdk | ||
NDK_PATH: ${{ env.ANDROID_SDK_ROOT }}/android-ndk-r25b | ||
run: ./gradlew kotlin:assembleRelease |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
420d27a5bc052e39f9592f1561070ad509589ed1 | ||
9b75cdb96c2e7dc1f15551cbbf3e0f320759c078 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
app/src/androidTest/java/app/rive/runtime/example/DeviceRunner.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import org.junit.Assume.assumeFalse | ||
import org.junit.runner.notification.RunNotifier | ||
import org.junit.runners.BlockJUnit4ClassRunner | ||
import org.junit.runners.model.FrameworkMethod | ||
import org.junit.runners.model.InitializationError | ||
import org.junit.runners.model.Statement | ||
|
||
annotation class OnDevice | ||
|
||
class RunOnDevice(testClass: Class<*>) : BlockJUnit4ClassRunner(testClass) { | ||
@Throws(InitializationError::class) | ||
constructor(testClass: Class<*>, notifier: RunNotifier) : this(testClass) | ||
|
||
override fun methodBlock(method: FrameworkMethod): Statement { | ||
return object : Statement() { | ||
@Throws(Throwable::class) | ||
override fun evaluate() { | ||
// Check whether this is an emulator. If it is skip the test. | ||
assumeFalse(TestUtils.isProbablyRunningOnEmulator) | ||
// Continue with the usual test | ||
method.invokeExplosively(testClass.javaClass.newInstance()) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.