Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -353,18 +353,15 @@ 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,
Expand All @@ -384,11 +381,13 @@ open class ExpoPublishingHelper(val brownfieldAppProject: Project) {
pkgProject: Project,
dependencies: VersionMediatingDependencySet,
) {
val configurations = pkgProject.configurations.matching {
it.name.contains("implementation", ignoreCase = true) || it.name.contains("api", ignoreCase = true)
}
configurations.forEach {
it.dependencies.forEach { dep ->
/**
* 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 ->
if (dep.group != null) {
dependencies.add(
DependencyInfo.fromGradleDep(
Expand Down