scala-cli
scala-cli copied to clipboard
Add support for compile-only dependencies (aka "provided" dependencies)
We should allow users to add "compile-only" dependencies, added to the class path only at compile-time:
//> using compile-library "com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros:2.13.8"
There's already some support for compile-only class path internally (see Artifacts.compileClassPath
). It should be a matter of adding JARs coming from dependency resolution there.
Implementation-wise, note that we should probably run two dependency resolutions when users add compile-only dependencies: one compile resolution with both compile-only and standard dependencies, and a second one with just standard dependencies.
Hey, upon reviewing documents and online discussions, I ended up here. Just as described above, I needed to use this to add jsoniter-scala
's compile-time macros. It's not the only example requiring "compile-internal" or "provided" scopes. This functionality is greatly needed.
Maybe just using provided
at the end as that is the term and syntax used now for dependencies?
+1 to this feature.
Also I like the proposed more mill syntax than SBT's provided syntax.
Maybe compileLib
and compile-lib
for consistency.
Thanks