@callstack/react-native-brownfield 5.0.0 → 5.0.1

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.
@@ -9,6 +9,7 @@ import org.gradle.api.DefaultTask
9
9
  import org.gradle.api.Project
10
10
  import org.gradle.api.file.ConfigurableFileCollection
11
11
  import org.gradle.api.file.DirectoryProperty
12
+ import org.gradle.api.provider.ListProperty
12
13
  import org.gradle.api.provider.Property
13
14
  import org.gradle.api.tasks.CacheableTask
14
15
  import org.gradle.api.tasks.Input
@@ -50,6 +51,9 @@ abstract class ProcessAndCopyJniLibsTask : DefaultTask() {
50
51
  @get:Input
51
52
  abstract val useStrippedSoFiles: Property<Boolean>
52
53
 
54
+ @get:Input
55
+ abstract val extraIgnoredLibs: ListProperty<String>
56
+
53
57
  @get:OutputDirectory
54
58
  abstract val outputDirectory: DirectoryProperty
55
59
 
@@ -125,7 +129,8 @@ abstract class ProcessAndCopyJniLibsTask : DefaultTask() {
125
129
 
126
130
  private fun matchesAllowedLib(name: String): Boolean {
127
131
  val isCodegenLib = name.startsWith("libreact_codegen_") && name.endsWith(".so")
128
- val isIgnoredLib = IGNORE_EMBEDDED_LIBS.any { lib -> name == lib || name.contains(lib) }
132
+ val ignoredLibs = IGNORE_EMBEDDED_LIBS + extraIgnoredLibs.getOrElse(emptyList())
133
+ val isIgnoredLib = ignoredLibs.any { lib -> name == lib || name.contains(lib) }
129
134
  return name == "libappmodules.so" || isCodegenLib || !isIgnoredLib
130
135
  }
131
136
 
@@ -161,6 +166,7 @@ class JNILibsProcessor(val project: Project) {
161
166
  val processJniTask =
162
167
  project.tasks.register("processCustomJniLibsFor$capitalizedVariantName", ProcessAndCopyJniLibsTask::class.java) {
163
168
  it.useStrippedSoFiles.set(projectExt.useStrippedSoFiles)
169
+ it.extraIgnoredLibs.set(projectExt.ignoreEmbeddedLibs)
164
170
 
165
171
  val jniDirs =
166
172
  aarLibraries.map { aarLib ->
@@ -40,4 +40,17 @@ open class Extension {
40
40
  * listOf("type", "alpha")
41
41
  */
42
42
  var missingDimensionStrategies = listOf<String>()
43
+
44
+ /**
45
+ * Additional .so file names to keep out of the AAR, on top of
46
+ * [com.callstack.react.brownfield.processors.IGNORE_EMBEDDED_LIBS].
47
+ *
48
+ * Use this for libraries that stay declared as dependencies of the published AAR: the
49
+ * host App resolves those from Maven, so embedding them as well leaves two copies of
50
+ * the same .so and the host's native library merge fails.
51
+ *
52
+ * Provide in this format:
53
+ * listOf("libdatadog-ndk.so")
54
+ */
55
+ var ignoreEmbeddedLibs = listOf<String>()
43
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@callstack/react-native-brownfield",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "license": "MIT",
5
5
  "author": "Michal Chudziak <mike.chudziak@callstack.com>",
6
6
  "bin": {