mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-01 18:52:08 +01:00
build.gradle: Do not resolve runtime configuration to early
as it would cause "Cannot change dependencies of configuration after it has been included in dependency resolution" errors with Gradle >= 3. Thanks to James Justinic for pointing this out.
This commit is contained in:
parent
3a79566f1c
commit
80b6e30196
1 changed files with 12 additions and 5 deletions
17
build.gradle
17
build.gradle
|
@ -245,11 +245,18 @@ task distributionZip(type: Zip, dependsOn: [javadocAll, prepareReleasedocs, mark
|
||||||
|
|
||||||
task maybeCheckForSnapshotDependencies {
|
task maybeCheckForSnapshotDependencies {
|
||||||
// Don't check for Snapshot dependencies if this is a snapshot.
|
// Don't check for Snapshot dependencies if this is a snapshot.
|
||||||
if (isSnapshot) return
|
onlyIf { isReleaseVersion }
|
||||||
allprojects { project ->
|
// Run in the execution phase, not in configuration phase, as the
|
||||||
project.configurations.runtime.each {
|
// 'each' forces the runtime configuration to be resovled, which
|
||||||
if (it.toString().contains("-SNAPSHOT"))
|
// causes "Cannot change dependencies of configuration after it
|
||||||
throw new Exception("Release build contains snapshot dependencies: " + it)
|
// has been included in dependency resolution." errors.
|
||||||
|
// See https://discuss.gradle.org/t/23153
|
||||||
|
doLast {
|
||||||
|
allprojects { project ->
|
||||||
|
project.configurations.runtime.each {
|
||||||
|
if (it.toString().contains("-SNAPSHOT"))
|
||||||
|
throw new Exception("Release build contains snapshot dependencies: " + it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue