buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } jcenter() } dependencies { classpath "com.github.adrianbk:gradle-jvmsrc-plugin:0.6.1" classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.1" classpath "com.github.adrianbk:gradle-travisci-trigger-plugin:1.0.0" classpath 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.2' classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0' classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3" classpath "org.asciidoctor:asciidoctor-gradle-plugin:1.5.3" classpath "org.ajoberstar:gradle-git:1.7.2" } } apply from: "$rootDir/gradle/dependencies.gradle" apply from: "$rootDir/gradle/ide.gradle" apply plugin: 'com.github.ben-manes.versions' apply plugin: 'build-dashboard' apply plugin: 'project-report' apply plugin: 'springfox-multi-release' ext { apiKey = System.getenv('GIT_HUB_API_KEY') jdkVersion = 1.6 } allprojects { apply plugin: 'jacoco' } subprojects { //Not strictly groovy projects but useful for the IDE to recognise groovy test sources apply plugin: 'groovy' //gradle groovy plugin extends the java plugin apply plugin: 'com.github.adrianbk.jvmsrc' apply plugin: 'checkstyle' javadoc { options.encoding = 'UTF-8' } //Commented PMD and Findbugs as its taking too much time for very little value //Perhaps run every 20 CI builds (mod of ci build number) // apply from: "$rootDir/gradle/code-quality.gradle" if (springfox.gradlebuild.utils.ProjectDefinitions.publishable(it)) { apply from: "$rootDir/gradle/publishing.gradle" } repositories { jcenter() } checkstyle { configFile = file("$rootDir/config/checkstyle.xml") } checkstyleMain.source = "src/main/java" test { maxParallelForks = 2 } configurations { provided compile.extendsFrom provided } jvmsrc { packageName "springfox" } compileJava.options.encoding = 'UTF-8' sourceCompatibility = jdkVersion targetCompatibility = jdkVersion group = 'io.springfox' version = project.rootProject.version jar { manifest { attributes( 'Implementation-Title': "${project.name}", 'Implementation-Version': version.toString(), 'Created-By': System.getProperty('java.version') + ' (' + System.getProperty('java.vendor') + ')', 'Built-With': "gradle-${project.getGradle().getGradleVersion()}, groovy-${GroovySystem.getVersion()}", 'Build-Time': "${new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")}", 'Built-By': System.getProperty('user.name'), 'Built-On': "${InetAddress.localHost.hostName}/${InetAddress.localHost.hostAddress}" ) } } task allDeps(type: DependencyReportTask) {} jacocoTestReport { reports { xml.enabled true html.enabled true } } test { jvmArgs "-Dorg.spockframework.mock.ignoreByteBuddy=true" } } apply from: "$rootDir/gradle/documentation.gradle" task wrapper(type: Wrapper) { gradleVersion = '3.1' } task codeCoverageReport(type: JacocoReport) { // Gather execution data from all subprojects // (change this if you e.g. want to calculate unit test/integration test coverage separately) executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec") // Add all relevant sourcesets from the subprojects subprojects.each { sourceSets it.sourceSets.main } reports { xml.enabled true xml.destination "${buildDir}/reports/jacoco/report.xml" html.enabled false csv.enabled false } } // always run the tests before generating the report codeCoverageReport.dependsOn { subprojects*.test }