Skip to content

Instantly share code, notes, and snippets.

@jlmelville
Created October 27, 2015 17:17
Show Gist options
  • Save jlmelville/2bfe9277e9e2c0ff79b6 to your computer and use it in GitHub Desktop.
Save jlmelville/2bfe9277e9e2c0ff79b6 to your computer and use it in GitHub Desktop.
Workaround for gradle application plugin 'the input line is too long' error on Windows
tasks.withType(CreateStartScripts).each { task ->
task.doLast {
String text = task.windowsScript.text
text = text.replaceFirst(/(set CLASSPATH=%APP_HOME%\\lib\\).*/, { "${it[1]}*" })
task.windowsScript.write text
}
}
@james-d-brown
Copy link

Helpful workaround. A slightly cleaner approach in the same vein is to override the classpath property in the startScripts, which is the pre-configured task of type CreateStartScripts added by the "application" plugin.

startScripts {
    classpath = files( '$APP_HOME/lib/*' )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment