Temporarily switch to sbt-assembly

This commit is contained in:
Eugene Yokota 2022-09-23 14:03:55 -04:00
parent f9453d67c6
commit 36be86a0fc
5 changed files with 62 additions and 19 deletions

View File

@ -1,7 +1,7 @@
import Settings._
def dataclassScalafixV = "0.1.0-M3"
def dataclassScalafixV = "0.1.0"
inThisBuild(List(
organization := "org.scala-sbt",
@ -24,9 +24,30 @@ inThisBuild(List(
case v => v
}
},
version := "2.0.0-alpha1",
version := "2.0.0-alpha1-SNAPSHOT",
))
ThisBuild / assemblyMergeStrategy := {
case PathList("lmcoursier", "internal", "shaded", "org", "fusesource", xs @ _*) => MergeStrategy.first
// case PathList("lmcoursier", "internal", "shaded", "package.class") => MergeStrategy.first
// case PathList("lmcoursier", "internal", "shaded", "package$.class") => MergeStrategy.first
case PathList("com", "github") => MergeStrategy.discard
case PathList("com", "jcraft") => MergeStrategy.discard
case PathList("com", "lmax") => MergeStrategy.discard
case PathList("com", "sun") => MergeStrategy.discard
case PathList("com", "swoval") => MergeStrategy.discard
case PathList("com", "typesafe") => MergeStrategy.discard
case PathList("gigahorse") => MergeStrategy.discard
case PathList("jline") => MergeStrategy.discard
case PathList("scala") => MergeStrategy.discard
case PathList("sjsonnew") => MergeStrategy.discard
case PathList("xsbti") => MergeStrategy.discard
case PathList("META-INF", "native", xs @ _*) => MergeStrategy.first
case x =>
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}
val coursierVersion0 = "2.1.0-M5"
val lmVersion = "1.3.4"
val lm2_13Version = "1.5.0-M3"
@ -75,6 +96,7 @@ lazy val definitions = project
.in(file("modules/definitions"))
.disablePlugins(MimaPlugin)
.settings(
scalaVersion := scala3,
crossScalaVersions := Seq(scala212, scala213, scala3),
libraryDependencies ++= Seq(
("io.get-coursier" %% "coursier" % coursierVersion0).cross(CrossVersion.for3Use2_13),
@ -123,12 +145,11 @@ lazy val `lm-coursier-shaded-publishing` = project
.settings(
name := "librarymanagement-coursier",
crossScalaVersions := Seq(scala212, scala213, scala3),
Compile / packageBin := (`lm-coursier-shaded` / shadedPackageBin).value,
Compile / packageBin := (`lm-coursier-shaded` / assembly).value,
)
lazy val `lm-coursier-shaded` = project
.in(file("modules/lm-coursier/target/shaded-module"))
.enablePlugins(ShadingPlugin)
.settings(
shared,
crossScalaVersions := Seq(scala212, scala213, scala3),
@ -136,18 +157,18 @@ lazy val `lm-coursier-shaded` = project
Mima.lmCoursierFilters,
Mima.lmCoursierShadedFilters,
Compile / sources := (`lm-coursier` / Compile / sources).value,
shadedModules += "io.get-coursier" %% "coursier",
validNamespaces += "lmcoursier",
validEntries ++= Set(
// FIXME Ideally, we should just strip those from the resulting JAR…
"README", // from google-collections via plexus-archiver (see below)
// from plexus-util via plexus-archiver (see below)
"licenses/extreme.indiana.edu.license.TXT",
"licenses/javolution.license.TXT",
"licenses/thoughtworks.TXT",
"licenses/"
),
shadingRules ++= {
// shadedModules += "io.get-coursier" %% "coursier",
// validNamespaces += "lmcoursier",
// validEntries ++= Set(
// // FIXME Ideally, we should just strip those from the resulting JAR…
// "README", // from google-collections via plexus-archiver (see below)
// // from plexus-util via plexus-archiver (see below)
// "licenses/extreme.indiana.edu.license.TXT",
// "licenses/javolution.license.TXT",
// "licenses/thoughtworks.TXT",
// "licenses/"
// ),
assemblyShadeRules := {
val toShade = Seq(
"coursier",
"shapeless",
@ -156,9 +177,12 @@ lazy val `lm-coursier-shaded` = project
"macrocompat",
"io.github.alexarchambault.windowsansi",
"concurrentrefhashmap",
"com.github.ghik",
// pulled by the plexus-archiver stuff that coursier-cache
// depends on for now… can hopefully be removed in the future
"com.google.common",
"com.jcraft",
"com.lmax",
"org.apache.commons",
"org.apache.xbean",
"org.codehaus",
@ -166,7 +190,7 @@ lazy val `lm-coursier-shaded` = project
"org.tukaani"
)
for (ns <- toShade)
yield ShadingRule.moveUnder(ns, "lmcoursier.internal.shaded")
yield ShadeRule.rename(ns + ".**" -> s"lmcoursier.internal.shaded.$ns.@1").inAll
},
libraryDependencies ++= Seq(
("io.get-coursier" %% "coursier" % coursierVersion0).cross(CrossVersion.for3Use2_13),

View File

@ -23,7 +23,7 @@ object Settings {
lazy val shared = Seq(
resolvers += Resolver.sonatypeRepo("releases"),
crossScalaVersions := Seq(scala212),
scalaVersion := scala212,
scalaVersion := scala3,
scalacOptions ++= Seq(
"-feature",
"-deprecation",

View File

@ -1,6 +1,7 @@
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.0")
addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.0.1")
// addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.0.0-RC1")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.34")
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value

View File

@ -0,0 +1,12 @@
// DO NOT EDIT! This file is auto-generated.
// This plugin enables semantic information to be produced by sbt.
// It also adds support for debugging using the Debug Adapter Protocol
addSbtPlugin("org.scalameta" % "sbt-metals" % "0.11.7")
// This plugin makes sure that the JDI tools are in the sbt classpath.
// JDI tools are used by the debug adapter server.
addSbtPlugin("org.scala-debugger" % "sbt-jdi-tools" % "1.1.1")

View File

@ -0,0 +1,6 @@
// DO NOT EDIT! This file is auto-generated.
// This file enables sbt-bloop to create bloop config files.
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.2")