feat: support Fabric on Android (#1804)

Most of Android changes for Fabric and bump of FabricExample to RN 0.69.2. iOS and JS changes are available in #1821.
The most notable change on Android is adding methods to components that accept String values of each NumberProp instead of Dynamic. Another change is changed structure of RenderableViewManager.java since we needed to abstract methods that belong only to components inheriting from VirtualView in order to be able to properly override them in their children.
This commit is contained in:
Wojciech Lewicki
2022-08-12 11:42:44 +02:00
committed by GitHub
parent 8f1bda4856
commit 77267be5fc
91 changed files with 7554 additions and 2731 deletions
+62 -16
View File
@@ -1,34 +1,80 @@
name: Test Android build
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/android-build-test.yml'
- 'android/**'
- 'common/**'
- 'Example/android/**'
- 'FabricExample/android/**'
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: Example
strategy:
matrix:
working-directory: [Example, FabricExample]
concurrency:
group: android-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
- name: Check out Git repository
uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
node-version: 14
cache: 'yarn'
cache-dependency-path: 'Example/yarn.lock'
- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn
java-version: '11'
- name: Accept licenses
run: /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
- name: Restore svg node_modules from cache
uses: actions/cache@v2
id: cache-node-modules-svg
with:
path: |
node_modules
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-svg
- name: Install svg node_modules
run: yarn install --frozen-lockfile
- name: Restore app node_modules from cache
uses: actions/cache@v2
id: cache-node-modules-app
with:
path: |
${{ matrix.working-directory }}/node_modules
key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }}
restore-keys: |
${{ runner.os }}-node-modules-${{ matrix.working-directory }}-
- name: Install app node_modules
working-directory: ${{ matrix.working-directory }}
run: yarn install --frozen-lockfile
- name: Restore build from cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
android/build
android/.cxx
${{ matrix.working-directory }}/android/build
${{ matrix.working-directory }}/android/.cxx
${{ matrix.working-directory }}/android/.gradle
${{ matrix.working-directory }}/android/app/build
${{ matrix.working-directory }}/android/app/.cxx
${{ matrix.working-directory }}/node_modules/react-native/ReactAndroid/build
${{ matrix.working-directory }}/node_modules/react-native/ReactAndroid/hermes-engine/build
${{ matrix.working-directory }}/node_modules/react-native/ReactAndroid/hermes-engine/.cxx
key: ${{ runner.os }}-build5-${{ matrix.working-directory }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'android/build.gradle', format('{0}/node_modules/react-native/sdks/.hermesversion', matrix.working-directory)) }}
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}/android
run: ./gradlew assembleDebug --console=plain
working-directory: ${{ matrix.working-directory }}/android
run: ./gradlew assembleDebug --build-cache --console=plain -PreactNativeArchitectures=arm64-v8a