Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Fix 'the Input Is Too Long' Error on Windows (#843)
Browse files Browse the repository at this point in the history
Fix for the _“The input line is too long”_ error on Windows.

This fix makes Gradle generate a shortened but operational command in `pantheon.bat`.

The modified `pantheon.bat`, instead of explicitly referencing each .jar individually when initializing the classpath, uses the wildcard character `*` instead.
  • Loading branch information
Guillaume Lethuillier authored and shemnon committed Feb 19, 2019
1 parent 44327d7 commit f314685
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,21 @@ run {
}

startScripts {

def shortenWindowsClasspath = { line ->
line = line.replaceAll(/^set CLASSPATH=.*$/, "set CLASSPATH=%APP_HOME%/lib/*")
}

doLast {
unixScript.text = unixScript.text.replace('PANTHEON_HOME', '\$APP_HOME')
windowsScript.text = windowsScript.text.replace('PANTHEON_HOME', '%~dp0..')

// Prevent the error originating from the 8191 chars limit on Windows
windowsScript.text =
windowsScript
.readLines()
.collect(shortenWindowsClasspath)
.join('\r\n')
}
}

Expand Down

0 comments on commit f314685

Please sign in to comment.