Skip to content

Commit d68a902

Browse files
authored
[AI-4146] Downgrade to sbt 1.12.8 for Metals/Bloop compatibility (russwyte#40)
* [AI-4145] Add fork-friendly GitHub Packages publishing support Add env-var-driven publishing so forks can publish to their own GitHub Packages repository without modifying build files. Controlled by repo variables: PUBLISH_PACKAGES_REPO, PUBLISH_ORG, PUBLISH_ORG_NAME. Includes a publish workflow that is a no-op when variables are unset. * [AI-4146] Downgrade to sbt 1.12.8 for Metals/Bloop compatibility - Downgrade from sbt 2.0.0-RC10 to 1.12.8 (RC has cross-version conflicts with sbt-bloop that break Metals) - Add jsoniter-scala-core_2.13 exclusion to fix remaining conflict - Enable semanticdbEnabled for Metals support - Minor scalafmt formatting adjustments
1 parent 7632141 commit d68a902

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

build.sbt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
21
val scala3Version = "3.7.4"
32
val zioVersion = "2.1.24"
3+
// lets enable semanticdb
4+
ThisBuild / semanticdbEnabled := true
45

56
ThisBuild / dependencyOverrides += "org.scalameta" % "semanticdb-scalac_2.12.21" % "4.14.4"
67
ThisBuild / scalaVersion := scala3Version
@@ -23,24 +24,28 @@ ThisBuild / developers := List(
2324
url = url("https://github.com/russwyte"),
2425
)
2526
)
26-
ThisBuild / versionScheme := Some("early-semver")
27+
ThisBuild / versionScheme := Some("early-semver")
2728

2829
// --- Fork publishing support (GitHub Packages) ---
2930
// Forks set PUBLISH_PACKAGES_REPO and GITHUB_TOKEN in CI to publish to their own GitHub Packages.
3031
// Optionally set PUBLISH_ORG and PUBLISH_ORG_NAME to change the Maven group ID.
3132
val githubPackagesRepo: Option[MavenRepository] =
3233
sys.env.get("PUBLISH_PACKAGES_REPO").map("GitHub Packages" at _)
3334

34-
ThisBuild / credentials ++= sys.env.get("GITHUB_TOKEN").map { token =>
35-
Credentials("GitHub Package Registry", "maven.pkg.github.com", "_", token)
36-
}.toSeq
35+
ThisBuild / credentials ++= sys.env
36+
.get("GITHUB_TOKEN")
37+
.map { token =>
38+
Credentials("GitHub Package Registry", "maven.pkg.github.com", "_", token)
39+
}
40+
.toSeq
3741

3842
ThisBuild / resolvers ++= githubPackagesRepo.toSeq
3943

4044
// PGP signing: only when publishing to Maven Central (forks targeting GitHub Packages won't have the key)
41-
githubPackagesRepo match
45+
githubPackagesRepo match {
4246
case None => usePgpKeyHex("2F64727A87F1BCF42FD307DD8582C4F16659A7D6")
4347
case Some(_) => Seq.empty
48+
}
4449

4550
ThisBuild / libraryDependencies ++= Seq(
4651
"dev.zio" %% "zio" % zioVersion % "provided",

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=2.0.0-RC10
1+
sbt.version=1.12.8

project/plugins.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.4.4")
1212
excludeDependencies ++= Seq(
1313
ExclusionRule("org.scala-lang.modules", "scala-xml_2.13"),
1414
ExclusionRule("org.scala-lang.modules", "scala-collection-compat_2.13"),
15+
ExclusionRule("com.github.plokhotnyuk.jsoniter-scala", "jsoniter-scala-core_2.13"),
1516
)
1617

1718
// val overrideSemanticDbVersion = "4.14.5"

0 commit comments

Comments
 (0)