From 49db789847fe1583679edcd89e63fbbff808a3dd Mon Sep 17 00:00:00 2001 From: hurali97 Date: Thu, 31 Oct 2024 14:50:37 +0500 Subject: [PATCH] feat: add comments --- .../src/main/kotlin/com/facebook/react/ReactPlugin.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt b/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt index ce674463102..728edf88797 100644 --- a/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +++ b/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt @@ -260,7 +260,9 @@ class ReactPlugin : Plugin { project.tasks.named("preBuild", Task::class.java).dependsOn(generatePackageListTask) // We tell Android Gradle Plugin that inside /build/generated/autolinking/src/main/java there - // are sources to be compiled as well. + // are sources to be compiled as well. We only compile this code if project is not a library. + // Without this, the compiler will link the generated files to each of the library including + // the ones from OSS, which is not expected. if (!isLibrary) { project.extensions.getByType(AndroidComponentsExtension::class.java).apply { onVariants(selector().all()) { variant ->