diff --git a/project/Common.scala b/project/Common.scala index a8f293f383..03def78400 100644 --- a/project/Common.scala +++ b/project/Common.scala @@ -1,6 +1,7 @@ import sbt._ import sbt.Keys._ import akka.grpc.sbt.AkkaGrpcPlugin +import com.lightbend.sbt.JavaFormatterPlugin.autoImport.javafmtOnCompile import de.heikoseeberger.sbtheader.{ AutomateHeaderPlugin, HeaderPlugin } import org.scalafmt.sbt.ScalafmtPlugin import org.scalafmt.sbt.ScalafmtPlugin.autoImport.scalafmtOnCompile @@ -31,12 +32,13 @@ object CommonSettings extends AutoPlugin { startYear := Some(2021), licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), scalafmtOnCompile := true, + javafmtOnCompile := true, scalaVersion := Dependencies.ScalaVersion, run / javaOptions ++= { sys.props.collect { case (key, value) if key.startsWith("akka") => s"-D$key=$value" }(breakOut) }) ++ ( if (sys.props.contains("disable.apidocs")) - Seq(Compile / doc / sources := Seq.empty, publishArtifact in (Compile, packageDoc) := false) + Seq(Compile / doc / sources := Seq.empty, Compile / packageDoc / publishArtifact := false) else Seq.empty ) diff --git a/project/build.properties b/project/build.properties index dbae93bcfd..bb3a9b7dc6 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.9 +sbt.version=1.5.6 diff --git a/project/plugins.sbt b/project/plugins.sbt index 8c491dbd34..81cb75c61e 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,8 +1,8 @@ -addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.4") +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1") addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.1.1") -addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.6.0") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") +addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.5") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7") diff --git a/sbt-plugin/src/main/scala/com/akkaserverless/sbt/AkkaserverlessPlugin.scala b/sbt-plugin/src/main/scala/com/akkaserverless/sbt/AkkaserverlessPlugin.scala index e1666929ef..154be33088 100644 --- a/sbt-plugin/src/main/scala/com/akkaserverless/sbt/AkkaserverlessPlugin.scala +++ b/sbt-plugin/src/main/scala/com/akkaserverless/sbt/AkkaserverlessPlugin.scala @@ -70,7 +70,7 @@ object AkkaserverlessPlugin extends AutoPlugin { ++ rootPackage.value.map(AkkaserverlessGenerator.rootPackage)) -> (Compile / sourceManaged).value, Compile / temporaryUnmanagedDirectory := (Compile / crossTarget).value / "akkaserverless-unmanaged", Test / temporaryUnmanagedDirectory := (Test / crossTarget).value / "akkaserverless-unmanaged-test", - protobufDescriptorSetOut := (resourceManaged in Compile).value / "protobuf" / "descriptor-sets" / "user-function.desc", + protobufDescriptorSetOut := (Compile / resourceManaged).value / "protobuf" / "descriptor-sets" / "user-function.desc", rootPackage := None, // FIXME there is a name clash between the Akka gRPC server-side service 'handler' // and the Akka Serverless 'handler'. For now working around it by only generating @@ -79,12 +79,12 @@ object AkkaserverlessPlugin extends AutoPlugin { Compile / PB.targets ++= Seq( genUnmanaged((akkaGrpcCodeGeneratorSettings.value :+ AkkaserverlessGenerator.enableDebug) ++ rootPackage.value.map(AkkaserverlessGenerator.rootPackage)) -> (Compile / temporaryUnmanagedDirectory).value), - Compile / PB.generate := (PB.generate in Compile) + Compile / PB.generate := (Compile / PB.generate) .dependsOn(Def.task { protobufDescriptorSetOut.value.getParentFile.mkdirs() }) .value, - PB.protocOptions in Compile ++= Seq( + Compile / PB.protocOptions ++= Seq( "--descriptor_set_out", protobufDescriptorSetOut.value.getAbsolutePath, "--include_source_info"),