Skip to content

Commit

Permalink
scrooge: Fix sbt scala version misalignment
Browse files Browse the repository at this point in the history
Problem

Scrooge sbt build is broken, preventing us from releasing CSL libraries.

There were two problems with the build
 - Scala versions for 2.12 and 2.13 were misaligned between individual projects
 - The top-level project scrooge (only used in testing the sbt build) had its own settings that were shadowing individual projects settings,
   so the bug with the misaligned version slipped through. We only noticed an issue during a release (when we release individual projects).

Solution

Fix the build by making sbt happy.

Differential Revision: https://phabricator.twitter.biz/D942948
  • Loading branch information
vkostyukov authored and jenkins committed Jul 28, 2022
1 parent cce9b95 commit 33915ca
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,13 @@ val settingsWithTwoTen =
)
)

val commonScalaVersions = Seq("2.12.12", "2.13.6")

// settings for projects that are cross compiled with scala 2.10
val settingsCrossCompiledWithTwoTen =
sharedSettingsWithoutScalaVersion ++
Seq(
crossScalaVersions := Seq("2.10.7", "2.12.12", "2.13.1"),
crossScalaVersions := Seq("2.10.7") ++ commonScalaVersions,
scalaVersion := "2.13.6",
scalacOptions := scalacTwoTenOptions,
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint:unchecked"),
Expand All @@ -204,7 +206,7 @@ val sharedSettings =
sharedSettingsWithoutScalaVersion ++
Seq(
scalaVersion := "2.13.6",
crossScalaVersions := Seq("2.12.8", "2.13.6"),
crossScalaVersions := commonScalaVersions,
scalacOptions := Seq(
"-deprecation",
"-unchecked",
Expand Down Expand Up @@ -244,8 +246,6 @@ lazy val scrooge = Project(
base = file(".")
).enablePlugins(
ScalaUnidocPlugin
).settings(
sharedSettings
).aggregate(publishedProjects: _*)

// This target is used for publishing dependencies locally
Expand All @@ -260,8 +260,6 @@ lazy val scroogePublishLocal = Project(
// use a different target so that we don't have conflicting output paths
// between this and the `scrooge` target.
base = file("target/")
).settings(
sharedSettings
).aggregate(publishedProjects: _*)

// must be cross compiled with scala 2.10 because scrooge-sbt-plugin
Expand Down

0 comments on commit 33915ca

Please sign in to comment.