Skip to content

Commit

Permalink
Merge pull request #136 from xuwei-k/sbt-2
Browse files Browse the repository at this point in the history
add sbt 2.x cross build setting
  • Loading branch information
eed3si9n authored Oct 23, 2024
2 parents 8e97faa + 50849e4 commit af486cb
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck

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

- name: Compress target directories
shell: bash
Expand Down
37 changes: 35 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,48 @@ lazy val lang3 = "org.apache.commons" % "commons-text" % "1.12.0"
lazy val repoSlug = "sbt/sbt-license-report"

val scala212 = "2.12.19"
val scala3 = "3.3.3"

pluginCrossBuild / sbtVersion := {
scalaBinaryVersion.value match {
case "2.12" =>
(pluginCrossBuild / sbtVersion).value
case _ =>
"2.0.0-M2"
}
}

ThisBuild / scalaVersion := scala212
ThisBuild / crossScalaVersions := Seq(scala212)
ThisBuild / crossScalaVersions := Seq(scala212, scala3)
organization := "com.github.sbt"
name := "sbt-license-report"
enablePlugins(SbtPlugin)
libraryDependencies += lang3
scriptedLaunchOpts += s"-Dplugin.version=${version.value}"

ThisBuild / githubWorkflowScalaVersions := Seq(scalaVersion.value)

TaskKey[Unit]("testAll") := {
if (scalaBinaryVersion.value == "3") {
Def
.sequential(
Test / test,
Def.task(
// TODO enable test
streams.value.log.warn("skip sbt 2.x scripted tests")
)
)
.value
} else {
Def
.sequential(
Test / test,
scripted.toTask("")
)
.value
}
}

// publishing info
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"))
scmInfo := Some(
Expand Down Expand Up @@ -54,7 +87,7 @@ scalacOptions ++= {
} else Nil
}

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

ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches :=
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sbtlicensereport/SbtLicenseReport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ object SbtLicenseReport extends AutoPlugin {
licenseReportNotes := PartialFunction.empty,
licenseOverrides := PartialFunction.empty,
licenseDepExclusions := PartialFunction.empty,
licenseFilter := TypeFunctions.const(true),
licenseFilter := Function.const(true),
licenseReportStyleRules := None,
licenseReportTypes := Seq(MarkDown, Html, Csv),
licenseReportColumns := Seq(Column.Category, Column.License, Column.Dependency),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ object LicenseReport {
print(language.tableRow(notes, rest: _*))
}
print(language.tableEnd)
print(language.documentEnd)
print(language.documentEnd())
}
}
}
Expand Down

0 comments on commit af486cb

Please sign in to comment.