-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
169 lines (155 loc) · 5.1 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
plugins {
id 'java-library'
id 'groovy'
id 'signing'
id 'maven-publish'
}
group 'de.dfki.mary'
version '0.3.0-SNAPSHOT'
description 'Utility classes for MaryTTS voicebuilding'
ext {
url = 'https://github.com/marytts/marytts-voicebuilding'
isReleaseVersion = !version.endsWith("SNAPSHOT")
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
exclusiveContent {
forRepository {
maven {
url 'https://raw.githubusercontent.com/DFKI-MLT/Maven-Repository/main'
}
}
filter {
includeGroup 'de.dfki.lt.jtok'
}
}
}
dependencies {
implementation group: 'de.dfki.mary', name: 'marytts-runtime', version: libs.versions.marytts.get(), {
exclude group: 'com.twmacinta', module: 'fast-md5'
exclude group: 'gov.nist.math', module: 'Jampack'
}
runtimeOnly group: 'xerces', name: 'xercesImpl', version: '2.12.2'
testImplementation group: 'org.testng', name: 'testng', version: '7.5.1'
testImplementation group: 'xmlunit', name: 'xmlunit', version: '1.6'
testRuntimeOnly group: 'de.dfki.mary', name: 'voice-cmu-slt-hsmm', version: libs.versions.marytts.get(), {
transitive = false
}
testRuntimeOnly group: 'de.dfki.mary', name: 'marytts-lang-en', version: libs.versions.marytts.get(), {
transitive = false
}
testRuntimeOnly group: 'de.dfki.mary', name: 'marytts-lang-de', version: libs.versions.marytts.get(), {
transitive = false
}
}
test {
useTestNG()
workingDir = buildDir
testLogging {
exceptionFormat = 'full'
}
}
def batchProcessorIntegrationTestTask = tasks.register('batchProcessorIntegrationTest', JavaExec) {
group 'Verification'
classpath = sourceSets.test.runtimeClasspath
mainClass.set 'marytts.BatchProcessor'
def batchFile = file("$temporaryDir/batch.json")
args batchFile
systemProperty 'mary.base', temporaryDir
if (JavaVersion.current().java9Compatible) {
jvmArgs = [
'--add-opens', 'java.base/java.io=ALL-UNNAMED',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.util=ALL-UNNAMED'
]
}
def outputFile = file("$temporaryDir/output.xml")
doFirst {
def inputFile = file("$temporaryDir/input.txt")
inputFile.text = "Hello from MaryTTS!"
def batch = [
[
locale : Locale.US.toString(),
inputType : 'TEXT',
inputFile : inputFile.path,
outputType: 'ALLOPHONES',
outputFile: outputFile.path
]
]
batchFile.text = new groovy.json.JsonBuilder(batch).toPrettyString()
}
doLast {
assert outputFile.exists()
}
}
def featureListerIntegrationTestTask = tasks.register('featureListerIntegrationTest', JavaExec) {
group 'Verification'
classpath = sourceSets.main.runtimeClasspath
mainClass.set 'marytts.FeatureLister'
systemProperties = [
locale : Locale.US.toString(),
outputFile: new File(temporaryDir, 'features.txt')
]
if (JavaVersion.current().java9Compatible) {
jvmArgs = [
'--add-opens', 'java.base/java.io=ALL-UNNAMED',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.util=ALL-UNNAMED'
]
}
}
tasks.named('check') {
dependsOn batchProcessorIntegrationTestTask,
featureListerIntegrationTestTask
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'MaryTTS Voicebuilding'
url = project.url
description = project.description
inceptionYear = '2015'
licenses {
license {
name = 'GNU Lesser General Public License v3.0'
url = 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html'
}
}
developers {
developer {
id = 'psibre'
name = 'Ingmar Steiner'
}
}
scm {
connection = 'scm:git:https://github.com/marytts/marytts-voicebuilding.git'
developerConnection = 'scm:git:ssh://[email protected]:marytts/marytts-voicebuilding.git'
url = project.url
}
}
}
}
repositories {
maven {
name 'OSSRH'
url isReleaseVersion ? 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
: 'https://oss.sonatype.org/content/repositories/snapshots'
credentials(PasswordCredentials)
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.withType(Sign).configureEach {
onlyIf { isReleaseVersion }
}