Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// @generated by expo-module-scripts
module.exports = require('expo-module-scripts/eslintrc.base.js');
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ build/
.gradle
local.properties
*.iml
android/.cxx

# BUCK
buck-out/
Expand Down
38 changes: 37 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# Don't ignore large binaries
!android/libnode/bin/*/libnode.so
!ios/NodeMobile.framework/NodeMobile
!ios/NodeMobile.framework/NodeMobile

# Ignore example apps
#
example/*
benchmark/*
android/build
android/.cxx

# Xcode
#
ios/build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace


# Android/IntelliJ
#
android/build/
.idea
.gradle
local.properties
*.iml
60 changes: 18 additions & 42 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,56 +1,35 @@
apply plugin: 'com.android.library'

buildscript {
repositories {
mavenCentral()
}
group = 'com.nodejsmobile.reactnative'
version = '0.1.0'

dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
apply from: expoModulesCorePlugin
applyKotlinExpoModulesCorePlugin()
useCoreDependencies()
useExpoPublishing()

buildscript {
ext.safeExtGet = { prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
}

apply plugin: 'com.android.library'

def _nodeTargetSdkVersion = ((rootProject?.ext?.properties?.targetSdkVersion) ?: 30)
def _nodeMinSdkVersion = ((rootProject?.ext?.properties?.minSdkVersion) ?: 24)
def _nodeTargetSdkVersion = safeExtGet("targetSdkVersion", 30)
def _nodeMinSdkVersion = safeExtGet("minSdkVersion", 24)
def _compileNativeModulesSdkVersion = _nodeMinSdkVersion;
def _nodeVersionRequired = 18
if (_compileNativeModulesSdkVersion<24) {
// 24 is the minimum sdk version Node is built with.
_compileNativeModulesSdkVersion=24;
}
def DoesAppAlreadyDefineWantedSTL() {
// Since react-native 0.59.0, the Application already defines libc++_shared as the APP_STL.
// Defining it also in this plugin would lead to a build error when merging assets.
try {
def _reactAndroidPropertiesFile = file("${rootDir}/../node_modules/react-native/ReactAndroid/gradle.properties");
def _reactAndroidProperties = new Properties()
if (_reactAndroidPropertiesFile.exists())
{
_reactAndroidPropertiesFile.withInputStream { _reactAndroidProperties.load(it) }
}
def _semver = _reactAndroidProperties.getProperty("VERSION_NAME").tokenize('.');
if (_semver.size() != 3) {
return false
}
def _major = _semver[0].toInteger()
def _minor = _semver[1].toInteger()
if ( _major > 0 || (_major == 0 && _minor >= 59) ) {
return true
} else {
return false
}

} catch ( Exception e ) {
return false
}
}

def _isCorrectSTLDefinedByApp = DoesAppAlreadyDefineWantedSTL()

android {
compileSdkVersion ((rootProject?.ext?.properties?.compileSdkVersion) ?: 24)
buildToolsVersion ((rootProject?.ext?.properties?.buildToolsVersion) ?: "30.0.2")
namespace "com.nodejsmobile.reactnative"

compileSdkVersion safeExtGet("compileSdkVersion", 34)
buildToolsVersion safeExtGet("buildToolsVersion", "30.0.2")

ndkVersion ((rootProject?.ext?.ndkVersion) ?: "24.0.8215888")

Expand All @@ -62,9 +41,6 @@ android {
externalNativeBuild {
cmake {
cppFlags ""
if(!_isCorrectSTLDefinedByApp) {
arguments "-DANDROID_STL=c++_shared"
}
}
}
ndk {
Expand Down
5 changes: 1 addition & 4 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.janeasystems.rn_nodejs_mobile">

<manifest>
</manifest>

Loading