-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuild.gradle
184 lines (156 loc) · 6.33 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
group = "com.nuecho"
version = "1.0.13"
// Configure the java projects release.
def javaProjects = [project(':rivr-core'), project(':rivr-voicexml')]
configure(javaProjects) {
apply plugin: 'java-library'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:5.5'
}
checkstyle.configFile = rootProject.file('checkstyle/checkstyle.xml')
sourceCompatibility = '8'
targetCompatibility = '8'
// Fix for "Unable to get class information" message in checkstyle
checkstyleMain {
classpath += configurations.implementation
classpath += configurations.api
}
checkstyleTest {
classpath += configurations.implementation
classpath += configurations.api
}
eclipse {
project {
natures 'net.sf.eclipsecs.core.CheckstyleNature'
buildCommand 'net.sf.eclipsecs.core.CheckstyleBuilder'
}
classpath {
defaultOutputDir = file("${project.projectDir}/build/classes")
}
}
}
subprojects {
apply plugin: 'eclipse'
group = rootProject.group
version = rootProject.version
def mavenProjects = ['rivr-core', 'rivr-voicexml', 'rivr-voicexml-dialogue-runner']
if (project.name in mavenProjects) {
apply plugin: 'maven-publish'
apply plugin: 'signing'
repositories {
mavenCentral()
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'com.nuecho'
artifactId = project.name
version = rootProject.version
// 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 {
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:[email protected]:nuecho/rivr.git'
connection = 'scm:[email protected]:nuecho/rivr.git'
developerConnection = 'scm:[email protected]: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 = '[email protected]'
}
}
}
}
}
if (rootProject.hasProperty('sonatypeUsername') && rootProject.hasProperty('sonatypePassword')) {
repositories {
maven {
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
}
}
signing {
required {
gradle.taskGraph.hasTask("uploadArchives") // Only sign during release.
}
sign(publishing.publications["maven"])
}
}
}
configure(javaProjects) {
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
maven(MavenPublication) {
from project.components.java
}
}
}
}
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}
)
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 © 2023 <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>."
linksOffline "https://docs.oracle.com/javase/6/docs/api/", "${projectDir}/doc/javadoc-extra/package-lists/javase6"
linksOffline "https://docs.oracle.com/javaee/6/api/", "${projectDir}/doc/javadoc-extra/package-lists/javaee6"
linksOffline "https://www.slf4j.org/api/", "${projectDir}/doc/javadoc-extra/package-lists/slf4j"
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 – API documentation"
}
}
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()
}