Skip to content

Commit

Permalink
Merge pull request marytts#1111 from psibre/test-start-scripts
Browse files Browse the repository at this point in the history
Test start scripts
  • Loading branch information
psibre authored Oct 9, 2024
2 parents b333345 + 1f8febe commit 1c2aaa0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion applicationLogic.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ tasks.withType(CreateStartScripts) {
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/*\\\\""')
unixScript.text = unixScript.text.replaceAll('-classpath "\\\$CLASSPATH"', '-classpath "\\\$APP_HOME/lib/*\"')
windowsScript.text = windowsScript.text.replaceAll('-classpath "%CLASSPATH%"', '-classpath "%APP_HOME%\\\\lib\\\\*"')
}
}
Expand All @@ -117,3 +117,18 @@ installDist {
include 'download/*', 'installed/*', 'lib/**'
}
}

def testStartScriptsTask = tasks.register('testStartScripts') {
dependsOn tasks.withType(CreateStartScripts)
doLast {
tasks.withType(CreateStartScripts).each { startScriptTask ->
def unixScript = startScriptTask.unixScript
def lastClasspathLine = unixScript.readLines().findAll { it.contains('-classpath') }.last()
assert lastClasspathLine =~ '\\\$APP_HOME/lib/*': "$unixScript does not contain expected classpath"
}
}
}

tasks.named('check') {
dependsOn testStartScriptsTask
}

0 comments on commit 1c2aaa0

Please sign in to comment.