From fa451087532ce680394ac3a8607e1f0ef6b19f64 Mon Sep 17 00:00:00 2001 From: Julien Richard-Foy Date: Tue, 5 Dec 2023 18:29:26 +0100 Subject: [PATCH] Shade the ujson dependency --- build.sbt | 12 ++++++++++-- project/plugins.sbt | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 95a1599..4551968 100644 --- a/build.sbt +++ b/build.sbt @@ -24,7 +24,7 @@ lazy val root = (project in file(".")) ) lazy val `sbt-version-policy` = project - .enablePlugins(SbtPlugin) + .enablePlugins(SbtPlugin, ShadingPlugin) .settings( scriptedLaunchOpts += "-Dplugin.version=" + version.value, scriptedBufferLog := false, @@ -32,9 +32,17 @@ lazy val `sbt-version-policy` = project libraryDependencies ++= Seq( "io.get-coursier" % "interface" % "1.0.19", "io.get-coursier" %% "versions" % "0.3.1", - "com.lihaoyi" %% "ujson" % "3.1.3", // TODO shade + "com.lihaoyi" %% "ujson" % "3.1.3", "com.eed3si9n.verify" %% "verify" % "2.0.1" % Test, ), + shadedModules += "com.lihaoyi" %% "ujson", + shadingRules ++= Seq( + ShadingRule.moveUnder("ujson", "sbtversionpolicy.internal.shaded"), + ShadingRule.moveUnder("upickle", "sbtversionpolicy.internal.shaded"), + ShadingRule.moveUnder("geny", "sbtversionpolicy.internal.shaded"), + ), + validNamespaces ++= Set("sbtversionpolicy", "com", "com.typesafe", "sbt"), + validEntries += "utf8.json", testFrameworks += new TestFramework("verify.runner.Framework"), mimaBinaryIssueFilters ++= Seq( // Add Mima filters here diff --git a/project/plugins.sbt b/project/plugins.sbt index a588b78..60efdba 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,3 +3,5 @@ addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "3.1.0") + +addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.1")