From 7764bacd91d79fb92aeb18eb01ad61838225aad1 Mon Sep 17 00:00:00 2001 From: Anton Parkhomenko Date: Wed, 21 Feb 2018 15:12:25 +0700 Subject: [PATCH] Common: bump SBT to 1.1.6 (close #89) --- build.sbt | 4 ++-- project/BuildSettings.scala | 43 ++++++++++++++++++------------------- project/build.properties | 2 +- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/build.sbt b/build.sbt index 6ed4761c9..49751cc08 100755 --- a/build.sbt +++ b/build.sbt @@ -16,10 +16,10 @@ lazy val loader = project.in(file(".")) name := "snowplow-rdb-loader", version := "0.14.0", initialCommands := "import com.snowplowanalytics.snowplow.rdbloader._", - mainClass in Compile := Some("com.snowplowanalytics.snowplow.rdbloader.Main") + Compile / mainClass := Some("com.snowplowanalytics.snowplow.rdbloader.Main") ) .settings(BuildSettings.buildSettings) - .settings(BuildSettings.scalifySettings(name in shredder, version in shredder)) + .settings(BuildSettings.scalifySettings(shredder / name, shredder / version)) .settings(BuildSettings.assemblySettings) .settings(resolvers ++= Dependencies.resolutionRepos) .settings( diff --git a/project/BuildSettings.scala b/project/BuildSettings.scala index d15ce0a1c..c8533109e 100644 --- a/project/BuildSettings.scala +++ b/project/BuildSettings.scala @@ -46,7 +46,7 @@ object BuildSettings { "-Xfuture" ), - scalacOptions in (Compile, console) := Seq( + Compile / console / scalacOptions := Seq( "-deprecation", "-encoding", "UTF-8" ), @@ -60,19 +60,19 @@ object BuildSettings { ) // sbt-assembly settings - lazy val jarName = assemblyJarName in assembly := { name.value + "-" + version.value + ".jar" } + lazy val jarName = assembly / assemblyJarName := { name.value + "-" + version.value + ".jar" } lazy val assemblySettings = Seq( jarName, - assemblyShadeRules in assembly := Seq( + assembly / assemblyShadeRules := Seq( ShadeRule.rename( // EMR has 0.1.42 installed "com.jcraft.jsch.**" -> "shadejsch.@1" ).inAll ), - assemblyMergeStrategy in assembly := { + assembly / assemblyMergeStrategy := { case PathList("META-INF", _ @ _*) => MergeStrategy.discard case PathList("reference.conf", _ @ _*) => MergeStrategy.concat case _ => MergeStrategy.first @@ -82,8 +82,8 @@ object BuildSettings { lazy val shredderAssemblySettings = Seq( jarName, // Drop these jars - assemblyExcludedJars in assembly := { - val cp = (fullClasspath in assembly).value + assembly / assemblyExcludedJars := { + val cp = (assembly / fullClasspath).value val excludes = Set( "jsp-api-2.1-6.1.14.jar", "jsp-2.1-6.1.14.jar", @@ -97,7 +97,8 @@ object BuildSettings { ) cp.filter { jar => excludes(jar.data.getName) } }, - assemblyMergeStrategy in assembly := { + + assembly / assemblyMergeStrategy := { case "project.clj" => MergeStrategy.discard // Leiningen build files case x if x.startsWith("META-INF") => MergeStrategy.discard case x if x.endsWith(".html") => MergeStrategy.discard @@ -105,7 +106,7 @@ object BuildSettings { case PathList("com", "google", "common", _) => MergeStrategy.first case PathList("org", "apache", "spark", "unused", _) => MergeStrategy.first case x => - val oldStrategy = (assemblyMergeStrategy in assembly).value + val oldStrategy = (assembly / assemblyMergeStrategy).value oldStrategy(x) } ) @@ -114,8 +115,8 @@ object BuildSettings { * Makes package (build) metadata available withing source code */ def scalifySettings(shredderName: SettingKey[String], shredderVersion: SettingKey[String]) = Seq( - sourceGenerators in Compile += Def.task { - val file = (sourceManaged in Compile).value / "settings.scala" + Compile / sourceGenerators += Def.task { + val file = (Compile / sourceManaged).value / "settings.scala" IO.write(file, """package com.snowplowanalytics.snowplow.rdbloader.generated |object ProjectMetadata { | val version = "%s" @@ -132,18 +133,16 @@ object BuildSettings { }.taskValue ) - lazy val oneJvmPerTestSetting = - testGrouping in Test := (definedTests in Test).value map { test => - Tests.Group(name = test.name, tests = Seq(test), runPolicy = Tests.SubProcess( - ForkOptions( - javaHome.value, - outputStrategy.value, - Nil, - Some(baseDirectory.value), - javaOptions.value, - connectInput.value, - envVars.value - ))) + Test / testGrouping := (Test / definedTests).value map { test => + val forkOptions = ForkOptions() + .withJavaHome(javaHome.value) + .withOutputStrategy(outputStrategy.value) + .withBootJars(Vector.empty) + .withWorkingDirectory(Option(baseDirectory.value)) + .withConnectInput(connectInput.value) + + val runPolicy = Tests.SubProcess(forkOptions) + Tests.Group(name = test.name, tests = Seq(test), runPolicy = runPolicy) } } diff --git a/project/build.properties b/project/build.properties index c091b86ca..d6e35076c 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.16 +sbt.version=1.1.6