diff --git a/build.gradle b/build.gradle index 026e1380..70590c86 100644 --- a/build.gradle +++ b/build.gradle @@ -76,29 +76,9 @@ def rhinoJar = configurations.library.files.find { jar -> jar.name.startsWith('rhino') } -startScripts { - applicationName = 'helma' - classpath = files('../launcher.jar') - mainClass = 'helma.main.launcher.Main' - - defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon] - - doLast { - // Work-around to make the classpath above work (launcher.jar is located outside of `lib` dir) - // See https://discuss.gradle.org/t/classpath-in-application-plugin-is-building-always-relative-to-app-home-lib-directory/2012 - def unixScriptFile = file getUnixScript() - def windowsScriptFile = file getWindowsScript() - unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib', '$APP_HOME') - windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib', '%APP_HOME%') - } -} - -distributions { - main { - contents { - from project(':launcher').jar - } - } +run { + jvmArgs jettyLogLevel, suppressMacosDockIcon + classpath += fileTree(dir: 'lib/ext', include: '*.jar') } application { @@ -127,6 +107,31 @@ application { } } +startScripts { + applicationName = 'helma' + classpath = files('../launcher.jar') + mainClass = 'helma.main.launcher.Main' + + defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon] + + doLast { + // Work-around to make the classpath above work (launcher.jar is located outside of `lib` dir) + // See https://discuss.gradle.org/t/classpath-in-application-plugin-is-building-always-relative-to-app-home-lib-directory/2012 + def unixScriptFile = file getUnixScript() + def windowsScriptFile = file getWindowsScript() + unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib', '$APP_HOME') + windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib', '%APP_HOME%') + } +} + +distributions { + main { + contents { + from project(':launcher').jar + } + } +} + distTar { dependsOn ':generateLicenseReport', ':javadoc', ':jsdoc' @@ -153,11 +158,6 @@ installDist { } } -run { - jvmArgs jettyLogLevel, suppressMacosDockIcon - classpath += fileTree(dir: 'lib/ext', include: '*.jar') -} - task processSource(type: Sync) { def date = new Date().format("d MMM yyyy") def gitOutput = new ByteArrayOutputStream()