You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Some libraries split their functionality into multiple modules distributed as separate artifacts so that their users can depend only on the artifacts they really need. One inconvenient thing from the users' perspective here is that the version of each module needs to be specified separately even though in most cases they need to be kept in synch, e.g.
using lib "org.foo::foo-abc:1.2.3"
using lib "org.foo::foo-def:1.2.3"
using lib "org.foo::foo-ghi:1.2.3"
Describe the solution you'd like
We could introduce some way of specifying a dependency on multiple modules of the same library without duplicating the version. Some possibilities:
Specify multiple modules in the same dependency string of a using directive, e.g.
using lib "org.foo::{foo-abc, foo-def, foo-ghi}:1.2.3"
Specify multiple modules in the same using directive with a more explicit nested structure, e.g.
using lib:
org "org.foo"
artifacts "foo-abc", "foo-def", "foo-ghi"
version "1.2.3"
Specify the version of a library just once and then try to infer the versions of the remaining modules, e.g.
using lib "org.foo::foo-abc:1.2.3"
using lib "org.foo::foo-def"
using lib "org.foo::foo-ghi"
This might be tricky however because different artifacts coming from the same organization don't have to be different modules of the same library.
Allow defining constant values inside using directives and referring to them in other directives, e.g.
using value "fooVersion""1.2.3"
using lib "org.foo::foo-abc:${fooVersion}"
using lib "org.foo::foo-def:${fooVersion}"
using lib "org.foo::foo-ghi:${fooVersion}"
This solution seems both most powerful and most complicated to implement as we would need a new mechanism for defining and substituting constants. To simplify this some restrictions could be added, e.g.:
a constant has to be defined in the same file where it's referenced
a constant has to be defined before it's referenced (when parsing top-down and left to right).
Also this would potentially clash with the proposed syntax for resolving paths Explicit handling of paths in using directives #1098
Rely on tooling support, e.g. when a user changes the version of one module, provide a code action for changing the versions of the remaining ones. Here, however, we have similar problems to those from 3)
The text was updated successfully, but these errors were encountered:
Thanks for reporting the issues, based on the examples showed, I don't think there is a sensible solution and is out of scope for Scala CLI especially with the simplified using directives.
Is your feature request related to a problem? Please describe.
Some libraries split their functionality into multiple modules distributed as separate artifacts so that their users can depend only on the artifacts they really need. One inconvenient thing from the users' perspective here is that the version of each module needs to be specified separately even though in most cases they need to be kept in synch, e.g.
Describe the solution you'd like
We could introduce some way of specifying a dependency on multiple modules of the same library without duplicating the version. Some possibilities:
using lib "org.foo::{foo-abc, foo-def, foo-ghi}:1.2.3"
This might be tricky however because different artifacts coming from the same organization don't have to be different modules of the same library.
This solution seems both most powerful and most complicated to implement as we would need a new mechanism for defining and substituting constants. To simplify this some restrictions could be added, e.g.:
Also this would potentially clash with the proposed syntax for resolving paths Explicit handling of paths in using directives #1098
The text was updated successfully, but these errors were encountered: