Skip to content

Commit db5c239

Browse files
committed
chore: split example apps
1 parent 8c0099c commit db5c239

47 files changed

Lines changed: 1403 additions & 23 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ jobs:
358358
uses: ./.github/actions/setup-toolchain
359359
with:
360360
platform: macos
361-
project-root: packages/app/example
361+
project-root: packages/example-macos
362362
cache-key-prefix: example
363363
xcode-developer-dir: /Applications/Xcode_16.4.app/Contents/Developer
364364
- name: Set up react-native@canary
@@ -373,7 +373,7 @@ jobs:
373373
- name: Bundle JavaScript
374374
run: |
375375
yarn build:macos
376-
working-directory: packages/app/example
376+
working-directory: packages/example-macos
377377
- name: Determine whether the macOS app needs to be built
378378
id: affected
379379
uses: ./.github/actions/affected
@@ -382,22 +382,22 @@ jobs:
382382
uses: ./.github/actions/cocoapods
383383
with:
384384
project-directory: macos
385-
working-directory: packages/app/example
385+
working-directory: packages/example-macos
386386
- name: Build
387387
if: ${{ steps.affected.outputs.macos != '' }}
388388
run: |
389-
../../../scripts/xcodebuild.sh macos/Example.xcworkspace build-for-testing
390-
working-directory: packages/app/example
389+
../../scripts/xcodebuild.sh macos/Example.xcworkspace build-for-testing
390+
working-directory: packages/example-macos
391391
- name: Test `react-native config`
392392
if: ${{ steps.affected.outputs.macos != '' }}
393393
run: |
394394
node --test test/config.test.mjs
395-
working-directory: packages/app/example
395+
working-directory: packages/example-macos
396396
- name: Test
397397
if: ${{ steps.affected.outputs.macos != '' && github.event_name != 'schedule' }}
398398
run: |
399-
../../../scripts/xcodebuild.sh macos/Example.xcworkspace test-without-building
400-
working-directory: packages/app/example
399+
../../scripts/xcodebuild.sh macos/Example.xcworkspace test-without-building
400+
working-directory: packages/example-macos
401401
timeout-minutes: 60
402402
macos-template:
403403
name: "macOS [template]"
@@ -571,14 +571,15 @@ jobs:
571571
- name: Bundle JavaScript
572572
run: |
573573
yarn build:windows
574+
working-directory: packages/example-windows
574575
- name: Generate Visual Studio solution
575576
run: |
576-
node ../windows/app.mjs --msbuildprops WindowsTargetPlatformVersion=$env:WindowsTargetPlatformVersion
577-
working-directory: packages/app/example
577+
node ../app/windows/app.mjs --msbuildprops WindowsTargetPlatformVersion=$env:WindowsTargetPlatformVersion
578+
working-directory: packages/example-windows
578579
- name: Test `react-native config`
579580
run: |
580581
node --test test/config.test.mjs
581-
working-directory: packages/app/example
582+
working-directory: packages/example-windows
582583
- name: Determine whether the Windows app needs to be built
583584
id: affected
584585
uses: ./.github/actions/affected
@@ -591,7 +592,7 @@ jobs:
591592
} else {
592593
yarn ci:windows --arch ${{ matrix.platform }}
593594
}
594-
working-directory: packages/app/example
595+
working-directory: packages/example-windows
595596
continue-on-error: true
596597
# GitHub Actions currently does not support outputs from jobs with matrices
597598
# The workaround is to upload artifacts to communicate between jobs
@@ -617,15 +618,15 @@ jobs:
617618
uses: actions/upload-artifact@v7
618619
with:
619620
name: windows-msbuild.binlog
620-
path: packages/app/example/windows/*.binlog
621+
path: packages/example-windows/windows/*.binlog
621622
retention-days: 14
622623
overwrite: true
623624
- name: Test
624625
if: ${{ steps.affected.outputs.windows != '' && matrix.platform == 'x64' && steps.build.outcome == 'success' }}
625626
run: |
626-
../../../scripts/build/MSBuild.ps1 -Configuration ${{ matrix.configuration }} -Platform ${{ matrix.platform }} -Target Build ReactAppTests.vcxproj
627-
../../../scripts/build/VSTest.ps1 ${{ matrix.platform }}\${{ matrix.configuration }}\ReactAppTests.dll
628-
working-directory: packages/app/example/windows/ReactAppTests
627+
../../../app/scripts/build/MSBuild.ps1 -Configuration ${{ matrix.configuration }} -Platform ${{ matrix.platform }} -Target Build ReactAppTests.vcxproj
628+
../../../app/scripts/build/VSTest.ps1 ${{ matrix.platform }}\${{ matrix.configuration }}\ReactAppTests.dll
629+
working-directory: packages/example-windows/windows/ReactAppTests
629630
timeout-minutes: 60
630631
windows-template:
631632
name: "Windows [template]"

.yarnrc.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
catalog:
2+
"@babel/core": ^7.25.2
3+
"@babel/preset-env": ^7.25.3
4+
"@rnx-kit/cli": ^1.0.0
5+
"@rnx-kit/metro-config": ^2.2.3
6+
"@rnx-kit/polyfills": ^0.2.0
7+
"@rnx-kit/tsconfig": ^3.0.1
8+
"@wdio/types": ^9.20.0
9+
appium: ^3.1.1
10+
appium-uiautomator2-driver: ^7.0.0
11+
appium-xcuitest-driver: ^10.0.0
112
compressionLevel: 0
213
enableGlobalCache: false
314
enableScripts: false

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"workspaces": [
1616
".",
1717
"packages/app",
18-
"packages/app/example"
18+
"packages/app/example",
19+
"packages/example-*"
1920
],
2021
"scripts": {
2122
"format": "nx run-many --target format:c,format:js,format:swift",

packages/example-macos/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*.binlog
2+
*.hprof
3+
*.xcworkspace/
4+
*.zip
5+
.DS_Store
6+
.bundle/*
7+
!.bundle/config
8+
.gradle/
9+
.idea/
10+
.vs/
11+
.xcode.env
12+
Pods/
13+
build/
14+
dist/*
15+
!dist/.gitignore
16+
local.properties
17+
msbuild.binlog
18+
node_modules/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
buildscript {
2+
apply(from: {
3+
def searchDir = rootDir.toPath()
4+
do {
5+
def p = searchDir.resolve("node_modules/react-native-test-app/android/dependencies.gradle")
6+
if (p.toFile().exists()) {
7+
return p.toRealPath().toString()
8+
}
9+
} while (searchDir = searchDir.getParent())
10+
throw new GradleException("Could not find `react-native-test-app`");
11+
}())
12+
13+
repositories {
14+
mavenCentral()
15+
google()
16+
}
17+
18+
dependencies {
19+
getReactNativeDependencies().each { dependency ->
20+
classpath(dependency)
21+
}
22+
}
23+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the Gradle Daemon. The setting is
11+
# particularly useful for configuring JVM memory settings for build performance.
12+
# This does not affect the JVM settings for the Gradle client VM.
13+
# The default is `-Xmx512m -XX:MaxMetaspaceSize=256m`.
14+
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
15+
16+
# When configured, Gradle will fork up to org.gradle.workers.max JVMs to execute
17+
# projects in parallel. To learn more about parallel task execution, see the
18+
# section on Gradle build performance:
19+
# https://docs.gradle.org/current/userguide/performance.html#parallel_execution.
20+
# Default is `false`.
21+
#org.gradle.parallel=true
22+
23+
# AndroidX package structure to make it clearer which packages are bundled with the
24+
# Android operating system, and which are packaged with your app's APK
25+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
26+
android.useAndroidX=true
27+
# Automatically convert third-party libraries to use AndroidX
28+
#android.enableJetifier=true
29+
# Jetifier randomly fails on these libraries
30+
#android.jetifier.ignorelist=hermes-android,react-android
31+
32+
# Use this property to specify which architecture you want to build.
33+
# You can also override it from the CLI using
34+
# ./gradlew <task> -PreactNativeArchitectures=x86_64
35+
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
36+
37+
# Use this property to enable support to the new architecture.
38+
# This will allow you to use TurboModules and the Fabric render in
39+
# your application. You should enable this flag either if you want
40+
# to write custom TurboModules/Fabric components OR use libraries that
41+
# are providing them.
42+
# Note that this is incompatible with web debugging.
43+
#newArchEnabled=true
44+
#bridgelessEnabled=true
45+
46+
# Uncomment the line below to build React Native from source.
47+
#react.buildFromSource=true
48+
49+
# Version of Android NDK to build against.
50+
#ANDROID_NDK_VERSION=26.1.10909125
51+
52+
# Version of Kotlin to build against.
53+
#KOTLIN_VERSION=1.8.22
42.4 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)