From cf71eaf643566e2ce1d5f7a0d46ca4d74dae7e16 Mon Sep 17 00:00:00 2001 From: Hur Ali Date: Tue, 24 Feb 2026 12:59:45 +0500 Subject: [PATCH 1/4] fix: missing runtime and duplicate dependencies --- .../brownfield/expo/ExpoPublishingHelper.kt | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt b/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt index 348bddba..d22b3578 100644 --- a/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt +++ b/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt @@ -353,18 +353,16 @@ open class ExpoPublishingHelper(val brownfieldAppProject: Project) { depNodeList.childNodes.forEach { depNode -> /** * below: some nodes are not dependencies, but pure text, in which case their name is '#text' - * - * Only add dependencies with compile scope, if scope is null, default to compile */ - val scope = depNode.getChildNodeByName("scope")?.textContent - if (depNode.nodeName == "dependency" && (scope == null || scope == "compile")) { + if (depNode.nodeName == "dependency") { val groupId = depNode.getChildNodeByName("groupId")!!.textContent val maybeArtifactId = depNode.getChildNodeByName("artifactId") val artifactId = maybeArtifactId!!.textContent val version = depNode.getChildNodeByName("version")?.textContent val optional = depNode.getChildNodeByName("optional")?.textContent - + val scope = depNode.getChildNodeByName("scope")?.textContent + val dependencyInfo = DependencyInfo( groupId = groupId, @@ -384,8 +382,25 @@ open class ExpoPublishingHelper(val brownfieldAppProject: Project) { pkgProject: Project, dependencies: VersionMediatingDependencySet, ) { + val excludedConfigurationNameParts = + setOf( + "test", + "androidTest", + "kapt", + "annotationProcessor", + "lint", + "detached", + ) val configurations = pkgProject.configurations.matching { - it.name.contains("implementation", ignoreCase = true) || it.name.contains("api", ignoreCase = true) + val includeByName = + it.name.contains("implementation", ignoreCase = true) || + it.name.contains("api", ignoreCase = true) + + val excludedByName = excludedConfigurationNameParts.any { excluded -> + it.name.contains(excluded, ignoreCase = true) + } + + includeByName && !excludedByName } configurations.forEach { it.dependencies.forEach { dep -> From a4dad1954cc6a31833e2624711ac893a5c8636bd Mon Sep 17 00:00:00 2001 From: Hur Ali Date: Tue, 24 Feb 2026 13:10:48 +0500 Subject: [PATCH 2/4] Update gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt b/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt index d22b3578..b3462293 100644 --- a/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt +++ b/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt @@ -362,7 +362,6 @@ open class ExpoPublishingHelper(val brownfieldAppProject: Project) { val version = depNode.getChildNodeByName("version")?.textContent val optional = depNode.getChildNodeByName("optional")?.textContent val scope = depNode.getChildNodeByName("scope")?.textContent - val dependencyInfo = DependencyInfo( groupId = groupId, From ac131557de3120de770a1c8c5def49e72472170e Mon Sep 17 00:00:00 2001 From: Hur Ali Date: Tue, 24 Feb 2026 13:24:28 +0500 Subject: [PATCH 3/4] refactor: make the impl simpler --- .../brownfield/expo/ExpoPublishingHelper.kt | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt b/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt index b3462293..3fe7a548 100644 --- a/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt +++ b/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt @@ -381,28 +381,9 @@ open class ExpoPublishingHelper(val brownfieldAppProject: Project) { pkgProject: Project, dependencies: VersionMediatingDependencySet, ) { - val excludedConfigurationNameParts = - setOf( - "test", - "androidTest", - "kapt", - "annotationProcessor", - "lint", - "detached", - ) - val configurations = pkgProject.configurations.matching { - val includeByName = - it.name.contains("implementation", ignoreCase = true) || - it.name.contains("api", ignoreCase = true) - - val excludedByName = excludedConfigurationNameParts.any { excluded -> - it.name.contains(excluded, ignoreCase = true) - } - - includeByName && !excludedByName - } - configurations.forEach { - it.dependencies.forEach { dep -> + listOf("implementation", "api", "runtime").forEach { + val configuration = pkgProject.configurations.findByName(it) + configuration?.dependencies?.forEach { dep -> if (dep.group != null) { dependencies.add( DependencyInfo.fromGradleDep( From e728572daafa9e36164c14cc7062c9fb89e1a8bc Mon Sep 17 00:00:00 2001 From: Hur Ali Date: Tue, 24 Feb 2026 13:25:30 +0500 Subject: [PATCH 4/4] docs: add comments --- .../callstack/react/brownfield/expo/ExpoPublishingHelper.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt b/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt index 3fe7a548..15f9a9c5 100644 --- a/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt +++ b/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt @@ -381,6 +381,10 @@ open class ExpoPublishingHelper(val brownfieldAppProject: Project) { pkgProject: Project, dependencies: VersionMediatingDependencySet, ) { + /** + * Not accounting for variant specific configurations as Expo packages are not + * using it. Should we face any issues/needs to account for it, we can do it here. + */ listOf("implementation", "api", "runtime").forEach { val configuration = pkgProject.configurations.findByName(it) configuration?.dependencies?.forEach { dep ->