plugins { id 'com.github.hierynomus.license' version '0.14.0' id 'net.researchgate.release' version '2.7.0' id 'com.github.ben-manes.versions' version '0.20.0' id 'org.gretty' version '2.2.0' } allprojects { apply plugin: 'maven' group = 'edu.amherst.acdc' repositories { mavenCentral() jcenter() mavenLocal() } ext { jacocoVersion = '0.8.2' } gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" << "-proc:none" } } release { tagTemplate = '$name-$version' git { signTag = true } } } subprojects { apply plugin: 'java' apply plugin: 'maven-publish' apply plugin: 'signing' apply plugin: 'checkstyle' apply plugin: 'com.github.hierynomus.license' apply plugin: 'jacoco' sourceCompatibility = 1.8 targetCompatibility = 1.8 ext { vendor = 'Amherst College' homepage = 'https://www.amherst.edu' docURL = 'https://acdc.amherst.edu/wiki' license = 'Apache 2' camelVersionRange = '[2.18,3)' jenaVersionRange = '[3.8,4)' activemqVersionRange = '[5.14,6)' fcrepoCamelToolboxVersionRange = '[4.7.1,5)' /* Dependencies */ activationApiVersion = '1.2.0' activemqVersion = '5.15.6' camelVersion = '2.22.1' commonsCompressVersion = '1.18' commonsIoVersion = '2.6' commonsLangVersion = '3.8' derbyVersion = '10.14.2.0' fcrepoCamelToolboxVersion = '4.7.2' hk2Version = '2.4.0' httpclientVersion = '4.5.6' httpcoreVersion = '4.4.10' jacksonVersion = '2.9.6' jaxbVersion = '2.3.0' jenaVersion = '3.8.0' junitVersion = '4.12' jsonldVersion = '0.8.3' logbackVersion = '1.2.3' marmottaVersion = '3.3.0' postgresqlVersion = '9.4.1208' saxonVersion = '9.6.0-7' slf4jVersion = '1.7.25' woodstoxVersion = '4.4.1' /* Transitive deps */ fcrepoClientVersion = '0.2.1' /* Testing */ paxExamVersion = '4.12.0' karafVersion = '4.2.1' fcrepoVersion = '4.7.5' osgiCompendiumVersion = '5.0.0' osgiCoreVersion = '6.0.0' /* OSGi */ defaultOsgiImports = 'org.osgi.service.blueprint;version="[1,2)",*' projectOsgiVersion = project.version.replaceAll("-SNAPSHOT", ".SNAPSHOT") } task processConfig(type: Copy) { from('src/main/cfg') { include '**/*.cfg' } into 'build/cfg/main' } task sourceJar(type: Jar) { classifier 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar) { classifier 'javadoc' from javadoc } artifacts { archives javadocJar archives sourceJar } classes { classes.dependsOn processConfig } checkstyle { configFile = rootProject.file('build/checkstyle/checkstyle.xml') configProperties.checkstyleConfigDir = rootProject.file('build/checkstyle/') } jacoco { toolVersion = jacocoVersion } jacocoTestReport { reports { xml.enabled = true html.enabled = true } } license { include "**/*.java" header rootProject.file('build/license/HEADER.txt') strictCheck true mapping { java = 'SLASHSTAR_STYLE' } } publishing { publications { maven(MavenPublication) { from components.java } } } signing { required { !version.endsWith("SNAPSHOT") && gradle.taskGraph.hasTask("uploadArchives") } sign configurations.archives } uploadArchives { repositories.mavenDeployer { def sonatypeUsername = project.hasProperty('ossrhUsername') ? ossrhUsername : "" def sonatypePassword = project.hasProperty('ossrhPassword') ? ossrhPassword : "" beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { authentication(userName: sonatypeUsername, password: sonatypePassword) } snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { authentication(userName: sonatypeUsername, password: sonatypePassword) } pom.project { packaging 'jar' url 'https://acdc.amherst.edu/wiki' inceptionYear '2015' name 'Amherst College Repository Extension Services' description 'Repository Extension Services' organization { name project.vendor url project.homepage } developers { developer { id 'acoburn' name 'Aaron Coburn' email 'acoburn @ (domain of organization url)' organization 'Amherst College' organizationUrl 'https://www.amherst.edu' roles { role 'developer' } timezone '-5' } developer { id 'bseeger' name 'Bethany Seeger' email 'bseeger @ (domain of organization url)' organization 'Amherst College' organizationUrl 'https://www.amherst.edu' roles { role 'developer' } timezone '-5' } } scm { connection 'scm:git:git://gitlab.amherst.edu/acdc/repository-extension-services.git' developerConnection 'scm:git:git@gitlab.amherst.edu:acdc/repository-extension-services.git' url 'https://gitlab.amherst.edu/acdc/repository-extension-services' tag 'HEAD' } licenses { license { name 'Apache License, Version 2.0' url 'http://www.apache.org/licenses/LICENSE-2.0' comments 'Copyright (c) 2016 Amherst College' } } } } } javadoc { if (JavaVersion.current().isJava9Compatible()) { options.addBooleanOption('html5', true) } } if (project.name != 'acrepo-itests') { afterReleaseBuild.dependsOn uploadArchives } } configurations { buildToolsConfig } dependencies { buildToolsConfig "edu.amherst.acdc:acrepo-build-tools:0.1.0" } // Ignore alpha, beta, milestone and release candidates dependencyUpdates.resolutionStrategy = { componentSelection { rules -> rules.all { ComponentSelection selection -> boolean rejected = ['alpha', 'beta', 'rc', 'm'].any { qualifier -> selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ } if (rejected) { selection.reject("Release Candidate") } } } } task processBuildTools(type: Copy) { from { configurations.buildToolsConfig.collect { zipTree(it).matching { include 'checkstyle/*.xml' include 'license/*.txt' } } } into 'build' } task docs(type: Javadoc) { outputs.upToDateWhen { false } source subprojects.collect {project -> project.sourceSets.main.allJava } classpath = files(subprojects.collect {project -> project.sourceSets.main.compileClasspath}) destinationDir = new File(projectDir, "docs/${version}") options { links "http://docs.oracle.com/javase/8/docs/api/" links "http://camel.apache.org/maven/current/camel-core/apidocs/" links "http://marmotta.apache.org/apidocs/" links "https://jena.apache.org/documentation/javadoc/jena/" } } check.dependsOn processBuildTools afterReleaseBuild.dependsOn docs