From 8029aa6a9d8dc054b1ee7f5c13b72ff4f4c71fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Sur=C3=A9e?= Date: Wed, 13 Nov 2024 18:09:34 +0100 Subject: [PATCH] Check sbt version --- README.md | 2 +- src/main/scala/sbtlicensereport/SbtLicenseReport.scala | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ee7fed..abd608c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # sbt-license-report -This plugin will allow you to report the licenses used in your projects. It requires 1.0.0+. +This plugin will allow you to report the licenses used in your projects. It requires 1.10.5+. ## Installation diff --git a/src/main/scala/sbtlicensereport/SbtLicenseReport.scala b/src/main/scala/sbtlicensereport/SbtLicenseReport.scala index be01b49..d01fb3f 100644 --- a/src/main/scala/sbtlicensereport/SbtLicenseReport.scala +++ b/src/main/scala/sbtlicensereport/SbtLicenseReport.scala @@ -81,6 +81,8 @@ object SbtLicenseReport extends AutoPlugin { Seq( licenseReportTitle := s"${normalizedName.value}-licenses", updateLicenses := { + if (VersionNumber(sbtVersion.value).matchesSemVer(SemanticSelector("<1.10.5"))) + throw new sbt.MessageOnlyException("sbt-license-report requires sbt 1.10.5 or greater.") val overrides = licenseOverrides.value.lift val depExclusions = licenseDepExclusions.value.lift val originatingModule = DepModuleInfo(organization.value, name.value, version.value)