forked from marytts/marytts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
applicationLogic.gradle
98 lines (82 loc) · 2.88 KB
/
applicationLogic.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
apply plugin: 'application'
dependencies {
runtimeOnly project(':marytts-runtime')
runtimeOnly project(':marytts-languages').subprojects
runtimeOnly project(':voice-cmu-slt-hsmm')
}
mainClassName = 'marytts.server.Mary'
run {
dependsOn installDist
// Define "mary.base"
systemProperties << ['mary.base': installDist.destinationDir]
// Forward server variables
if ("socket.addr" in System.properties) {
systemProperties << ['socket.addr': System.properties["socket.addr"]]
}
if ("socket.port" in System.properties) {
systemProperties << ['socket.port': System.properties["socket.port"]]
}
// Forward logger variables
if (logger.isEnabled(LogLevel.INFO)) {
systemProperties << ['log4j.logger.marytts': 'INFO,stderr']
}
if (logger.isEnabled(LogLevel.DEBUG)) {
systemProperties << ['log4j.logger.marytts': 'DEBUG,stderr']
}
// Override logger
if ("log4j.logger.marytts" in System.properties) {
systemProperties << ["log4j.logger.marytts": System.properties["log4j.logger.marytts"]]
}
doFirst {
classpath += fileTree(installDist.destinationDir).include('lib/voice-*.jar', 'lib/marytts-lang-*.jar')
}
}
task runInstallerGui(type: JavaExec) {
group 'Application'
description 'Runs the MaryTTS Installer GUI as a JVM application'
dependsOn installDist
classpath run.classpath
main 'marytts.tools.install.InstallerGUI'
systemProperties << ['mary.base': installDist.destinationDir]
}
distributions {
main {
contents {
from 'download', {
into 'download'
}
from 'LICENSE.md'
}
}
}
distTar {
compression = Compression.BZIP2
archiveExtension = 'tar.bz2'
}
startScripts {
applicationName = 'marytts-server'
}
task installerGuiStartScripts(type: CreateStartScripts) {
applicationName = 'marytts-component-installer'
outputDir = startScripts.outputDir
classpath = startScripts.classpath
mainClassName = 'marytts.tools.install.InstallerGUI'
startScripts.finalizedBy it
}
tasks.withType(CreateStartScripts) {
group 'Distribution'
description startScripts.description
doLast {
// hack mary.base property into DEFAULT_JVM_OPTS
unixScript.text = unixScript.text.replaceAll('DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-Dmary.base=\\$APP_HOME"')
windowsScript.text = windowsScript.text.replaceAll('set DEFAULT_JVM_OPTS=', 'set DEFAULT_JVM_OPTS="-Dmary.base=%APP_HOME%"')
// hack classpath
unixScript.text = unixScript.text.replaceAll('-classpath "\\\\"\\$CLASSPATH\\\\""', '-classpath "\\\\"\\$APP_HOME/lib/*\\\\""')
windowsScript.text = windowsScript.text.replaceAll('-classpath "%CLASSPATH%"', '-classpath "%APP_HOME%\\\\lib\\\\*"')
}
}
installDist {
preserve {
include 'download/*', 'installed/*', 'lib/**'
}
}