Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I went down a bit of a rabbit hole this morning with this and I don't fully understand how
scala-cli
is creating build targets or what determines a build target. I'll illustrate this with a project I'm currently working on.Project layout
All the files belong to one project, which is entered through
Main.scala
.First run
When I run this project for the first time (
scala-cli run .
) I'll get the dirs that I'd expect to be created (.bsp/
and.scala/
), and they have the following in them:This somewhat makes sense to me and I can see that there are 2 build targets created
project_940fb43dce
andproject_eaa64efb2b
. I assume one is a normal one and the other is a test target based on what is in the classes dir and this seems to be backed up by whats in the bloop dir. This brings me to my first question.hash
andhast-test
to better understand how they correlate?Opening the project with Metals
We'll now just open up
Main.scala
with Metals, and this is where things start to get pretty murky for me.We now have a new build target introduced
project_d476da5045
.Also this new target seems to be represented a bit differently having both
main
andtest
contained in it, and that's also reflected in.bloop
since we now have thehash
andhash-test
for this new target. The only difference I can tell is this new one is producing semanticdb and the other one isn't?test
in bloop for the target and not having a unique has for the target?Duplication
The final question I have is more about duplication. At this point now we have all of the classes for the project duplicated in a fair amount of places. For example the original run created the classes in
.bloop/<hash>/bloop-internal-classes/<another-hash>/
and also.scala/<hash>/main/
. If these are created on every run, what are the ones in.scala/<hash>/main/
used for that the ones created in the bloop dir can't be re-used for? When we open Metals this new target also gets all the classes + semanticdb created, however again that semanticdb is already created and located in the.bloop
dir.Again, these are all just questions I came up with as exploring that I'm curious about. I'm assuming you'll have some insight that will probably clear it all up for me. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions