* Attempt to keep Kotlin totally off the classpath * Add version header for new class * Fix a few bugs with the samples and provide better debugging output for javaexec * Use main consistently * Fix Gradle's published pom and use maven-publish plugin consistently throughout plugin and samples * Re-add groovydoc jar * Have assemble create the groovydoc jar * Switch to publishToMavenLocal * Sync dependencies with pom.xml and fix null provider for Gradle versions less than 6.2 * Perform quoting conditionally for Windows only * Add jsch, aether, and shaded libraries to round out compatibility * Ensure contract tests are generated before kotlin compile task
142 lines
3.8 KiB
Groovy
142 lines
3.8 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}"))
|
|
|
|
implementation "org.apache.maven.resolver:maven-resolver-api"
|
|
implementation "org.eclipse.jgit:org.eclipse.jgit"
|
|
implementation "com.jcraft:jsch.agentproxy.jsch"
|
|
implementation "com.fasterxml.jackson.core:jackson-databind"
|
|
|
|
implementation "org.springframework:spring-core"
|
|
implementation("org.springframework.cloud:spring-cloud-contract-shade")
|
|
api("org.springframework.cloud:spring-cloud-contract-stub-runner") {
|
|
exclude(group: '*')
|
|
}
|
|
api("org.springframework.cloud:spring-cloud-contract-verifier") {
|
|
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()
|
|
}
|
|
}
|
|
}
|
|
}
|