Add release checks
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
apply from: JAVA_SCRIPT
|
||||
apply from: MAVEN_DEPLOYMENT_SCRIPT
|
||||
apply from: "$rootDir/gradle/release-checks.gradle"
|
||||
|
||||
configurations {
|
||||
jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo
|
||||
|
||||
18
gradle/release-checks.gradle
Normal file
18
gradle/release-checks.gradle
Normal file
@@ -0,0 +1,18 @@
|
||||
task checkDependencies << {
|
||||
verifyNoDependenciesMatchingVersion(".*-SNAPSHOT")
|
||||
if(releaseBuild) {
|
||||
verifyNoDependenciesMatchingVersion(".*M.*")
|
||||
verifyNoDependenciesMatchingVersion(".*RC.*")
|
||||
}
|
||||
}
|
||||
|
||||
if(!snapshotBuild) {
|
||||
tasks.findByPath('check')?.dependsOn checkRepositories, checkDependencies
|
||||
}
|
||||
|
||||
def verifyNoDependenciesMatchingVersion(def pattern) {
|
||||
def dependencies = configurations.all*.allDependencies*.findAll { d -> d.version?.matches(pattern) }.flatten().toSet().join("\n ")
|
||||
if(dependencies) {
|
||||
throw new GradleException("${project.name} cannot have dependencies with a version that matches $pattern when its version is ${project.version}. Got\n $dependencies")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user