-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for absolute paths in classpath #882
Conversation
Do not prefix with $lib_dir when an absolute path is added to the classpath
Hi @hayssams, Thank you for your contribution! We really value the time you've taken to put this together. Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement: |
Thanks for your pull requests. Can you explain the reasons and use cases? In order to accept the pull request we would also need a few things
|
When building a package you sometimes need to add in the classpath, an absolute path in your package like a docker volume path or any external path. You are right documentation and tests are missing and I have to add them asap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Test case
- Documentation on how to use
Still need to get used to the new github review tools ;) If you need any help on writing tests and documentation you can read the Developer Guide or ask here. |
@typesafehub-validator CLA already signed |
Hi @muuki88 To add an absolute path to the app classpath just set it in the scriptClasspath Key as follows : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work. Only a few tiny things :)
@@ -11,9 +11,10 @@ object JavaAppBatScript { | |||
|
|||
def makeWindowsRelativeClasspathDefine(cp: Seq[String]): String = { | |||
def cleanPath(path: String): String = path.replaceAll("/", "\\\\") | |||
def isAbsolute(path: String): Boolean = path.length > "c:\\".length && Character.isLetter(path(0)) && path(1) == ':' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused about the "c:\\".length
definition. It looks like putting documentation into the source code.
If you have to check for a path longer than 4 characters do so explicitly and add a small comment for what reason. At first I thought you were checking if the path starts with `c:\`` ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok will do it in a few minutes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,21 @@ | |||
enablePlugins(JavaAppPackaging) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test looks good. However can you split this into two tests?
The bash one goes into sbt-test/bash
and ( I know this is confusing :( ) into sbt-test/windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Awesome. Thanks :) |
Do not prefix with $lib_dir when an absolute path is added to the
classpath