From 2567539282f9fa4eff001eee8d76ea64339aa65f Mon Sep 17 00:00:00 2001 From: philippus Date: Sat, 26 Oct 2024 20:11:39 +0200 Subject: [PATCH] Cross-build for sbt 2.0.0-M2 --- .github/workflows/build.yml | 2 +- build.sbt | 11 ++++++++++- src/sbt-test/sbt-license-check/default/build.sbt | 2 -- .../sbt-license-check/exempted-dependencies/build.sbt | 9 +++------ .../throw-on-disallowed-license/build.sbt | 2 -- .../warn-on-disallowed-license/build.sbt | 2 -- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8033b5e..fb39701 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,4 +14,4 @@ jobs: distribution: temurin java-version: 8 - name: Run tests - run: sbt clean test scripted + run: sbt clean +test +scripted diff --git a/build.sbt b/build.sbt index c5f8a67..08ffdcf 100644 --- a/build.sbt +++ b/build.sbt @@ -14,7 +14,16 @@ developers := List( ) enablePlugins(SbtPlugin) -pluginCrossBuild / sbtVersion := "1.3.0" // minimum version we target + +scalaVersion := "2.12.20" +crossScalaVersions += "3.3.4" + +pluginCrossBuild / sbtVersion := { + scalaBinaryVersion.value match { + case "2.12" => "1.5.8" + case _ => "2.0.0-M2" + } +} versionScheme := Some("semver-spec") diff --git a/src/sbt-test/sbt-license-check/default/build.sbt b/src/sbt-test/sbt-license-check/default/build.sbt index 20731e2..6dc11b0 100644 --- a/src/sbt-test/sbt-license-check/default/build.sbt +++ b/src/sbt-test/sbt-license-check/default/build.sbt @@ -1,7 +1,5 @@ version := "0.1" -useCoursier := false - TaskKey[Unit]("check") := { val lastLog: File = BuiltinCommands.lastLogFile(state.value).get val last: String = IO.read(lastLog) diff --git a/src/sbt-test/sbt-license-check/exempted-dependencies/build.sbt b/src/sbt-test/sbt-license-check/exempted-dependencies/build.sbt index dfe9d1f..88734f7 100644 --- a/src/sbt-test/sbt-license-check/exempted-dependencies/build.sbt +++ b/src/sbt-test/sbt-license-check/exempted-dependencies/build.sbt @@ -1,13 +1,10 @@ version := "0.1" -useCoursier := false - licenseCheckFailBuildOnDisallowedLicense := false -licenseCheckDisallowedLicenses := Seq("Apache-2.0") +licenseCheckDisallowedLicenses := Seq("The BSD License", "The MIT License") licenseCheckExemptedDependencies := Seq( - ("scala-library", "2.12.8"), - ("scala-compiler", "2.12.8"), - ("scala-reflect", "2.12.8") + ("jline", "2.14.6"), + ("jsoup", "1.17.2") ) TaskKey[Unit]("check") := { diff --git a/src/sbt-test/sbt-license-check/throw-on-disallowed-license/build.sbt b/src/sbt-test/sbt-license-check/throw-on-disallowed-license/build.sbt index 23f621c..e4682c7 100644 --- a/src/sbt-test/sbt-license-check/throw-on-disallowed-license/build.sbt +++ b/src/sbt-test/sbt-license-check/throw-on-disallowed-license/build.sbt @@ -1,6 +1,4 @@ version := "0.1" -useCoursier := false - licenseCheckFailBuildOnDisallowedLicense := true licenseCheckDisallowedLicenses := Seq("Apache-2.0") diff --git a/src/sbt-test/sbt-license-check/warn-on-disallowed-license/build.sbt b/src/sbt-test/sbt-license-check/warn-on-disallowed-license/build.sbt index 941c1af..1f8d6f6 100644 --- a/src/sbt-test/sbt-license-check/warn-on-disallowed-license/build.sbt +++ b/src/sbt-test/sbt-license-check/warn-on-disallowed-license/build.sbt @@ -1,7 +1,5 @@ version := "0.1" -useCoursier := false - licenseCheckFailBuildOnDisallowedLicense := false licenseCheckDisallowedLicenses := Seq("Apache-2.0")