@runanywhere/core 0.16.3 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +49 -0
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Node Binary Detection for Android Studio Compatibility
|
|
3
|
+
// Android Studio doesn't inherit terminal PATH, so we need to find node explicitly
|
|
4
|
+
// =============================================================================
|
|
5
|
+
def findNodeBinary() {
|
|
6
|
+
// Check local.properties first (user can override)
|
|
7
|
+
def localProperties = new Properties()
|
|
8
|
+
def localPropertiesFile = rootProject.file("local.properties")
|
|
9
|
+
if (localPropertiesFile.exists()) {
|
|
10
|
+
localPropertiesFile.withInputStream { localProperties.load(it) }
|
|
11
|
+
def nodePath = localProperties.getProperty("node.path")
|
|
12
|
+
if (nodePath && new File(nodePath).exists()) {
|
|
13
|
+
return nodePath
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Check common node installation paths
|
|
18
|
+
def homeDir = System.getProperty("user.home")
|
|
19
|
+
def nodePaths = [
|
|
20
|
+
"/opt/homebrew/bin/node", // macOS ARM (Apple Silicon)
|
|
21
|
+
"/usr/local/bin/node", // macOS Intel / Linux
|
|
22
|
+
"/usr/bin/node", // Linux system
|
|
23
|
+
"${homeDir}/.nvm/current/bin/node", // nvm
|
|
24
|
+
"${homeDir}/.volta/bin/node", // volta
|
|
25
|
+
"${homeDir}/.asdf/shims/node" // asdf
|
|
26
|
+
]
|
|
27
|
+
for (path in nodePaths) {
|
|
28
|
+
if (new File(path).exists()) {
|
|
29
|
+
return path
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Fallback to 'node' (works if PATH is set correctly in terminal builds)
|
|
34
|
+
return "node"
|
|
35
|
+
}
|
|
36
|
+
|
|
1
37
|
def getExtOrDefault(name) {
|
|
2
38
|
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['RunAnywhereCore_' + name]
|
|
3
39
|
}
|
|
@@ -12,6 +48,11 @@ apply plugin: 'kotlin-android'
|
|
|
12
48
|
apply from: '../nitrogen/generated/android/runanywherecore+autolinking.gradle'
|
|
13
49
|
apply plugin: 'com.facebook.react'
|
|
14
50
|
|
|
51
|
+
// Configure node path for Android Studio builds
|
|
52
|
+
react {
|
|
53
|
+
nodeExecutableAndArgs = [findNodeBinary()]
|
|
54
|
+
}
|
|
55
|
+
|
|
15
56
|
def getExtOrIntegerDefault(name) {
|
|
16
57
|
if (rootProject.ext.has(name)) {
|
|
17
58
|
return rootProject.ext.get(name)
|
|
@@ -167,6 +208,14 @@ task downloadNativeLibs {
|
|
|
167
208
|
return
|
|
168
209
|
}
|
|
169
210
|
|
|
211
|
+
// Check if libs are already bundled (npm install case)
|
|
212
|
+
def bundledLibsDir = file("${jniLibsDir}/arm64-v8a")
|
|
213
|
+
def bundledLibs = bundledLibsDir.exists() ? bundledLibsDir.listFiles()?.findAll { it.name.endsWith(".so") } : []
|
|
214
|
+
if (bundledLibs?.size() > 0) {
|
|
215
|
+
logger.lifecycle("[RunAnywhereCore] ✅ Using bundled native libraries from npm package (${bundledLibs.size()} .so files)")
|
|
216
|
+
return
|
|
217
|
+
}
|
|
218
|
+
|
|
170
219
|
def currentVersion = versionFile.exists() ? versionFile.text.trim() : ""
|
|
171
220
|
if (currentVersion == expectedVersion) {
|
|
172
221
|
logger.lifecycle("[RunAnywhereCore] RACommons version $expectedVersion already downloaded")
|
package/package.json
CHANGED