-
-
Notifications
You must be signed in to change notification settings - Fork 421
Add JavaModule#runClasspathAsJars #6200
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
base: main
Are you sure you want to change the base?
Add JavaModule#runClasspathAsJars #6200
Conversation
|
So what happens to the non-jar entries? Are they converted or just filtered out? If the latter, the name needs some change. While it suggests being the run classpath as jars, it's just a partial classpath, filtered to contain only jars. |
|
Can you give some examples for application that expect only jars which result in an incomplete classpath? |
|
Not sure this needs to be upstreamed into Mill, seems like it could be a small helper in the project that needs it? |
|
I don't recall the exact use cases, but I remember having needed that from time to time, in other projects. This is useful to interface with external tools in particular. sbt has similar keys, for more tasks actually. These seem to be used in the wild (even though forks pollute those results). |
This computes the same thing as |
|
In Spark, the |
Got it. This could indeed be useful sometimes. E.g. in One thing worth pointing out though: I'm not sure, we should provide it without a concrete use case (e.g. suport for a specific tool or framework like OSGi) that we can assert with an integration test. |
|
Would an alternative be to add a flag to make |
Probably not. Even if zinc would include the resources in that jar, it's missing the runtime-resources, which might be produced by arbitrary complex build tasks. |
Extra
I already added unit tests, that assert that |
|
Just added A few other So the following is fine (public def compileClasspath = compileClasspathAsJars
def runClasspath = runClasspathAsJars
def localCompileClasspath = localCompileClasspathAsJars // not sure why anyone would do this one though(first two are actually used in the unit tests added in this PR) But the following is not ( def unmanagedClasspath = unmanagedClasspathAsJars
def compileResources = compileResourcesAsJars |
|
It's still not clear to me why this needs to be in JavaModule and not a helper trait in the downstream build or plugin that needs it. It's also not clear who the usages are, or what the exact requirements of those usages are. There's no way to propert review this PR until those questions are answered |
This adds a
JavaModule#runClasspathAsJarstask, that returns the same class path asJavaModule#runClasspath, except all entries are JAR files, that it contains no directories. This is useful when passing the class path to applications that expect it to be only JAR files.