Files
spring-cloud-contract/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle
2020-12-21 23:10:08 +01:00

143 lines
4.0 KiB
Groovy

buildscript {
repositories {
mavenCentral()
mavenLocal()
if (project.hasProperty('fatJar')) {
jcenter()
}
//For plugin-publish-plugin. Could be limited only to that dependency with Gradle 5.1+ - https://docs.gradle.org/5.1.1/release-notes.html#repository-to-dependency-matching
gradlePluginPortal()
}
dependencies {
classpath "com.bmuschko:gradle-nexus-plugin:2.3"
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3"
classpath 'com.gradle.publish:plugin-publish-plugin:0.11.0'
if (project.hasProperty('fatJar')) {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
}
}
}
ext {
repoUser = System.getenv('REPO_USERNAME') ?: project.findProperty('REPO_USERNAME') ?: ''
repoPass = System.getenv('REPO_PASSWORD') ?: project.findProperty('REPO_PASSWORD') ?: ''
testSystemProperties = [
"WORK_OFFLINE" : gradle.startParameter.isOffline() ? 'TRUE' : 'FALSE'
]
JavaVersion javaVer = JavaVersion.current()
println "Current Java version equal to [${javaVer}]"
javaVersionNumber = javaVer.toString()
}
project.version = findProperty('verifierVersion')
apply plugin: 'groovy'
apply plugin: "java-gradle-plugin"
apply from: "$rootDir/gradle/release.gradle"
//apply plugin: "jacoco"
group = 'org.springframework.cloud'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo.spring.io/libs-release-local" }
maven { url "https://repo.spring.io/libs-staging-local/" }
}
//Dependencies in all subprojects - https://solidsoft.wordpress.com/2014/11/13/gradle-tricks-display-dependencies-for-all-subprojects-in-multi-project-build/
task allDeps(type: DependencyReportTask) {}
task allInsight(type: DependencyInsightReportTask) {}
configurations {
// fixing the groovydoc issue https://stackoverflow.com/questions/20618857/gradle-task-groovydoc-failing-with-noclassdeffounderror
jansi.extendsFrom(runtime)
}
dependencies {
compileOnly gradleApi()
// provide version alignment with project
implementation(platform("org.springframework.cloud:spring-cloud-contract-tools:${project.version}"))
// Need to set the versions manually cause otherwise Gradle will not publish a proper pom
implementation "org.apache.maven.resolver:maven-resolver-api:1.4.1"
implementation "org.eclipse.jgit:org.eclipse.jgit:5.5.1.201910021850-r"
implementation "com.jcraft:jsch.agentproxy.jsch:0.0.9"
implementation "com.fasterxml.jackson.core:jackson-databind:2.11.3"
implementation "org.springframework:spring-core:5.3.2"
implementation("org.springframework.cloud:spring-cloud-contract-shade:${project.version}")
api("org.springframework.cloud:spring-cloud-contract-stub-runner:${project.version}") {
exclude(group: '*')
}
api("org.springframework.cloud:spring-cloud-contract-verifier:${project.version}") {
exclude(group: '*')
}
testImplementation('org.spockframework:spock-core:1.3-groovy-2.5') {
exclude(group: 'org.codehaus.groovy')
}
testImplementation 'info.solidsoft.spock:spock-global-unroll:0.5.0'
testImplementation localGroovy()
testImplementation gradleTestKit()
}
task libtest() {
doLast {
configurations.testCompile.files.each { println it }
}
}
test {
testLogging {
exceptionFormat = 'full'
}
systemProperties = testSystemProperties
enabled = !project.hasProperty('fast')
}
groovydoc {
def title = "IPDS ${version}"
groovyClasspath = project.configurations.jansi
}
dependencies {
jansi 'org.fusesource.jansi:jansi:1.11'
}
/*jacoco {
toolVersion = "0.7.7.201606060606"
}
jacocoTestReport {
reports {
xml.enabled true
}
}*/
jar {
manifest {
attributes 'Implementation-Version': project.version
}
}
task resolveDependencies {
doLast {
project.rootProject.allprojects.each { subProject ->
subProject.buildscript.configurations.each { configuration ->
configuration.resolve()
}
subProject.configurations.each { configuration ->
configuration.resolve()
}
}
}
}