122 lines
3.4 KiB
Groovy
122 lines
3.4 KiB
Groovy
plugins {
|
|
id "org.sonarqube" version "2.7"
|
|
id "me.champeau.gradle.jmh" version "0.4.8"
|
|
id 'org.asciidoctor.convert' version '1.6.0'
|
|
id "org.ajoberstar.github-pages" version "1.7.2"
|
|
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
|
|
}
|
|
apply plugin: 'idea'
|
|
apply from: "${rootDir}/libraries.gradle"
|
|
|
|
ext {
|
|
releaseVersion = '1.3.3'
|
|
}
|
|
|
|
allprojects {
|
|
apply plugin: 'jacoco'
|
|
apply plugin: 'me.champeau.gradle.jmh'
|
|
|
|
version = '2.0.0-SNAPSHOT'
|
|
group 'io.github.swagger2markup'
|
|
description = 'swagger2markup Build'
|
|
|
|
repositories {
|
|
jcenter()
|
|
mavenCentral()
|
|
}
|
|
}
|
|
//artifactoryPublish.skip = true // apply to all projects except the root
|
|
|
|
ext {
|
|
coreProjects = subprojects.findAll {
|
|
p -> !p.name.contains("documentation") && !p.name.endsWith("-bom")
|
|
}
|
|
}
|
|
|
|
configure(project.coreProjects) {
|
|
apply plugin: 'java'
|
|
apply plugin: 'java-library'
|
|
apply plugin: 'maven'
|
|
apply plugin: 'maven-publish'
|
|
apply from: "${rootDir}/publishing.gradle"
|
|
apply plugin: 'jacoco'
|
|
|
|
tasks.withType(JavaCompile) {
|
|
sourceCompatibility = "11"
|
|
targetCompatibility = "11"
|
|
options.deprecation = true
|
|
options.encoding = 'UTF-8'
|
|
options.compilerArgs += ["-Xlint:unchecked", "-parameters"]
|
|
}
|
|
tasks.withType(Javadoc){
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
jmh {
|
|
duplicateClassesStrategy = 'warn'
|
|
}
|
|
configurations.all {
|
|
resolutionStrategy {
|
|
failOnVersionConflict()
|
|
}
|
|
}
|
|
}
|
|
|
|
nexusPublishing {
|
|
repositories {
|
|
sonatype()
|
|
}
|
|
}
|
|
|
|
sonarqube {
|
|
properties {
|
|
property "sonar.host.url", "https://sonarcloud.io"
|
|
property "sonar.organization", "swagger2markup"
|
|
property "sonar.projectName", "swagger2markup"
|
|
property "sonar.projectKey", "Swagger2Markup_swagger2markup"
|
|
property "sonar.links.homepage", "https://github.com/Swagger2Markup/swagger2markup"
|
|
property "sonar.links.ci", "https://travis-ci.org/Swagger2Markup/swagger2markup"
|
|
property "sonar.links.scm", "https://github.com/Swagger2Markup/swagger2markup"
|
|
property "sonar.links.issue", "https://github.com/Swagger2Markup/swagger2markup/issues"
|
|
property "sonar.language", "java"
|
|
}
|
|
}
|
|
def allTestCoverageFile = "$buildDir/jacoco/allTestCoverage.exec"
|
|
|
|
task jacocoMergeTest(type: JacocoMerge) {
|
|
destinationFile = file(allTestCoverageFile)
|
|
executionData = project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')
|
|
}
|
|
|
|
task jacocoMerge(dependsOn: ['jacocoMergeTest']) {
|
|
// used to run the other merge tasks
|
|
}
|
|
|
|
subprojects {
|
|
sonarqube {
|
|
properties {
|
|
property "sonar.jacoco.reportPaths", allTestCoverageFile
|
|
}
|
|
}
|
|
afterEvaluate {
|
|
// exclude subprojects that don't produce a jar file or by design.
|
|
if (!project.name.equals('swagger2markup-bom') && !project.name.equals('swagger2markup-documentation')) {
|
|
jar {
|
|
into("META-INF/maven/$project.group/$project.name") {
|
|
from {generatePomFileForMavenJavaPublication}
|
|
rename ".*", "pom.xml"
|
|
}
|
|
inputs.property('moduleName', moduleName)
|
|
manifest.attributes(
|
|
'Automatic-Module-Name': moduleName
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.check.dependsOn tasks.jacocoTestReport
|
|
|
|
test {
|
|
dependsOn(subprojects.test) // required by cobertura to aggregate report
|
|
}
|