react-native-nitro-unzip 0.2.6 → 0.2.7
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 +2 -0
- package/android/fix-prefab.gradle +54 -0
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -18,6 +18,8 @@ apply plugin: 'kotlin-android'
|
|
|
18
18
|
|
|
19
19
|
// Nitrogen autolinking — adds generated Kotlin sources
|
|
20
20
|
apply from: '../nitrogen/generated/android/NitroUnzip+autolinking.gradle'
|
|
21
|
+
// Fix prefab discovery for sibling project dependencies (e.g. react-native-nitro-modules)
|
|
22
|
+
apply from: './fix-prefab.gradle'
|
|
21
23
|
|
|
22
24
|
android {
|
|
23
25
|
namespace "com.margelo.nitro.unzip"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Workaround for Android prefab + CMake discovery of sibling project .so files.
|
|
2
|
+
// Ensures that when react-native-nitro-modules is built as a local project dependency,
|
|
3
|
+
// its prefab_config.json is regenerated to include the .so file (not just headers).
|
|
4
|
+
// See: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/ExternalNativeJsonGenerator.kt
|
|
5
|
+
|
|
6
|
+
tasks.configureEach { task ->
|
|
7
|
+
def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/
|
|
8
|
+
def matcher = task.name =~ prefabConfigurePattern
|
|
9
|
+
if (matcher.matches()) {
|
|
10
|
+
def variantName = matcher[0][1]
|
|
11
|
+
task.outputs.upToDateWhen { false }
|
|
12
|
+
task.dependsOn("externalNativeBuild${variantName}")
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
afterEvaluate {
|
|
17
|
+
def abis = ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]
|
|
18
|
+
// Check if the root project overrides architectures
|
|
19
|
+
if (rootProject.hasProperty("reactNativeArchitectures")) {
|
|
20
|
+
abis = rootProject.getProperty("reactNativeArchitectures").split(",").toList()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
rootProject.allprojects.each { proj ->
|
|
24
|
+
if (proj === rootProject) return
|
|
25
|
+
|
|
26
|
+
def dependsOnThisLib = proj.configurations.findAll { it.canBeResolved }.any { config ->
|
|
27
|
+
config.dependencies.any { dep ->
|
|
28
|
+
dep.group == project.group && dep.name == project.name
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (!dependsOnThisLib && proj != project) return
|
|
32
|
+
|
|
33
|
+
if (!proj.plugins.hasPlugin('com.android.application') && !proj.plugins.hasPlugin('com.android.library')) {
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
def variants = proj.android.hasProperty('applicationVariants') ? proj.android.applicationVariants : proj.android.libraryVariants
|
|
38
|
+
variants.all { variant ->
|
|
39
|
+
def variantName = variant.name
|
|
40
|
+
abis.each { abi ->
|
|
41
|
+
def searchDir = new File(proj.projectDir, ".cxx/${variantName}")
|
|
42
|
+
if (!searchDir.exists()) return
|
|
43
|
+
def matches = []
|
|
44
|
+
searchDir.eachDir { randomDir ->
|
|
45
|
+
def prefabFile = new File(randomDir, "${abi}/prefab_config.json")
|
|
46
|
+
if (prefabFile.exists()) matches << prefabFile
|
|
47
|
+
}
|
|
48
|
+
matches.each { prefabConfig ->
|
|
49
|
+
prefabConfig.setLastModified(System.currentTimeMillis())
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
package/package.json
CHANGED