-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #383 from ThaUnknown/node-js-mobile
feat: node js mobile
- Loading branch information
Showing
22 changed files
with
657 additions
and
2,111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "capacitor/git_modules/nodejs-mobile"] | ||
path = capacitor/git_modules/nodejs-mobile | ||
url = https://github.com/nodejs-mobile/nodejs-mobile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
capacitor/android/app/src/main/java/watch/miru/MainActivity.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
# instructions | ||
# Install Android NDK | ||
# Set $ANDROID_NDK_PATH (example: ~/Android/Sdk/ndk/26.1.10909125) | ||
# install other npm packages like normal | ||
# run this script | ||
|
||
toolchain_target_arch=aarch64 | ||
node_target_arch=arm64 | ||
android_api_level=22 | ||
toolchain_folder=$ANDROID_NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin | ||
export LIBNODE_PATH=$(pwd)/git_modules/nodejs-mobile | ||
|
||
export PATH=$toolchain_folder:$PATH | ||
|
||
export CC=$toolchain_folder/${toolchain_target_arch}-linux-android${android_api_level}-clang | ||
export CXX=$toolchain_folder/${toolchain_target_arch}-linux-android${android_api_level}-clang++ | ||
export LINK=$toolchain_folder/${toolchain_target_arch}-linux-android${android_api_level}-clang++ | ||
export AR=$toolchain_folder/llvm-ar | ||
|
||
export npm_config_verbose=1 | ||
export npm_config_nodedir=${LIBNODE_PATH} | ||
export npm_config_node_gyp=$(pwd)/../node_modules/nodejs-mobile-gyp/bin/node-gyp.js | ||
export npm_config_arch=${node_target_arch} | ||
export npm_config_plaform=android | ||
export npm_config_format=make-android | ||
export npm_gyp_defines="target_arch=$node_target_arch v8_target_arch=$node_target_arch android_target_arch=$node_target_arch host_os=linux OS=android" | ||
|
||
#mv node_modules ../node_modules.bak | ||
# --from-from-source is used by node-pre-gyp | ||
cd public/nodejs | ||
npm rebuild --build-from-source | ||
# Remove executable permissions from native node modules | ||
# find node_modules -iname '*.node' -exec chmod -x '{}' \; | ||
|
||
# buildroot=$(pwd)/ncc | ||
# target=arm64-android | ||
|
||
# buildpath="${buildroot}/${target}" | ||
# if [ ! -d "${buildpath}" ]; then | ||
# mkdir -p "${buildpath}" | ||
# fi | ||
|
||
# ncc build --source-map -d --asset-builds --target es2022 -o ${buildpath} src/offline.ts | ||
|
||
# rm -rf node_modules | ||
# mv ../node_modules.bak node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "nodejs-capacitor-thread", | ||
"private": true, | ||
"dependencies": { | ||
"utp-native": "^2.5.3" | ||
}, | ||
"version": "1.0.0", | ||
"main": "./index.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.