Skip to content

Commit 2c576e6

Browse files
committed
add support for new architecture
1 parent 08189f8 commit 2c576e6

23 files changed

+2411
-141
lines changed

.circleci/config.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ jobs:
5555
name: Install dependencies
5656
command: |
5757
corepack enable
58-
yarn install --cwd example --ignore-engines
59-
yarn install --ignore-engines
58+
yarn install
6059
- save_cache:
6160
key: dependencies-{{ checksum "package.json" }}
6261
paths: node_modules
@@ -118,7 +117,7 @@ jobs:
118117
- checkout:
119118
path: ~/project
120119
- node/install:
121-
node-version: 18.17.0
120+
node-version: 22.14.0
122121

123122
- attach_workspace:
124123
at: ~/project
@@ -189,7 +188,7 @@ jobs:
189188
- run:
190189
working_directory: example/test
191190
name: Build
192-
command: npm run build:ios
191+
command: yarn run build:ios
193192

194193
- run:
195194
name: Create and boot iPhone 15 simulator
@@ -206,7 +205,7 @@ jobs:
206205
- run:
207206
working_directory: example/test
208207
name: Run UI Tests
209-
command: npm run test:ios
208+
command: yarn run test:ios
210209

211210
- store_artifacts:
212211
path: ~/.maestro/tests
@@ -229,7 +228,7 @@ jobs:
229228
- run:
230229
name: Install dependencies
231230
command: |
232-
yarn install --ignore-engines
231+
yarn install
233232
234233
- run:
235234
name: Publish the package

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,18 @@ project.xcworkspace
3131

3232
# Android/IJ
3333
#
34+
.classpath
35+
.cxx
3436
.idea
3537
.gradle
38+
.project
39+
.settings
3640
local.properties
3741
android.iml
3842

43+
# Ruby
44+
example/vendor/
45+
3946
# Cocoapods
4047
#
4148
example/ios/Pods
@@ -49,6 +56,15 @@ yarn-error.log
4956
yarn.lock
5057
package-lock.json
5158

59+
# Yarn
60+
.yarn/*
61+
!.yarn/patches
62+
!.yarn/plugins
63+
!.yarn/releases
64+
!.yarn/sdks
65+
!.yarn/versions
66+
67+
5268
# BUCK
5369
buck-out/
5470
\.buckd/
@@ -68,3 +84,8 @@ google-services.json
6884
/.bundle/
6985
/vendor/bundle
7086
/lib/bundler/man/
87+
88+
89+
# React Native Codegen
90+
ios/generated
91+
android/generated

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
22.14.0

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 28 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.6.1.cjs

Lines changed: 874 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.yarnrc.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces
3+
4+
plugins:
5+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
6+
spec: "@yarnpkg/plugin-interactive-tools"
7+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
8+
spec: "@yarnpkg/plugin-workspace-tools"
9+
10+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

android/build.gradle

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,21 @@ buildscript {
2020

2121
dependencies {
2222
classpath("com.android.tools.build:gradle:8.6.1")
23-
classpath("com.facebook.react:react-native-gradle-plugin")
2423
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
2524
}
2625
}
2726
}
2827

2928
apply plugin: 'com.android.library'
3029

30+
def isNewArchitectureEnabled() {
31+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
32+
}
33+
34+
if (isNewArchitectureEnabled()) {
35+
apply plugin: "com.facebook.react"
36+
}
37+
3138
def safeExtGet(prop, fallback) {
3239
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
3340
}
@@ -53,6 +60,18 @@ android {
5360
lintOptions {
5461
disable 'GradleCompatible'
5562
}
63+
buildFeatures {
64+
buildConfig true
65+
}
66+
sourceSets {
67+
main {
68+
if (isNewArchitectureEnabled()) {
69+
java.srcDirs += ["src/newarch"]
70+
} else {
71+
java.srcDirs += ["src/oldarch"]
72+
}
73+
}
74+
}
5675
}
5776

5877
repositories {

0 commit comments

Comments
 (0)