Commit 20b9e420 authored by Christian Meyer's avatar Christian Meyer
Browse files

ZmtLaunchPlugin.groovy: added workaround for path normalize issue on windows

parent a53a2fbd
......@@ -14,9 +14,12 @@ public class ZmtLaunchPlugin implements Plugin<Project> {
public static final def LAUNCHER_DEPENDENCY_PROPERTY_NAME = 'launcherDependency'
private static final def MAIN_CLASS_NAME = 'de.zmt.Main'
/** Placeholder text which is replaced by an asterisk in the resulting start scripts. */
private static final def WILDCARD_PLACEHOLDER = 'asterisk-wildcard'
private static final def CONFIGURE = {
apply plugin: 'distribution'
apply plugin: ZmtJavaPlugin.class
distributions.main.contents {
into ('lib') {
......@@ -94,10 +97,21 @@ public class ZmtLaunchPlugin implements Plugin<Project> {
mainClassName = MAIN_CLASS_NAME
startScripts {
/* Although launcher does not depend on other simulations, those
* are needed to be included in the class path to be launched. */
classpath += files('lib/*')
applicationName = 'launcher'
/* Although launcher does not depend on other simulations, those
* are needed to be included in the class path to be launched.
*
* Adding a lib/* directly will lead to an exception when in
* windows, because File.getCanonicalPath() is used thereafter.
* Instead we first use a placeholder which is replaced by the
* asterisk in the final scripts.
*/
classpath += files('lib/' + WILDCARD_PLACEHOLDER)
doLast {
windowsScript.text = windowsScript.text.replace(WILDCARD_PLACEHOLDER, '*')
unixScript.text = unixScript.text.replace(WILDCARD_PLACEHOLDER, '*')
}
}
run {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment