@runanywhere/core 0.16.3 → 0.16.5
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 +48 -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,10 @@ 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
|
+
// Access the react extension and set nodeExecutableAndArgs
|
|
53
|
+
project.extensions.findByName('react')?.nodeExecutableAndArgs?.set([findNodeBinary()])
|
|
54
|
+
|
|
15
55
|
def getExtOrIntegerDefault(name) {
|
|
16
56
|
if (rootProject.ext.has(name)) {
|
|
17
57
|
return rootProject.ext.get(name)
|
|
@@ -167,6 +207,14 @@ task downloadNativeLibs {
|
|
|
167
207
|
return
|
|
168
208
|
}
|
|
169
209
|
|
|
210
|
+
// Check if libs are already bundled (npm install case)
|
|
211
|
+
def bundledLibsDir = file("${jniLibsDir}/arm64-v8a")
|
|
212
|
+
def bundledLibs = bundledLibsDir.exists() ? bundledLibsDir.listFiles()?.findAll { it.name.endsWith(".so") } : []
|
|
213
|
+
if (bundledLibs?.size() > 0) {
|
|
214
|
+
logger.lifecycle("[RunAnywhereCore] ✅ Using bundled native libraries from npm package (${bundledLibs.size()} .so files)")
|
|
215
|
+
return
|
|
216
|
+
}
|
|
217
|
+
|
|
170
218
|
def currentVersion = versionFile.exists() ? versionFile.text.trim() : ""
|
|
171
219
|
if (currentVersion == expectedVersion) {
|
|
172
220
|
logger.lifecycle("[RunAnywhereCore] RACommons version $expectedVersion already downloaded")
|
package/package.json
CHANGED