Skip to content

Commit

Permalink
feat(*): add support for new architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Aug 17, 2023
1 parent 4719728 commit 3c5e010
Show file tree
Hide file tree
Showing 116 changed files with 26,158 additions and 7,714 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build Android

on: [push]

jobs:
build:
strategy:
matrix:
newArchEnabled: [false, true]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Install package npm dependencies
run: yarn --frozen-lockfile
shell: bash
- name: Install example npm dependencies
run: yarn example --frozen-lockfile
shell: bash
- name: Build Android test app
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: -PnewArchEnabled=${{matrix.newArchEnabled}} :app:assembleRelease
build-root-directory: example/android
timeout-minutes: 60
63 changes: 0 additions & 63 deletions .github/workflows/build.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/ios-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build iOS

on: [push]

jobs:
build:
strategy:
matrix:
extraEnv: [RCT_NEW_ARCH_ENABLED=0, RCT_NEW_ARCH_ENABLED=1]
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install latest Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Install package npm dependencies
run: yarn --frozen-lockfile
shell: bash
- name: Install example npm dependencies
run: yarn example --frozen-lockfile
shell: bash
- name: Install Pods
run: ${{matrix.extraEnv}} pod install
working-directory: example/ios
- name: Build iOS test app
run: xcodebuild -workspace Example.xcworkspace -scheme Example -destination "platform=iOS Simulator,name=iPhone 14" CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO build
working-directory: example/ios
timeout-minutes: 60
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
- name: Install dependencies
run: yarn install
- name: Lint
run: yarn lint
14 changes: 12 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,22 @@ project.xcworkspace

# Android/IJ
#
.idea
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
android.iml

# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/

# node.js
#
node_modules/
Expand All @@ -54,7 +61,10 @@ android/app/libs
android/keystores/debug.keystore

# Expo
.expo/*
.expo/

# Turborepo
.turbo/

# generated by bob
lib/
45 changes: 45 additions & 0 deletions android/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
THIS_DIR := $(call my-dir)

include $(REACT_ANDROID_DIR)/Android-prebuilt.mk

include ${GENERATED_SRC_DIR}/codegen/jni/Android.mk

include $(CLEAR_VARS)

LOCAL_PATH := $(THIS_DIR)

# Define the library name here.
LOCAL_MODULE := ${CODEGEN_MODULE_NAME}_registration

LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)

LOCAL_SHARED_LIBRARIES := \
libfabricjni \
libfbjni \
libglog \
libjsi \
libreact_codegen_rncore \
libreact_codegen_${CODEGEN_MODULE_NAME} \
libreact_debug \
libreact_nativemodule_core \
libreact_render_componentregistry \
libreact_render_core \
libreact_render_debug \
libreact_render_graphics \
librrc_view \
libruntimeexecutor \
libturbomodulejsijni \
libyoga

ifneq ($(filter $(call modules-get-list),folly_runtime),)
LOCAL_SHARED_LIBRARIES += libfolly_runtime # since [email protected]
else
LOCAL_SHARED_LIBRARIES += libfolly_futures libfolly_json # [email protected]
endif

LOCAL_CFLAGS := \
-DLOG_TAG=\"ReactNative\" \
-DCODEGEN_COMPONENT_DESCRIPTOR_H="<react/renderer/components/${CODEGEN_MODULE_NAME}/ComponentDescriptors.h>"
LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall

include $(BUILD_SHARED_LIBRARY)
Loading

0 comments on commit 3c5e010

Please sign in to comment.