Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala 2.12 and sbt updates #6328

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codegen_java/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lazy val root = (project in file(".")).
Seq(organization := "org.broadinstitute.cromwell",
name := "cromwell-client",
version := createVersion("0.1"),
scalaVersion := "2.12.12",
scalaVersion := "2.12.13",
scalacOptions ++= Seq("-feature"),
compile / javacOptions ++= Seq("-Xlint:deprecation"),
Compile / packageDoc / publishArtifact := false,
Expand Down
21 changes: 19 additions & 2 deletions project/Merging.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ import sbtassembly.AssemblyPlugin.autoImport._
import sbtassembly.{MergeStrategy, PathList}

object Merging {
//noinspection SameParameterValue
// Based on https://stackoverflow.com/questions/24363363/how-can-a-duplicate-class-be-excluded-from-sbt-assembly#57759013
private def excludeFromJar(jarName: String): sbtassembly.MergeStrategy = new sbtassembly.MergeStrategy {
override def name: String = "excludeFromJar"

override def apply(tempDir: File, path: String, files: Seq[File]): Either[String, Seq[(File, String)]] = {
val filteredFiles = files flatMap { file =>
val (source, _, _, isFromJar) = sbtassembly.AssemblyUtils.sourceOfFileForMerge(tempDir, file)
if (isFromJar && source.getName != jarName) Option(file -> path) else None
}
Right(filteredFiles)
}
}

val customMergeStrategy: Def.Initialize[String => MergeStrategy] = Def.setting {
case PathList(ps@_*) if ps.last == "project.properties" =>
// Merge/Filter project.properties files from Google jars that otherwise collide at merge time.
Expand All @@ -16,11 +30,11 @@ object Merging {
path map {
_.toLowerCase
} match {
case "spring.tooling" :: xs =>
case "spring.tooling" :: _ =>
MergeStrategy.discard
case "io.netty.versions.properties" :: Nil =>
MergeStrategy.first
case "maven" :: "com.google.guava" :: xs =>
case "maven" :: "com.google.guava" :: _ =>
MergeStrategy.first
case _ =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
Expand All @@ -40,6 +54,9 @@ object Merging {
MergeStrategy.discard
case PathList("mime.types") =>
MergeStrategy.last
case PathList("scala", "annotation", "nowarn.class" | "nowarn$.class") =>
// scala-collection-compat shading bug: https://github.com/scala/scala-collection-compat/issues/426
excludeFromJar("scala-collection-compat_2.12-2.4.2.jar")
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
Expand Down
3 changes: 1 addition & 2 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ object Settings {
sys.env.get("CROMWELL_SBT_ASSEMBLY_LOG_LEVEL").flatMap(Level.apply).getOrElse((assembly / logLevel).value)
)

// 2.12.13 blocked on the release of sbt-scoverage 1.6.2 https://github.com/scoverage/sbt-scoverage/issues/319
val Scala2_12Version = "2.12.12"
val Scala2_12Version = "2.12.13"
val ScalaVersion = Scala2_12Version
val sharedSettings =
cromwellVersionWithGit ++ artifactorySettings ++ List(
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.8.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.7.2")
2 changes: 1 addition & 1 deletion scripts/docker-develop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update -q && \
# Git

# Env variables
ENV SCALA_VERSION 2.12.12
ENV SCALA_VERSION 2.12.13
ENV SBT_VERSION 1.4.9

#
Expand Down