-
Notifications
You must be signed in to change notification settings - Fork 128
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
Defining project.scala dependencies in test scope? #1729
Comments
Hey, sorry for the late answer. There indeed should be a way to define test scope directives in the configuration file, but there currently isn't. It's definitely a bug, and it hasn't been covered in the docs properly, as you say. All sources, including the I know it may be annoying, but it seems the best I can advise is to ignore the warning until we fix this. |
There is a similar problem when one needs a different set of directives when cross-compiling to different targets: JVM/native/js and different scala version |
We are thinking of having a short term solution to disable the warning, but long term we should have somethin like: |
That can be tracked under a separate issue: #1747 |
It's been decided we will proceed with this syntax, as in the prefix //> using test.dep "(...)" |
This might solve the problem for test/main and potentially for jvm/js/native. But what if one e.g. needs different library dependencies for scala 2.12, 2.13 and 3? Would it be //> using scala.2_12.dep "..."
//> using scala.2_13.dep "..."
//> using scala.3.dep "..." ?
|
This comes close to sbt territory, where it's solved programmatically. It might hard to solve this declaratively I think. Did we even plan to support it? I think we could track the different scala versions under a separate issue and not allow it at all for now. Unless this is something we already support, if anyone can correct me here? |
Currently if you want to make a directive apply only to some subset of sources (e.g. only for tests) you simply have to put the directive somewhere in a file in this subset. This means that e.g. if you have a file called |
We don't intend to cover all scopes in this issue and will mainly focus on the I think we would should add the If someone uses this syntax in the For the |
Should we really try to enforce the naming of the file where the centralized configuration of a build is located? |
If you have everything in a single file I think it will not generate any warning currently either, but if you have directives in both |
One thing I didn't realize is that we actually want to take a different direction, where we would just have separate test directive, which wouldn't really have anything to do with scopes. This was decided while I was on vacation, so I lost a bit of context here 😓 The main difference here is that @Gedochao let's discuss it a bit more once you are back |
Version(s)
Scala CLI version: 0.1.19
Scala version (default): 3.2.1
I see this warning on every compile
But was wondering how I define dependencies in test scope inside project.scala or is there no such thing as a test scope?
I have not found anything related to that in the docs?
The text was updated successfully, but these errors were encountered: