Skip to content

Commit

Permalink
refactor: integrate mobile cli sample into monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
bugra9 committed Dec 22, 2024
1 parent f32b63b commit b145afe
Show file tree
Hide file tree
Showing 70 changed files with 2,005 additions and 15,794 deletions.
2 changes: 1 addition & 1 deletion packages/cppjs-core-create-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@cpp.js/sample-web-vue-vite": "workspace:^",
"@cpp.js/sample-backend-nodejs-wasm": "workspace:^",
"@cpp.js/sample-cloud-cloudflare-worker": "workspace:^",
"@cpp.js/sample-mobile-reactnative-nativecli": "1.0.0-beta.13",
"@cpp.js/sample-mobile-reactnative-cli": "workspace:^",
"@cpp.js/sample-mobile-reactnative-expo": "1.0.0-beta.8",
"fs-extra": "^11.2.0",
"kleur": "^4.1.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/cppjs-core-create-app/src/samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sampleLibCmake from '@cpp.js/sample-lib-cmake/cppjs.config.js';
import sampleLibMatrix from '@cpp.js/sample-lib-prebuilt-matrix/cppjs.config.js';
import sampleLibSource from '@cpp.js/sample-lib-source/cppjs.config.js';

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

import sampleWebVanilla from '@cpp.js/sample-web-vanilla/cppjs.config.mjs';
Expand Down Expand Up @@ -51,7 +51,7 @@ export default {
],
'React Native': {
'Native CLI': {
path: getParentPath(sampleMobileReactNativeNativeCLI.paths.config),
path: getParentPath(sampleMobileReactNativeCLI.paths.config),
},
Expo: {
path: getParentPath(sampleMobileReactNativeExpo.paths.config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# @cpp.js/sample-mobile-reactnative-nativecli
# @cpp.js/sample-mobile-reactnative-cli
**Cpp.js React Native sample**

<a href="https://www.npmjs.com/package/@cpp.js/sample-mobile-reactnative-nativecli">
<img alt="NPM version" src="https://img.shields.io/npm/v/@cpp.js/sample-mobile-reactnative-nativecli?style=for-the-badge" />
<a href="https://www.npmjs.com/package/@cpp.js/sample-mobile-reactnative-cli">
<img alt="NPM version" src="https://img.shields.io/npm/v/@cpp.js/sample-mobile-reactnative-cli?style=for-the-badge" />
</a>
<a href="https://github.com/bugra9/cpp.js/blob/main/LICENSE">
<img alt="License" src="https://img.shields.io/github/license/bugra9/cpp.js?style=for-the-badge" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader

class MainApplication : Application(), ReactApplication {
Expand All @@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {

override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 34
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

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

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Loading

0 comments on commit b145afe

Please sign in to comment.