Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
181 lines (151 sloc) 6.51 KB
group = "com.nuecho"
version = "1.0.10"
// Configure the java projects release.
def javaProjects = [project(':rivr-core'), project(':rivr-voicexml')]
configure(javaProjects) {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
dependencies { checkstyle 'com.puppycrawl.tools:checkstyle:5.5' }
checkstyle.configFile = rootProject.file('checkstyle/checkstyle.xml')
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
// Fix for Unable to get class information
checkstyleMain { classpath += configurations.compile }
checkstyleTest { classpath += configurations.compile }
eclipse {
project {
natures 'net.sf.eclipsecs.core.CheckstyleNature'
buildCommand 'net.sf.eclipsecs.core.CheckstyleBuilder'
}
classpath {
defaultOutputDir = file("${project.projectDir}/build/classes")
// This should probably be submitted as a patch to the eclipse plugin.
containers.clear()
containers.add("org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6")
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.java
classifier 'sources'
}
// Required for Maven central
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// Maven central release use the "old" uploadArchives mechanism since maven-publish doesn't support signing yet.
artifacts {
archives javadocJar
archives sourcesJar
}
artifacts { archives jar }
}
subprojects {
apply plugin: 'eclipse'
apply plugin: 'ivy-publish' // ivy publishing is for fallback if maven doesn't work.
apply plugin: 'maven'
apply plugin: 'signing'
group = rootProject.group
version = rootProject.version
repositories { mavenCentral() }
signing {
required { gradle.taskGraph.hasTask("uploadArchives") } // Only sign during release.
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer(name: 'mavenCentral') {
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
// Add credentials only if they are present in the project.
// Avoid build failure if not trying to release and user doesn't have proper credentials.
if(project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')){
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
}
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// All these are required for maven central release.
// See https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-6.CentralSyncRequirement
pom.project {
name 'rivr'
description 'Rivr is a lightweight open-source dialogue engine enabling flexible VoiceXML web application development for the agile Java developer and enterprise.'
url 'https://github.com/nuecho/rivr'
scm {
url 'scm:git@github.com:nuecho/rivr.git'
connection 'scm:git@github.com:nuecho/rivr.git'
developerConnection 'scm:git@github.com:nuecho/rivr.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.html'
distribution 'repo'
}
}
developers {
developer {
id 'nuecho'
name 'Nu Echo inc.'
email 'rivr-support@nuecho.com'
}
}
}
}
}
}
}
configure(javaProjects) {
uploadArchives{
repositories {
mavenCentral{
pom.project{ packaging 'jar' }
}
}
}
}
task prepareJavadoc(type: Copy) {
from("${projectDir}/doc/javadoc-extra/") {
include "**"
}
into new java.io.File(buildDir, 'javadoc')
}
task globalJavadoc(type: Javadoc, dependsOn: prepareJavadoc ) {
source javaProjects.collect {project -> project.sourceSets.main.allJava }
destinationDir = new java.io.File(buildDir, 'javadoc')
classpath = files(javaProjects.collect {project -> project.sourceSets.main.compileClasspath})
// To use Java 7 Javadoc:
// gradlew -DjavadocExecutable=/opt/java/java-7/bin/javadoc globalJavadoc
if(System.getProperty("javadocExecutable") != null) {
executable = System.getProperty("javadocExecutable")
}
configure(options) {
splitIndex true
linkSource true
windowTitle "Rivr API documentation"
docTitle "Rivr documentation ($project.version)"
bottom 'Copyright &copy; 2018 <a href="https://www.nuecho.com">Nu Echo Inc.</a>.'
use = true
noTimestamp = true
group("Rivr Core Packages", "com.nuecho.rivr.core*")
group("Rivr VoiceXML Packages", "com.nuecho.rivr.voicexml*")
footer "To report errors, inconsistencies and omissions in the Rivr API documentation, please <a href=\"https://github.com/nuecho/rivr/issues/new\" target=\"_blank\">open an issue</a>."
links "https://download.oracle.com/javase/6/docs/api/"
links "https://download.oracle.com/javaee/6/api/"
links "https://www.slf4j.org/api/"
links "https://json-processing-spec.java.net/nonav/releases/1.0/fcs/javadocs/"
overview = "${projectDir}/doc/javadoc-extra/overview.html"
docTitle "<a href=\"https://github.com/nuecho/rivr\" target=\"_blank\"><img src=\"rivr-logo.png\" /></a><br/>Rivr $project.version &ndash; API documentation"
}
}
wrapper {
gradleVersion '4.10.2'
}
void createVersionFile(File resourceDir, String fileName) {
File versionFile = new File(resourceDir, fileName)
versionFile.getParentFile().mkdirs()
Writer writer = new OutputStreamWriter(new FileOutputStream(versionFile), "utf-8")
writer.write("version=")
writer.write(version)
writer.write("\n")
writer.close()
}