-
Notifications
You must be signed in to change notification settings - Fork 53
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9f37d44
Migrate to sbt-typelevel
armanbilge 4cd008d
Fix prePR
armanbilge b84a5b9
Disable fatal warnings for Scala 3
armanbilge 8b3df5b
Set startYear
armanbilge 7a6c98b
Move fatal warnings setting
armanbilge c9189d6
Settings cleanup
armanbilge 97d385f
Regenerate workflow
armanbilge a47aa55
Formatting
armanbilge 3007d30
Fix mima for Scala 3
armanbilge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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") | ||
|
||
ThisBuild / baseVersion := "0.3" | ||
|
||
ThisBuild / organization := "org.typelevel" | ||
ThisBuild / organizationName := "Typelevel" | ||
|
||
ThisBuild / publishGithubUser := "johnynek" | ||
ThisBuild / publishFullName := "P. Oscar Boykin" | ||
ThisBuild / tlBaseVersion := "0.3" | ||
ThisBuild / startYear := Some(2021) | ||
ThisBuild / developers += tlGitHubDev("johnynek", "P. Oscar Boykin") | ||
|
||
ThisBuild / crossScalaVersions := List("3.0.2", "2.11.12", "2.12.15", "2.13.8") | ||
|
||
ThisBuild / spiewakCiReleaseSnapshots := true | ||
|
||
ThisBuild / spiewakMainBranches := List("main") | ||
ThisBuild / tlVersionIntroduced := Map("3" -> "0.3.4") | ||
|
||
ThisBuild / githubWorkflowBuild := Seq( | ||
WorkflowStep.Run( | ||
|
@@ -66,19 +59,8 @@ ThisBuild / githubWorkflowPublish ++= Seq( | |
) | ||
) | ||
|
||
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" | ||
) | ||
) | ||
Comment on lines
-69
to
-76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sbt-typelevel sets this automatically. |
||
|
||
ThisBuild / licenses := List(("MIT", url("http://opensource.org/licenses/MIT"))) | ||
|
||
ThisBuild / testFrameworks += new TestFramework("munit.Framework") | ||
|
||
lazy val jvmVersionSettings = VersionNumber(sys.props("java.version")) match { | ||
case v if v.matchesSemVer(SemanticSelector(">1.8")) => | ||
Def.settings( | ||
|
@@ -96,7 +78,7 @@ lazy val jvmVersionSettings = VersionNumber(sys.props("java.version")) match { | |
lazy val root = project | ||
.in(file(".")) | ||
.aggregate(core.jvm, core.js, bench) | ||
.enablePlugins(NoPublishPlugin, SonatypeCiReleasePlugin) | ||
.enablePlugins(NoPublishPlugin) | ||
.settings(scalaVersion := "2.13.8") | ||
|
||
lazy val docs = project | ||
|
@@ -115,7 +97,6 @@ lazy val docs = project | |
"empty" -> "", | ||
"version" -> version.value | ||
), | ||
githubWorkflowArtifactUpload := false, | ||
git.remoteRepo := "git@github.com:typelevel/cats-parse.git", | ||
mdocIn := (Compile / baseDirectory).value / "src", | ||
Compile / paradox / sourceDirectory := mdocOut.value, | ||
|
@@ -132,6 +113,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform) | |
.crossType(CrossType.Full) | ||
.settings( | ||
name := "cats-parse", | ||
tlFatalWarningsInCi := !tlIsScala3.value, | ||
libraryDependencies ++= { | ||
val isScala211 = CrossVersion.partialVersion(scalaVersion.value).contains((2, 11)) | ||
Seq( | ||
|
@@ -141,8 +123,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform) | |
) | ||
}, | ||
libraryDependencies ++= { | ||
val isScala2 = CrossVersion.partialVersion(scalaVersion.value).exists(_._1 == 2) | ||
if (isScala2) Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value) else Nil | ||
if (tlIsScala3.value) Nil else Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value) | ||
}, | ||
scalacOptions ++= { | ||
val isScala211 = CrossVersion.partialVersion(scalaVersion.value).contains((2, 11)) | ||
|
@@ -152,19 +133,19 @@ lazy val core = crossProject(JSPlatform, JVMPlatform) | |
mimaPreviousArtifacts := { | ||
val isScala211 = CrossVersion.partialVersion(scalaVersion.value).contains((2, 11)) | ||
if (isScala211) Set.empty else mimaPreviousArtifacts.value | ||
}, | ||
mimaBinaryIssueFilters ++= { | ||
if (tlIsScala3.value) | ||
List( | ||
ProblemFilters.exclude[IncompatibleResultTypeProblem]("cats.parse.Parser#State.error"), | ||
ProblemFilters.exclude[IncompatibleMethTypeProblem]("cats.parse.Parser#State.error_=") | ||
) | ||
else Nil | ||
} | ||
) | ||
.jsSettings( | ||
crossScalaVersions := (ThisBuild / crossScalaVersions).value.filterNot(_.startsWith("2.11")), | ||
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 | ||
Comment on lines
-159
to
-167
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pretty sure these are all redundant. |
||
coverageEnabled := false | ||
) | ||
|
||
lazy val coreJVM = core.jvm.settings(jvmVersionSettings) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
sbt-typelevel defines its own
prePR
so we replace the alias.