Skip to content

Commit

Permalink
Merge pull request #564 from maxandersen/userlibconfig
Browse files Browse the repository at this point in the history
Add current dir lib/* and lib/logging to classpath
  • Loading branch information
jonbullock authored Nov 10, 2018
2 parents 00ff192 + 810b627 commit aebf496
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gradle/application.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ startScripts {
* The startScripts produces scripts that contain `$APP_HOME/lib/lib` in the classpath
* so we need to tweak it a bit to be able to add the whole lib directory to the classpath :|
*
* While we are add it we add current dir + lib/logging and lib/* to allow user to setup logging
* and additional/override jar dependencies.
* See https://stackoverflow.com/questions/10518603/adding-classpath-entries-using-gradles-application-plugin
*/
doLast {
def windowsScriptFile = file getWindowsScript()
def unixScriptFile = file getUnixScript()
windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib\\lib', '%APP_HOME%\\lib\\*')
unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib/lib', '$APP_HOME/lib/*')
windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib\\lib', '%DIRNAME%\\lib\\logging;%DIRNAME%\\lib\\*;%APP_HOME%\\lib\\*')
unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib/lib', '$SAVED/lib/logging:$SAVED/lib/*:$APP_HOME/lib/*')
}
}

Expand Down

0 comments on commit aebf496

Please sign in to comment.