Skip to content
Open
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
24 changes: 14 additions & 10 deletions src/main/kotlin/com/github/gradle/node/NodePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,23 @@ class NodePlugin : Plugin<Project> {
}

private fun addRepository(distUrl: String, allowInsecureProtocol: Boolean?) {
project.repositories.ivy {
name = "Node.js"
setUrl(distUrl)
patternLayout {
artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]")
}
metadataSources {
artifact()
project.repositories.exclusiveContent {
forRepository {
project.repositories.ivy {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One doubt I have is that this first adds the ivy repository to the declared repositories, and then newly added repository is passed in to project.repositories.exclusiveContent.

Looking through the gradle code that seems fine, and I couldn't find any other supported way to create an ivy repository other than through project.repositories.ivy

name = "Node.js"
setUrl(distUrl)
patternLayout {
artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]")
}
metadataSources {
artifact()
}
allowInsecureProtocol?.let { isAllowInsecureProtocol = it }
}
}
content {
filter {
includeModule("org.nodejs", "node")
}
allowInsecureProtocol?.let { isAllowInsecureProtocol = it }
}
}

Expand Down