Skip to content

Commit b145afe

Browse files
committed
refactor: integrate mobile cli sample into monorepo
1 parent f32b63b commit b145afe

Some content is hidden

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

70 files changed

+2005
-15794
lines changed

packages/cppjs-core-create-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@cpp.js/sample-web-vue-vite": "workspace:^",
2121
"@cpp.js/sample-backend-nodejs-wasm": "workspace:^",
2222
"@cpp.js/sample-cloud-cloudflare-worker": "workspace:^",
23-
"@cpp.js/sample-mobile-reactnative-nativecli": "1.0.0-beta.13",
23+
"@cpp.js/sample-mobile-reactnative-cli": "workspace:^",
2424
"@cpp.js/sample-mobile-reactnative-expo": "1.0.0-beta.8",
2525
"fs-extra": "^11.2.0",
2626
"kleur": "^4.1.5",

packages/cppjs-core-create-app/src/samples.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import sampleLibCmake from '@cpp.js/sample-lib-cmake/cppjs.config.js';
44
import sampleLibMatrix from '@cpp.js/sample-lib-prebuilt-matrix/cppjs.config.js';
55
import sampleLibSource from '@cpp.js/sample-lib-source/cppjs.config.js';
66

7-
import sampleMobileReactNativeNativeCLI from '@cpp.js/sample-mobile-reactnative-nativecli/cppjs.config.mjs';
7+
import sampleMobileReactNativeCLI from '@cpp.js/sample-mobile-reactnative-cli/cppjs.config.mjs';
88
import sampleMobileReactNativeExpo from '@cpp.js/sample-mobile-reactnative-expo/cppjs.config.mjs';
99

1010
import sampleWebVanilla from '@cpp.js/sample-web-vanilla/cppjs.config.mjs';
@@ -51,7 +51,7 @@ export default {
5151
],
5252
'React Native': {
5353
'Native CLI': {
54-
path: getParentPath(sampleMobileReactNativeNativeCLI.paths.config),
54+
path: getParentPath(sampleMobileReactNativeCLI.paths.config),
5555
},
5656
Expo: {
5757
path: getParentPath(sampleMobileReactNativeExpo.paths.config),

packages/cppjs-sample-mobile-reactnative-nativecli/Gemfile renamed to packages/cppjs-sample-mobile-reactnative-cli/Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ ruby ">= 2.6.10"
66
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
77
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
88
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'

packages/cppjs-sample-mobile-reactnative-nativecli/README.md renamed to packages/cppjs-sample-mobile-reactnative-cli/README.md

+3-3
+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.facebook.react.ReactPackage
99
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1010
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111
import com.facebook.react.defaults.DefaultReactNativeHost
12+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1213
import com.facebook.soloader.SoLoader
1314

1415
class MainApplication : Application(), ReactApplication {
@@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {
3435

3536
override fun onCreate() {
3637
super.onCreate()
37-
SoLoader.init(this, false)
38+
SoLoader.init(this, OpenSourceMergedSoMapping)
3839
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
3940
// If you opted-in for the New Architecture, we load the native entry point for this app.
4041
load()

packages/cppjs-sample-mobile-reactnative-nativecli/android/build.gradle renamed to packages/cppjs-sample-mobile-reactnative-cli/android/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
buildscript {
22
ext {
3-
buildToolsVersion = "34.0.0"
3+
buildToolsVersion = "35.0.0"
44
minSdkVersion = 24
5-
compileSdkVersion = 34
5+
compileSdkVersion = 35
66
targetSdkVersion = 34
77
ndkVersion = "26.1.10909125"
88
kotlinVersion = "1.9.24"

packages/cppjs-sample-mobile-reactnative-nativecli/android/gradle.properties renamed to packages/cppjs-sample-mobile-reactnative-cli/android/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3232
# your application. You should enable this flag either if you want
3333
# to write custom TurboModules/Fabric components OR use libraries that
3434
# are providing them.
35-
newArchEnabled=false
35+
newArchEnabled=true
3636

3737
# Use this property to enable or disable the Hermes JS engine.
3838
# If set to false, you will be using JSC instead.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

packages/cppjs-sample-mobile-reactnative-nativecli/android/gradlew renamed to packages/cppjs-sample-mobile-reactnative-cli/android/gradlew

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

packages/cppjs-sample-mobile-reactnative-nativecli/android/gradlew.bat renamed to packages/cppjs-sample-mobile-reactnative-cli/android/gradlew.bat

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

0 commit comments

Comments
 (0)