-
Notifications
You must be signed in to change notification settings - Fork 205
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
refactor: start using bloop-config as a dependency #1868
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
a0b9a12
to
73c0a8a
Compare
e20c2ea
to
fc24a8f
Compare
fb57c43
to
ec836d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alrighty this is finally ready to take a look. I wanted to run scalafix on my files and then realized that it had a larger change then expected. However it did clean up so other unused imports, so I hope that's ok. If you're alright with the pr my plan is the following:
- Release a new patch in https://github.com/scalacenter/bloop-config
- Bump this to use that new patch
- Merge this
Then moving forward after this pr config will be completely standalone and not versioned along with Bloop.
build.sbt
Outdated
lazy val integrationUtils211 = project | ||
.in(integrations / "utils") | ||
.settings(scalafixSettings) | ||
.settings( | ||
scalaVersion := Dependencies.Scala211Version, | ||
libraryDependencies += Dependencies.bloopConfig, | ||
target := (file( | ||
"integrations" | ||
) / "utils" / "target" / "utils-2.11").getAbsoluteFile | ||
) | ||
|
||
lazy val integrationUtils212 = project | ||
.in(integrations / "utils") | ||
.settings(scalafixSettings) | ||
.settings( | ||
scalaVersion := Dependencies.Scala212Version, | ||
libraryDependencies += Dependencies.bloopConfig, | ||
target := (file( | ||
"integrations" | ||
) / "utils" / "target" / "utils-2.12").getAbsoluteFile | ||
) | ||
|
||
lazy val integrationUtils213 = project | ||
.in(integrations / "utils") | ||
.settings(scalafixSettings) | ||
.settings( | ||
scalaVersion := Dependencies.Scala213Version, | ||
libraryDependencies += Dependencies.bloopConfig, | ||
target := (file( | ||
"integrations" | ||
) / "utils" / "target" / "utils-2.13").getAbsoluteFile | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's a little annoying that I had to define 3 like this, but that's it's sort of due to how the build is defined and not using something like sbt-projectmatrix. Either way this seems to do the trick... All for one file that we need cross built 😆 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we introduce sbt-projectmatrix
then? Would it simplify the build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should yes, but I'd rather not do it in this pr. Because if we do it here we also have to touch all the other modules that are defined this way as well. I know in #1680 switching to sbt-ci-release
is mentioned. I think maybe doing that migration and switching to sbt-projectmatrix
at the same time would be a good idea. If we all agree, after I get this merged in I can try to tackle that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is crossTarget
not working here? It seems that target/utils-x.yz
is reproducing what crossTarget
does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is crossTarget not working here? It seems that target/utils-x.yz is reproducing what crossTarget does?
I believe crossTarget
is only for Scala-version dependent targets: like class files, zinc cache...
Here we want the whole target to be independent. From sbt's point of view, those projects are completely separate and they can't share the same target directory.
build.sbt
Outdated
lazy val integrationUtils211 = project | ||
.in(integrations / "utils") | ||
.settings(scalafixSettings) | ||
.settings( | ||
scalaVersion := Dependencies.Scala211Version, | ||
libraryDependencies += Dependencies.bloopConfig, | ||
target := (file( | ||
"integrations" | ||
) / "utils" / "target" / "utils-2.11").getAbsoluteFile | ||
) | ||
|
||
lazy val integrationUtils212 = project | ||
.in(integrations / "utils") | ||
.settings(scalafixSettings) | ||
.settings( | ||
scalaVersion := Dependencies.Scala212Version, | ||
libraryDependencies += Dependencies.bloopConfig, | ||
target := (file( | ||
"integrations" | ||
) / "utils" / "target" / "utils-2.12").getAbsoluteFile | ||
) | ||
|
||
lazy val integrationUtils213 = project | ||
.in(integrations / "utils") | ||
.settings(scalafixSettings) | ||
.settings( | ||
scalaVersion := Dependencies.Scala213Version, | ||
libraryDependencies += Dependencies.bloopConfig, | ||
target := (file( | ||
"integrations" | ||
) / "utils" / "target" / "utils-2.13").getAbsoluteFile | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we introduce sbt-projectmatrix
then? Would it simplify the build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Now this make me thinking whether we should separate the plugins, or at least the gradle and maven ones, into separate repositories.
I go back and forth. It's certainly simplify things, but I also see the benefit of being able to quickly test new thing with the integration tests in here. |
The main issue is config, that's what we test, so this would not depend on actual Bloop server at all |
Alrighty, we're all 🟢 so let's go! |
For context, this was based off a conversation we had on Discord where there was a desire to break config out of Bloop. This would make it easier to setup MiMa, simplify this build a bit, and allow it to be versioned separately. You can find bloop-config here.