Add maybeCheckForSnapshotDependencies to build.gradle

to check for Snapshot dependencies in release builds.
This commit is contained in:
Florian Schmaus 2014-08-20 20:53:17 +02:00
parent eeea0e34ca
commit 066a4d6c9e
1 changed files with 13 additions and 0 deletions

View File

@ -138,6 +138,19 @@ task distributionZip(type: Zip, dependsOn: [javadocAll, prepareReleasedocs, mark
}
}
task maybeCheckForSnapshotDependencies {
// Don't check for Snapshot dependencies if this is a snapshot.
if (isSnapshot) return
allprojects { project ->
project.configurations.runtime.each {
if (it.toString().contains("-SNAPSHOT"))
throw new Exception("Release build contains snapshot dependencies: " + it)
}
}
}
test { dependsOn maybeCheckForSnapshotDependencies }
jar {
// Root project should not create empty jar artifact
enabled = false