-
Notifications
You must be signed in to change notification settings - Fork 201
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
Bloop is no able to detect custom source sets #1765
Comments
Thanks for reporting! Yep it doesn't support non build-in scopes. I took a quick look so here a bit details:
bloop/integrations/sbt-bloop/src/main/scala/bloop/integrations/sbt/SbtBloop.scala Lines 226 to 228 in c1fd321
And bloop/integrations/sbt-bloop/src/main/scala/bloop/integrations/sbt/SbtBloop.scala Lines 1109 to 1114 in c1fd321
Also, we can use this method imp from sbt-bsp as a reference: https://github.com/sbt/sbt/blob/1f29c9053cdc52128fa45cfe0b22e9a4d085cc1b/main/src/main/scala/sbt/internal/server/BuildServerProtocol.scala#L520 |
@dos65 thank you for taking a look. Is it something that can be taken by someone? :) We are frustrated with using Intellij, but without this feature, we can't switch. For me, it will take like a whole eternity to do it :( |
@slovvik I don't know much about SBT but can you use this document's suggestion as a workaround? Adding and using something like... import bloop.integrations.sbt.BloopDefaults
lazy val SystemTest = config("system") extend(Test)
lazy val root = (project in file(".")).
configs(IntegrationTest, SystemTest)
.settings(
inConfig(SystemTest)(Defaults.testSettings ++ BloopDefaults.configSettings),
Defaults.itSettings,
inThisBuild(List(
organization := "com.example",
scalaVersion := "2.13.6"
)),
name := "scalatest-example"
)
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.9" % Test
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.9" % IntegrationTest
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.9" % SystemTest Not sure if that's what you need (or even if that's the best way to alter the SBT build). I note that any non Perhaps the default bloopInstall should include all configs and tag them as tests if they inherit from the |
@Arthurm1 it seems to do the trick but only in bloop. It has no support in the IDE, Metals in my case. It even broke current support for Test and IntegrationTest. Now I can't run them from the UI.
I think so. Nowadays projects have all kinds of tests, so it would be cool to support them. |
@dos65 looks like we could use the logic from BSP, but that would require someone with a much better knowldege of sbt than me 😅
Sure, the alternative would be having them under the same scope Test but in different modules if you need to split them. However, it would be good to support the different scopes. |
I will probably look at this issue a bit later. |
Hello, I was also interested in improving the test detection for custom configs. Digging through the code in the sbt integration I find that the tag selection logic is currently: bloop/integrations/sbt-bloop/src/main/scala/bloop/integrations/sbt/SbtBloop.scala Lines 880 to 884 in 3d9d785
which, as already mentioned, doesn't take into account extended configurations. Would changing it to something along these lines be enough? val tags = List(
depsFromConfig(configuration)
.collectFirst {
_.id match {
case IntegrationTest.id => Tag.IntegrationTest
case Test.id => Tag.Test
}
}
.getOrElse(Tag.Library)
) I'm not sure about using the id of the configuration, but it would cover another (at least I think) common scenario where one simply does |
Given the following configuration:
and when running
sbt bloopInstall
the following files are generated:bloop projects
also show only:It looks like bloop is not able to detect the system-test source set.
The text was updated successfully, but these errors were encountered: