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

Migrate to sbt-typelevel #354

Merged
merged 9 commits into from
Jan 20, 2022
Merged

Conversation

armanbilge
Copy link
Member

@armanbilge armanbilge commented Jan 20, 2022

Migrates the build to sbt-typelevel. It's very similar to sbt-spiewak, so most things are the same. Notable differences:

  • Snapshots are now published to Sonatype snapshots instead of Maven. Unless you like them at Maven, in which case easy to restore.
  • Java 8 is the default JDK for CI (the build was using JDK 11, was this intentional?).
  • MiMa is now enabled for Scala 3 and Scala.js.
  • It is now safe to tag a release immediately after merging a PR/pushing to main without causing a publication failure.

Since the build here is fairly customized, I've been conservative about adopting additional sbt-typelevel features (e.g., CI matrices crossed on JVM/JS in addition to Scala version).

@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2022

Codecov Report

Merging #354 (bfea6a4) into main (3acc967) will increase coverage by 0.17%.
The diff coverage is 98.85%.

❗ Current head bfea6a4 differs from pull request most recent head 3007d30. Consider uploading reports for the commit 3007d30 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #354      +/-   ##
==========================================
+ Coverage   96.56%   96.74%   +0.17%     
==========================================
  Files           9        9              
  Lines        1049     1106      +57     
  Branches       94      103       +9     
==========================================
+ Hits         1013     1070      +57     
  Misses         36       36              
Impacted Files Coverage Δ
core/shared/src/main/scala/cats/parse/Parser.scala 96.63% <98.85%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b524da...3007d30. Read the comment docs.

Copy link
Member Author

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

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

Ready for review. Thanks!

@@ -5,21 +5,14 @@ import Dependencies._
addCommandAlias("fmt", "; scalafmtAll; scalafmtSbt")
addCommandAlias("fmtCheck", "; scalafmtCheckAll; scalafmtSbtCheck")

addCommandAlias("prePR", "; githubWorkflowGenerate ; +fmt; bench/compile; +test")
tlReplaceCommandAlias("prePR", "; githubWorkflowGenerate ; +fmt; bench/compile; +test")
Copy link
Member Author

Choose a reason for hiding this comment

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

sbt-typelevel defines its own prePR so we replace the alias.

Comment on lines -159 to -167
Global / scalaJSStage := FastOptStage,
parallelExecution := false,
jsEnv := new org.scalajs.jsenv.nodejs.NodeJSEnv(),
// batch mode decreases the amount of memory needed to compile scala.js code
scalaJSLinkerConfig := scalaJSLinkerConfig.value
.withBatchMode(scala.sys.env.get("TRAVIS").isDefined)
.withModuleKind(ModuleKind.CommonJSModule),
coverageEnabled := false,
scalaJSUseMainModuleInitializer := false
Copy link
Member Author

Choose a reason for hiding this comment

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

Pretty sure these are all redundant.

Comment on lines -69 to -76
ThisBuild / homepage := Some(url("https://github.com/typelevel/cats-parse"))

ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/typelevel/cats-parse"),
"git@github.com:typelevel/cats-parse.git"
)
)
Copy link
Member Author

Choose a reason for hiding this comment

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

sbt-typelevel sets this automatically.

@armanbilge armanbilge marked this pull request as ready for review January 20, 2022 15:12
Copy link
Collaborator

@johnynek johnynek left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

Cc @mpilquist who set up the build.

@johnynek johnynek merged commit 4f66a03 into typelevel:main Jan 20, 2022
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.

3 participants