Skip to content

Commit 72a3f89

Browse files
committed
add sbt 2.x cross build setting
1 parent 6ccd597 commit 72a3f89

File tree

5 files changed

+48
-7
lines changed

5 files changed

+48
-7
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
matrix:
2525
os: [ubuntu-latest, macos-latest, windows-latest]
26-
scala: [2.12.19]
26+
scala: [2.12.19, 3.3.3]
2727
java: [temurin@8, temurin@11, temurin@17, temurin@21]
2828
exclude:
2929
- java: temurin@8
@@ -88,7 +88,7 @@ jobs:
8888
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
8989

9090
- shell: bash
91-
run: sbt '++ ${{ matrix.scala }}' test scripted
91+
run: sbt '++ ${{ matrix.scala }}' testAll
9292

9393
- name: Compress target directories
9494
shell: bash
@@ -173,6 +173,16 @@ jobs:
173173
tar xf targets.tar
174174
rm targets.tar
175175
176+
- name: Download target directories (3.3.3)
177+
uses: actions/download-artifact@v4
178+
with:
179+
name: target-${{ matrix.os }}-3.3.3-${{ matrix.java }}
180+
181+
- name: Inflate target directories (3.3.3)
182+
run: |
183+
tar xf targets.tar
184+
rm targets.tar
185+
176186
- name: Publish project
177187
env:
178188
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}

build.sbt

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,46 @@ lazy val lang3 = "org.apache.commons" % "commons-text" % "1.12.0"
22
lazy val repoSlug = "sbt/sbt-license-report"
33

44
val scala212 = "2.12.19"
5+
val scala3 = "3.3.3"
6+
7+
pluginCrossBuild / sbtVersion := {
8+
scalaBinaryVersion.value match {
9+
case "2.12" =>
10+
(pluginCrossBuild / sbtVersion).value
11+
case _ =>
12+
"2.0.0-M2"
13+
}
14+
}
515

616
ThisBuild / scalaVersion := scala212
7-
ThisBuild / crossScalaVersions := Seq(scala212)
17+
ThisBuild / crossScalaVersions := Seq(scala212, scala3)
818
organization := "com.github.sbt"
919
name := "sbt-license-report"
1020
enablePlugins(SbtPlugin)
1121
libraryDependencies += lang3
1222
scriptedLaunchOpts += s"-Dplugin.version=${version.value}"
1323

24+
TaskKey[Unit]("testAll") := {
25+
if (scalaBinaryVersion.value == "3") {
26+
Def
27+
.sequential(
28+
Test / test,
29+
Def.task(
30+
// TODO enable test
31+
streams.value.log.warn("skip sbt 2.x scripted tests")
32+
)
33+
)
34+
.value
35+
} else {
36+
Def
37+
.sequential(
38+
Test / test,
39+
scripted.toTask("")
40+
)
41+
.value
42+
}
43+
}
44+
1445
// publishing info
1546
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"))
1647
scmInfo := Some(
@@ -54,7 +85,7 @@ scalacOptions ++= {
5485
} else Nil
5586
}
5687

57-
ThisBuild / githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test", "scripted")))
88+
ThisBuild / githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("testAll")))
5889

5990
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
6091
ThisBuild / githubWorkflowPublishTargetBranches :=

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.10.1
1+
sbt.version=1.10.2

src/main/scala/sbtlicensereport/SbtLicenseReport.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ object SbtLicenseReport extends AutoPlugin {
156156
licenseReportNotes := PartialFunction.empty,
157157
licenseOverrides := PartialFunction.empty,
158158
licenseDepExclusions := PartialFunction.empty,
159-
licenseFilter := TypeFunctions.const(true),
159+
licenseFilter := Function.const(true),
160160
licenseReportStyleRules := None,
161161
licenseReportTypes := Seq(MarkDown, Html, Csv),
162162
licenseReportColumns := Seq(Column.Category, Column.License, Column.Dependency),

src/main/scala/sbtlicensereport/license/LicenseReport.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ object LicenseReport {
8181
print(language.tableRow(notes, rest: _*))
8282
}
8383
print(language.tableEnd)
84-
print(language.documentEnd)
84+
print(language.documentEnd())
8585
}
8686
}
8787
}

0 commit comments

Comments
 (0)