Skip to content

Commit

Permalink
chore: Tidy up versions for testing and publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Oct 10, 2024
1 parent f6a6c7c commit 1c91ed0
Show file tree
Hide file tree
Showing 21 changed files with 321 additions and 329 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ lazy val mtagsShared = project
crossVersion := CrossVersion.full,
Compile / packageSrc / publishArtifact := true,
Compile / scalacOptions ++= {
if (scalaVersion.value == V.scala3)
if (scalaVersion.value == V.lastPublishedScala3)
List("-Yexplicit-nulls", "-language:unsafeNulls")
else Nil
},
Expand Down Expand Up @@ -370,7 +370,7 @@ lazy val mtags3 = project
Compile / unmanagedSourceDirectories += (ThisBuild / baseDirectory).value / "mtags-shared" / "src" / "main" / "scala",
Compile / unmanagedSourceDirectories += (ThisBuild / baseDirectory).value / "mtags-shared" / "src" / "main" / "scala-3",
moduleName := "mtags3",
scalaVersion := V.scala3,
scalaVersion := V.lastPublishedScala3,
target := (ThisBuild / baseDirectory).value / "mtags" / "target" / "target3",
publish / skip := true,
libraryDependencies += V.guava,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ object MtagsResolver {
"2.13.9" -> "1.3.3",
"2.13.10" -> "1.3.3",
"2.13.11" -> "1.3.5",
"3.2.2" -> "1.3.5",
"3.3.2" -> "1.3.5",
)

class Default extends MtagsResolver {
Expand Down
23 changes: 7 additions & 16 deletions project/V.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ object V {
val scala211 = "2.11.12"
val scala212 = "2.12.20"
val scala213 = "2.13.15"
val scala3 = "3.3.3"
val lastPublishedScala3 = "3.3.3"
val scala3 = "3.3.4"

// When you can add to removedScalaVersions in MtagsResolver.scala with the last released version
val scala3RC: Option[String] = None
val sbtScala = "2.12.18"
val ammonite212Version = "2.12.19"
val ammonite213Version = "2.13.14"
// Rules need to be manually updated to support
val bazelScalaVersion = "2.13.12"
val ammonite3Version = "3.3.3"
val ammonite3Version = "3.3.4"

val ammonite = "3.0.0-2-6342755f"
val betterMonadicFor = "0.3.1"
Expand Down Expand Up @@ -167,24 +167,16 @@ object V {

// Scala 3
def nonDeprecatedScala3Versions =
Seq(scala3, "3.3.1") ++ scala3RC.toSeq

// whenever version is removed please add it to MtagsResolver under last supported Metals version
def deprecatedScala3Versions =
Seq(
"3.3.2", // was a broken release
"3.2.2",
)
Seq(lastPublishedScala3, "3.3.1")

// NOTE if you had a new Scala Version make sure it's contained in quickPublishScalaVersions
def scala3Versions = nonDeprecatedScala3Versions ++ deprecatedScala3Versions
def scala3Versions = nonDeprecatedScala3Versions

def supportedScalaVersions =
scala2Versions ++ scala3Versions
def nonDeprecatedScalaVersions =
nonDeprecatedScala2Versions ++ nonDeprecatedScala3Versions
def deprecatedScalaVersions =
deprecatedScala2Versions ++ deprecatedScala3Versions
def deprecatedScalaVersions = deprecatedScala2Versions

val quickPublishScalaVersions = Set(
bazelScalaVersion,
Expand All @@ -194,7 +186,6 @@ object V {
ammonite212Version,
scala213,
ammonite213Version,
scala3,
ammonite3Version,
).toList ++ scala3RC.toList
).toList
}
2 changes: 1 addition & 1 deletion project/Welcome.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object Welcome {
"publish Metals artifacts but with only limited set of Scala versions",
),
UsefulTask(
s"++${V.scala3} mtags/publishLocal",
s"++${V.lastPublishedScala3} mtags/publishLocal",
"publish changes for a single Scala version, especially useful if working on a feature inside mtags module." +
" `publishLocal` will still need to be run before at least once.",
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,8 @@ class CompletionCrossLspSuite
_ = assertNoDiagnostics()
_ <- assertCompletion(
"MyC@@",
"""|MyClass1(): MyClass1
|MyClass2(name: String): MyClass2
|MyClass3 - foo
|MyClass3(name: String): Nothing
"""|MyClass3 - foo
|MyClass3(name: String): Nothing - foo
|""".stripMargin,
filename = Some("a/src/main/scala/Main.scala"),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ class DefinitionCrossLspSuite
|Required: Int
| val name: Int = "John"
| ^^^^^^
|a/src/main/scala/a/b/Bar.scala:4:3: error: Not found: Main
|a/src/main/scala/a/b/Bar.scala:4:3: error: Not found: Main - did you mean Math? or perhaps wait?
| Main.name
| ^^^^
|a/src/main/scala/a/b/c/OtherMain.scala:4:19: error: Found: ("Lemon" : String)
Expand Down
Loading

0 comments on commit 1c91ed0

Please sign in to comment.