Skip to content

Commit

Permalink
Updating build
Browse files Browse the repository at this point in the history
* SBT 1.3.3 -> 1.6.2
* Bumping all plugins and removing unused sbt-native-packager plugin
* Changing deprecated "key in config" -> "config / key"
* Updating sbt install in Docker build
  • Loading branch information
mkr committed Nov 30, 2022
1 parent 0393c0d commit 980d63e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 27 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ FROM openjdk:11-buster as builder

ARG NODE_VERSION=10

# Fixed location for "SBT Debian packages no longer available" (see https://issueexplorer.com/issue/SpinalHDL/VexRiscv/188). Do not use "https://dl.bintray.com/sbt/debian" anymore.
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" > /etc/apt/sources.list.d/sbt.list \
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list \
&& curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add \
&& apt-get update \
&& apt-get install -y sbt
Expand All @@ -20,7 +19,7 @@ RUN apt-get install -y lsb-release \
COPY . /smui
WORKDIR /smui

RUN --mount=target=/root/.ivy2,type=cache sbt "set test in assembly := {}" clean assembly
RUN --mount=target=/root/.ivy2,type=cache sbt "set assembly / test := {}" clean assembly

FROM openjdk:11-jre-slim-buster

Expand Down
22 changes: 12 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import com.typesafe.sbt.GitBranchPrompt
name := "search-management-ui"
version := "3.14.0"

scalaVersion := "2.12.11"
scalaVersion := "2.12.17"

ThisBuild / evictionErrorLevel := Level.Info

lazy val root = (project in file("."))
.enablePlugins(PlayScala)
Expand All @@ -19,7 +21,7 @@ lazy val root = (project in file("."))
)
.settings(dependencyCheckSettings: _*)

updateOptions := updateOptions.value.withCachedResolution(cachedResoluton = true)
updateOptions := updateOptions.value.withCachedResolution(cachedResolution = true)

lazy val dependencyCheckSettings: Seq[Setting[_]] = {
import DependencyCheckPlugin.autoImport._
Expand Down Expand Up @@ -68,25 +70,25 @@ dependencyOverrides ++= {
)
}

mainClass in assembly := Some("play.core.server.ProdServerStart")
fullClasspath in assembly += Attributed.blank(PlayKeys.playPackageAssets.value)
assembly / mainClass := Some("play.core.server.ProdServerStart")
assembly / fullClasspath += Attributed.blank(PlayKeys.playPackageAssets.value)

assemblyMergeStrategy in assembly := {
assembly / assemblyMergeStrategy := {
case manifest if manifest.contains("MANIFEST.MF") =>
// We don't need manifest files since sbt-assembly will create
// one with the given settings
MergeStrategy.discard
case "module-info.class" => MergeStrategy.discard
case "play/reference-overrides.conf" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}

lazy val dockerNamespace = "querqy"
lazy val dockerRepo = "smui"

imageNames in docker := {
docker / imageNames := {
val semVerLevels = version.value.split('.')
val majorVersion = semVerLevels.head
val minorVersion = semVerLevels.drop(1).head
Expand All @@ -101,13 +103,13 @@ imageNames in docker := {
}
}

dockerfile in docker := NativeDockerfile(baseDirectory.value / "Dockerfile")
docker / dockerfile := NativeDockerfile(baseDirectory.value / "Dockerfile")

dockerBuildArguments in docker := Map(
docker / dockerBuildArguments := Map(
"VERSION" -> version.value,
)

buildOptions in docker := BuildOptions(
docker / buildOptions := BuildOptions(
pullBaseImage = BuildOptions.Pull.Always
)

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.3
sbt.version=1.6.2
20 changes: 8 additions & 12 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
resolvers += "sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.3.2")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.2")
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.8.0")

addSbtPlugin("net.vonbuchholtz" % "sbt-dependency-check" % "2.0.0")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.1")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.9")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.2")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.0.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.9.0")
addSbtPlugin("net.vonbuchholtz" % "sbt-dependency-check" % "4.2.0")
addDependencyTreePlugin
2 changes: 1 addition & 1 deletion ui-build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ dist := (dist dependsOn `ui-prod-build`).value
stage := (stage dependsOn `ui-prod-build`).value

// Execute frontend test task prior to play test execution.
test := ((test in Test) dependsOn `ui-test`).value
test := ((Test / test) dependsOn `ui-test`).value

0 comments on commit 980d63e

Please sign in to comment.