Skip to content

Commit a5a3dbc

Browse files
jkrshwJesse Kershaw
andauthored
Specify repository for node.js as exclusive by default (#345)
* Specify repository for node.js as exclusive by default By default, gradle checks all repositories in the order they are defined when resolving an artifact, unless a repository is declared that exclusively contains that artifact. In that case only that repository is checked when resolving the artifact. --------- Co-authored-by: Jesse Kershaw <jesse.kershaw@cern.ch>
1 parent 99f46a0 commit a5a3dbc

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/main/kotlin/com/github/gradle/node/NodePlugin.kt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,19 +183,23 @@ class NodePlugin : Plugin<Project> {
183183
}
184184

185185
private fun addRepository(distUrl: String, allowInsecureProtocol: Boolean?) {
186-
project.repositories.ivy {
187-
name = "Node.js"
188-
setUrl(distUrl)
189-
patternLayout {
190-
artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]")
191-
}
192-
metadataSources {
193-
artifact()
186+
project.repositories.exclusiveContent {
187+
forRepository {
188+
project.repositories.ivy {
189+
name = "Node.js"
190+
setUrl(distUrl)
191+
patternLayout {
192+
artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]")
193+
}
194+
metadataSources {
195+
artifact()
196+
}
197+
allowInsecureProtocol?.let { isAllowInsecureProtocol = it }
198+
}
194199
}
195-
content {
200+
filter {
196201
includeModule("org.nodejs", "node")
197202
}
198-
allowInsecureProtocol?.let { isAllowInsecureProtocol = it }
199203
}
200204
}
201205

0 commit comments

Comments
 (0)