Skip to content

Commit a1ab2b5

Browse files
committed
fix: pr comments
1 parent 6889d46 commit a1ab2b5

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,10 @@ open class ExpoPublishingHelper(val brownfieldAppProject: Project) {
354354
/**
355355
* below: some nodes are not dependencies, but pure text, in which case their name is '#text'
356356
*
357-
* only add dependencies with compile scope
357+
* Only add dependencies with compile scope, if scope is null, default to compile
358358
*/
359359
val scope = depNode.getChildNodeByName("scope")?.textContent
360-
if (depNode.nodeName == "dependency" && scope == "compile") {
360+
if (depNode.nodeName == "dependency" && (scope == null || scope == "compile")) {
361361
val groupId = depNode.getChildNodeByName("groupId")!!.textContent
362362
val maybeArtifactId = depNode.getChildNodeByName("artifactId")
363363

@@ -370,7 +370,7 @@ open class ExpoPublishingHelper(val brownfieldAppProject: Project) {
370370
groupId = groupId,
371371
artifactId = artifactId,
372372
version = version,
373-
scope = scope,
373+
scope = scope ?: "compile",
374374
optional = optional?.toBoolean() ?: false,
375375
)
376376

@@ -385,7 +385,8 @@ open class ExpoPublishingHelper(val brownfieldAppProject: Project) {
385385
dependencies: VersionMediatingDependencySet,
386386
) {
387387
listOf("implementation", "api").forEach {
388-
pkgProject.configurations.getByName(it).dependencies.forEach { dep ->
388+
val configuration = pkgProject.configurations.findByName(it)
389+
configuration?.dependencies?.forEach { dep ->
389390
if (dep.group != null) {
390391
dependencies.add(
391392
DependencyInfo.fromGradleDep(

0 commit comments

Comments
 (0)