Skip to content
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

Merged
merged 6 commits into from
Nov 28, 2022
Merged

refactor: start using bloop-config as a dependency #1868

merged 6 commits into from
Nov 28, 2022

Conversation

ckipp01
Copy link
Member

@ckipp01 ckipp01 commented Nov 22, 2022

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.

@ckipp01

This comment was marked as outdated.

@ckipp01 ckipp01 force-pushed the configGut branch 3 times, most recently from a0b9a12 to 73c0a8a Compare November 23, 2022 11:03

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@ckipp01 ckipp01 force-pushed the configGut branch 4 times, most recently from e20c2ea to fc24a8f Compare November 24, 2022 16:26
Copy link
Member Author

@ckipp01 ckipp01 left a 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:

Then moving forward after this pr config will be completely standalone and not versioned along with Bloop.

Sorry, something went wrong.

build.sbt Outdated
Comment on lines 482 to 513
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
)
Copy link
Member Author

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 😆 .

Copy link
Member

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?

Copy link
Member Author

@ckipp01 ckipp01 Nov 28, 2022

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.

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?

Copy link
Member

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.

@ckipp01 ckipp01 requested a review from tgodzik November 26, 2022 15:36
@ckipp01 ckipp01 marked this pull request as ready for review November 26, 2022 15:36
@ckipp01 ckipp01 requested a review from adpi2 November 28, 2022 12:01
build.sbt Outdated
Comment on lines 482 to 513
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
)
Copy link
Member

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?

@ckipp01 ckipp01 requested a review from adpi2 November 28, 2022 12:38
Copy link
Member

@adpi2 adpi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@tgodzik tgodzik left a 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.

@ckipp01
Copy link
Member Author

ckipp01 commented Nov 28, 2022

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.

@tgodzik
Copy link
Contributor

tgodzik commented Nov 28, 2022

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

@ckipp01
Copy link
Member Author

ckipp01 commented Nov 28, 2022

Alrighty, we're all 🟢 so let's go!

@ckipp01 ckipp01 merged commit 2c83736 into main Nov 28, 2022
@ckipp01 ckipp01 deleted the configGut branch November 28, 2022 18:04
@ckipp01 ckipp01 mentioned this pull request Dec 21, 2022
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants