diff --git a/core/cloudflow-it/swiss-knife/build.sbt b/core/cloudflow-it/swiss-knife/build.sbt index 9199450c2..bf8dec19e 100644 --- a/core/cloudflow-it/swiss-knife/build.sbt +++ b/core/cloudflow-it/swiss-knife/build.sbt @@ -2,62 +2,45 @@ import sbt._ import sbt.Keys._ lazy val swissKnife = (project in file(".")) - .enablePlugins(ScalafmtPlugin) - .settings( - scalafmtOnCompile := true, - organization := "com.lightbend.cloudflow", - headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2021", "Lightbend Inc. ")) - ) - .settings(commonSettings) - .aggregate( - app, - datamodel, - akka - ) -lazy val app = (project in file("./app")) + .enablePlugins(ScalafmtPlugin) .settings( - name:= "swiss-knife" - ) + scalafmtOnCompile := true, + organization := "com.lightbend.cloudflow", + headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2021", "Lightbend Inc. "))) + .settings(commonSettings) + .aggregate(app, datamodel, akka) +lazy val app = (project in file("./app")) + .settings(name := "swiss-knife") .enablePlugins(CloudflowApplicationPlugin) .settings(commonSettings) - .settings( - name := "swiss-knife", - runLocalConfigFile := Some("app/src/main/resources/local.conf"), - ) - + .settings(name := "swiss-knife", runLocalConfigFile := Some("app/src/main/resources/local.conf")) + lazy val datamodel = (project in file("datamodel")) .settings( commonSettings, Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, - libraryDependencies += Cloudflow.library.CloudflowAvro - ) + libraryDependencies += Cloudflow.library.CloudflowAvro) lazy val akka = (project in file("./akka")) .enablePlugins(CloudflowAkkaPlugin) .settings(commonSettings) - .settings( - name := "swiss-knife-akka", - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11", - ) - ) + .settings(name := "swiss-knife-akka", libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.4.6")) .dependsOn(datamodel) lazy val commonSettings = Seq( headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), scalaVersion := "2.12.15", scalacOptions ++= Seq( - "-encoding", "UTF-8", - "-target:jvm-1.8", - "-Xlog-reflective-calls", - "-Xlint", - "-Ywarn-unused", - "-Ywarn-unused-import", - "-deprecation", - "-feature", - "-language:_", - "-unchecked" - ) -) + "-encoding", + "UTF-8", + "-target:jvm-1.8", + "-Xlog-reflective-calls", + "-Xlint", + "-Ywarn-unused", + "-Ywarn-unused-import", + "-deprecation", + "-feature", + "-language:_", + "-unchecked")) dynverSeparator in ThisBuild := "-" diff --git a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/app-graph-generation/build.sbt b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/app-graph-generation/build.sbt index 5b9b2c005..7e9aec24f 100644 --- a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/app-graph-generation/build.sbt +++ b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/app-graph-generation/build.sbt @@ -5,7 +5,4 @@ lazy val helloWorld = (project in file(".")) name := "hello-world", version := "0.0.1", cloudflowDockerBaseImage := "adoptopenjdk/openjdk11:alpine", - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11" - ) - ) + libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.4.6")) diff --git a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/base-image/build.sbt b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/base-image/build.sbt index 202161795..7e9aec24f 100644 --- a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/base-image/build.sbt +++ b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/base-image/build.sbt @@ -1,13 +1,8 @@ -lazy val helloWorld = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) - .settings( - scalaVersion := "2.12.15", - name := "hello-world", - version := "0.0.1", - - cloudflowDockerBaseImage := "adoptopenjdk/openjdk11:alpine", - - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11" - ) - ) +lazy val helloWorld = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) + .settings( + scalaVersion := "2.12.15", + name := "hello-world", + version := "0.0.1", + cloudflowDockerBaseImage := "adoptopenjdk/openjdk11:alpine", + libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.4.6")) diff --git a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/decouple-version/build.sbt b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/decouple-version/build.sbt index ee29b265c..b971b8c0f 100644 --- a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/decouple-version/build.sbt +++ b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/decouple-version/build.sbt @@ -1,15 +1,12 @@ -lazy val helloWorld = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) - .settings( - scalaVersion := "2.12.15", - cloudflowVersion := "2.0.19", - name := "hello-world", - // sbt 1.5: Do not fail when mixing versions of Cloudflow and dependencies - evictionErrorLevel := Level.Info, - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11" - ) - ) +lazy val helloWorld = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) + .settings( + scalaVersion := "2.12.15", + cloudflowVersion := "2.0.19", + name := "hello-world", + // sbt 1.5: Do not fail when mixing versions of Cloudflow and dependencies + evictionErrorLevel := Level.Info, + libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.4.6")) val checkCloudflowVersion = taskKey[Unit]("Testing the used version of cloudflow") checkCloudflowVersion := { diff --git a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/no-jar-duplicates/build.sbt b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/no-jar-duplicates/build.sbt index 311521955..f7fa8393b 100644 --- a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/no-jar-duplicates/build.sbt +++ b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/no-jar-duplicates/build.sbt @@ -1,20 +1,18 @@ -lazy val helloWorld = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) - .settings( - scalaVersion := "2.12.15", - name := "hello-world", - version := "0.0.1", - - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11" - ) - ) +lazy val helloWorld = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) + .settings( + scalaVersion := "2.12.15", + name := "hello-world", + version := "0.0.1", + libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.4.6")) val checkDuplicates = taskKey[Unit]("Testing there are no duplicate jars in the final image") checkDuplicates := { import scala.sys.process._ - val res = (Seq("docker", "run", "--rm", "--entrypoint=sh", "hello-world:0.0.2", "-c", "ls /opt/cloudflow") #| Seq("grep", "hello-world")).!! + val res = (Seq("docker", "run", "--rm", "--entrypoint=sh", "hello-world:0.0.2", "-c", "ls /opt/cloudflow") #| Seq( + "grep", + "hello-world")).!! assert { res.trim == "hello-world_2.12-0.0.2.jar" } } diff --git a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/registry-with-port/build.sbt b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/registry-with-port/build.sbt index 8cd96f6ea..b67a47f6c 100644 --- a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/registry-with-port/build.sbt +++ b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/registry-with-port/build.sbt @@ -1,20 +1,16 @@ -lazy val helloWorld = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) - .settings( - scalaVersion := "2.12.15", - name := "hello-world", - version := "0.0.1", - - cloudflowDockerImageName := Some(cloudflow.sbt.DockerImageName(s"localhost:5000/hello-world", "0.0.1")), - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11" - ) - ) +lazy val helloWorld = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) + .settings( + scalaVersion := "2.12.15", + name := "hello-world", + version := "0.0.1", + cloudflowDockerImageName := Some(cloudflow.sbt.DockerImageName(s"localhost:5000/hello-world", "0.0.1")), + libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.4.6")) val checkCRFile = taskKey[Unit]("Testing the CR file") checkCRFile := { val data = ujson.read(file("target/hello-world.json")) val image = data("spec")("deployments")(0)("image").str - assert { image == "localhost:5000/hello-world:0.0.1"} + assert { image == "localhost:5000/hello-world:0.0.1" } } diff --git a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/simple/build.sbt b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/simple/build.sbt index ab1c4cc63..ed8376a73 100644 --- a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/simple/build.sbt +++ b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/simple/build.sbt @@ -1,14 +1,10 @@ -lazy val helloWorld = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) - .settings( - scalaVersion := "2.12.15", - name := "hello-world", - version := "0.0.1", - - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11" - ) - ) +lazy val helloWorld = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) + .settings( + scalaVersion := "2.12.15", + name := "hello-world", + version := "0.0.1", + libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.4.6")) val checkCRFile = taskKey[Unit]("Testing the CR file") checkCRFile := { @@ -16,10 +12,10 @@ checkCRFile := { val appId = data("spec")("app_id").str val appVersion = data("spec")("app_version").str - + val image = data("spec")("deployments")(0)("image").str assert { appId == "hello-world" } assert { !appVersion.contains("sha256") } - assert { image == "hello-world:0.0.1"} + assert { image == "hello-world:0.0.1" } } diff --git a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/simple213/build.sbt b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/simple213/build.sbt index 5ec7916f6..77c7f0bd7 100644 --- a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/simple213/build.sbt +++ b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/simple213/build.sbt @@ -1,14 +1,10 @@ -lazy val helloWorld = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) - .settings( - scalaVersion := "2.13.8", - name := "hello-world", - version := "0.0.1", - - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11" - ) - ) +lazy val helloWorld = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) + .settings( + scalaVersion := "2.13.8", + name := "hello-world", + version := "0.0.1", + libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.4.6")) val checkCRFile = taskKey[Unit]("Testing the CR file") checkCRFile := { @@ -16,10 +12,10 @@ checkCRFile := { val appId = data("spec")("app_id").str val appVersion = data("spec")("app_version").str - + val image = data("spec")("deployments")(0)("image").str assert { appId == "hello-world" } assert { !appVersion.contains("sha256") } - assert { image == "hello-world:0.0.1"} + assert { image == "hello-world:0.0.1" } } diff --git a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/version/build.sbt b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/version/build.sbt index c4f574f50..b7685f71a 100644 --- a/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/version/build.sbt +++ b/core/cloudflow-sbt-plugin/src/sbt-test/sbt-cloudflow/version/build.sbt @@ -1,29 +1,23 @@ val version1 = "1.2.3-SNAPSHOT" val version2 = "10.0.0" -lazy val helloWorld1 = (project in file("helloworld1")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) - .settings( - version := version1, - scalaVersion := "2.12.15", - name := "hello-world-1", - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11" - ) - ) +lazy val helloWorld1 = (project in file("helloworld1")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) + .settings( + version := version1, + scalaVersion := "2.12.15", + name := "hello-world-1", + libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.4.6")) -lazy val helloWorld2 = (project in file("helloworld2")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) - .settings( - version := version2, - scalaVersion := "2.12.15", - name := "hello-world-2", - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11" - ) - ) +lazy val helloWorld2 = (project in file("helloworld2")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) + .settings( + version := version2, + scalaVersion := "2.12.15", + name := "hello-world-2", + libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.4.6")) -lazy val root = (project in file("root")).aggregate(helloWorld1, helloWorld2) +lazy val root = (project in file("root")).aggregate(helloWorld1, helloWorld2) val checkVersions = taskKey[Unit]("Testing the versions of the produced apps") checkVersions := { diff --git a/core/project/Dependencies.scala b/core/project/Dependencies.scala index c8d953807..caf7164dc 100644 --- a/core/project/Dependencies.scala +++ b/core/project/Dependencies.scala @@ -32,7 +32,7 @@ object Dependencies { val airframeLog = "org.wvlet.airframe" %% "airframe-log" % "22.5.0" val asciiTable = "de.vandermeer" % "asciitable" % "0.3.2" - val logback = "ch.qos.logback" % "logback-classic" % "1.2.11" + val logback = "ch.qos.logback" % "logback-classic" % "1.4.6" val scalatest = "org.scalatest" %% "scalatest" % Versions.scalaTest val scalatestMustMatchers = "org.scalatest" %% "scalatest-mustmatchers" % Versions.scalaTest diff --git a/examples/connected-car-cluster-sharding/build.sbt b/examples/connected-car-cluster-sharding/build.sbt index de88eea89..a706c7f51 100644 --- a/examples/connected-car-cluster-sharding/build.sbt +++ b/examples/connected-car-cluster-sharding/build.sbt @@ -6,45 +6,31 @@ val AkkaVersion = "2.6.6" lazy val root = Project(id = "root", base = file(".")) .enablePlugins(ScalafmtPlugin) - .settings( - name := "root", - scalafmtOnCompile := true, - publish / skip := true, - ) + .settings(name := "root", scalafmtOnCompile := true, publish / skip := true) .withId("root") .settings(commonSettings) - .aggregate( - connectedCarExample, - datamodel, - akkaConnectedCar - ) + .aggregate(connectedCarExample, datamodel, akkaConnectedCar) lazy val connectedCarExample = (project in file("./akka-connected-car")) .enablePlugins(CloudflowApplicationPlugin) .settings( commonSettings, name := "connected-car-akka-cluster", - libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "3.0.7" % "test" - ) - ) + libraryDependencies ++= Seq("org.scalatest" %% "scalatest" % "3.0.7" % "test")) lazy val datamodel = (project in file("./datamodel")) .settings( Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, - libraryDependencies += Cloudflow.library.CloudflowAvro - ) + libraryDependencies += Cloudflow.library.CloudflowAvro) -lazy val akkaConnectedCar= (project in file("./akka-connected-car-streamlet")) +lazy val akkaConnectedCar = (project in file("./akka-connected-car-streamlet")) .enablePlugins(CloudflowAkkaPlugin) .settings( commonSettings, name := "akka-connected-car-streamlet", libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.11", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ) - ) + "ch.qos.logback" % "logback-classic" % "1.4.6", + "org.scalatest" %% "scalatest" % "3.0.8" % "test")) .dependsOn(datamodel) lazy val commonSettings = Seq( @@ -52,21 +38,18 @@ lazy val commonSettings = Seq( headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), scalaVersion := "2.12.15", scalacOptions ++= Seq( - "-encoding", "UTF-8", - "-target:jvm-1.8", - "-Xlog-reflective-calls", - "-Xlint", - "-Ywarn-unused", - "-Ywarn-unused-import", - "-deprecation", - "-feature", - "-language:_", - "-unchecked" - ), - + "-encoding", + "UTF-8", + "-target:jvm-1.8", + "-Xlog-reflective-calls", + "-Xlint", + "-Ywarn-unused", + "-Ywarn-unused-import", + "-deprecation", + "-feature", + "-language:_", + "-unchecked"), Compile / console / scalacOptions --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), - Test / console / scalacOptions := (Compile / console / scalacOptions).value - -) + Test / console / scalacOptions := (Compile / console / scalacOptions).value) ThisBuild / dynverSeparator := "-" diff --git a/examples/snippets/modules/ROOT/examples/akkastreams-java/build.sbt b/examples/snippets/modules/ROOT/examples/akkastreams-java/build.sbt index ecbb70c5d..c1a3c2c57 100644 --- a/examples/snippets/modules/ROOT/examples/akkastreams-java/build.sbt +++ b/examples/snippets/modules/ROOT/examples/akkastreams-java/build.sbt @@ -2,30 +2,30 @@ import sbt._ import sbt.Keys._ -lazy val sensorData = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) - .settings( +lazy val sensorData = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) + .settings( //end::docs-projectSetup-example[] - libraryDependencies ++= Seq( + libraryDependencies ++= Seq( Cloudflow.library.CloudflowAvro, - "com.lightbend.akka" %% "akka-stream-alpakka-file" % "1.1.2", - "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", - "com.typesafe.akka" %% "akka-http-jackson" % "10.1.12", - "ch.qos.logback" % "logback-classic" % "1.2.11", - "com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" + "com.lightbend.akka" %% "akka-stream-alpakka-file" % "1.1.2", + "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", + "com.typesafe.akka" %% "akka-http-jackson" % "10.1.12", + "ch.qos.logback" % "logback-classic" % "1.4.6", + "com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test", + "org.scalatest" %% "scalatest" % "3.0.8" % "test" //tag::docs-projectName-example[] ), - name := "akkastreams-doc", + name := "akkastreams-doc", //end::docs-projectName-example[] - organization := "com.lightbend.cloudflow", - headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), - - scalaVersion := "2.12.15", - crossScalaVersions := Vector(scalaVersion.value), - javacOptions ++= Seq("-Xlint:deprecation"), - scalacOptions ++= Seq( - "-encoding", "UTF-8", + organization := "com.lightbend.cloudflow", + headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), + scalaVersion := "2.12.15", + crossScalaVersions := Vector(scalaVersion.value), + javacOptions ++= Seq("-Xlint:deprecation"), + scalacOptions ++= Seq( + "-encoding", + "UTF-8", "-target:jvm-1.8", "-Xlog-reflective-calls", "-Xlint", @@ -34,18 +34,12 @@ lazy val sensorData = (project in file(".")) "-deprecation", "-feature", "-language:_", - "-unchecked" - ), - javacOptions ++= Seq("-Xlint:deprecation"), - runLocalConfigFile := Some("src/main/resources/local.conf"), - libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "3.0.8" % "test", - "junit" % "junit" % "4.12" % "test"), - - Compile / console / scalacOptions --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), - avroStringType := "String", - Test / console / scalacOptions := (Compile / console / scalacOptions).value - - ) + "-unchecked"), + javacOptions ++= Seq("-Xlint:deprecation"), + runLocalConfigFile := Some("src/main/resources/local.conf"), + libraryDependencies ++= Seq("org.scalatest" %% "scalatest" % "3.0.8" % "test", "junit" % "junit" % "4.12" % "test"), + Compile / console / scalacOptions --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), + avroStringType := "String", + Test / console / scalacOptions := (Compile / console / scalacOptions).value) ThisBuild / dynverSeparator := "-" diff --git a/examples/snippets/modules/ROOT/examples/akkastreams-scala/build.sbt b/examples/snippets/modules/ROOT/examples/akkastreams-scala/build.sbt index ac33c3022..5712ce235 100644 --- a/examples/snippets/modules/ROOT/examples/akkastreams-scala/build.sbt +++ b/examples/snippets/modules/ROOT/examples/akkastreams-scala/build.sbt @@ -2,28 +2,28 @@ import sbt._ import sbt.Keys._ -lazy val sensorData = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) // <1> - .settings( +lazy val sensorData = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) // <1> + .settings( // end::docs-projectSetup-example[] - libraryDependencies ++= Seq( + libraryDependencies ++= Seq( Cloudflow.library.CloudflowAvro, - "com.lightbend.akka" %% "akka-stream-alpakka-file" % "1.1.2", - "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", - "ch.qos.logback" % "logback-classic" % "1.2.11", - "com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" + "com.lightbend.akka" %% "akka-stream-alpakka-file" % "1.1.2", + "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", + "ch.qos.logback" % "logback-classic" % "1.4.6", + "com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test", + "org.scalatest" %% "scalatest" % "3.0.8" % "test" // tag::docs-projectName-example[] ), - name := "akkastreams-doc", + name := "akkastreams-doc", // end::docs-projectName-example[] - organization := "com.lightbend.cloudflow", - headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), - - scalaVersion := "2.12.15", - crossScalaVersions := Vector(scalaVersion.value), - scalacOptions ++= Seq( - "-encoding", "UTF-8", + organization := "com.lightbend.cloudflow", + headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), + scalaVersion := "2.12.15", + crossScalaVersions := Vector(scalaVersion.value), + scalacOptions ++= Seq( + "-encoding", + "UTF-8", "-target:jvm-1.8", "-Xlog-reflective-calls", "-Xlint", @@ -32,12 +32,10 @@ lazy val sensorData = (project in file(".")) "-deprecation", "-feature", "-language:_", - "-unchecked" - ), - runLocalConfigFile := Some("src/main/resources/local.conf"), - Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, - Compile / console / scalacOptions --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), - Test / console / scalacOptions := (Compile / console / scalacOptions).value - ) + "-unchecked"), + runLocalConfigFile := Some("src/main/resources/local.conf"), + Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, + Compile / console / scalacOptions --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), + Test / console / scalacOptions := (Compile / console / scalacOptions).value) ThisBuild / dynverSeparator := "-" diff --git a/examples/snippets/modules/ROOT/examples/base-images-override/build.sbt b/examples/snippets/modules/ROOT/examples/base-images-override/build.sbt index 078556d0b..bd0f8e8cb 100644 --- a/examples/snippets/modules/ROOT/examples/base-images-override/build.sbt +++ b/examples/snippets/modules/ROOT/examples/base-images-override/build.sbt @@ -1,20 +1,18 @@ import sbt._ import sbt.Keys._ - //tag::docs-projectSetup-example[] +//tag::docs-projectSetup-example[] lazy val sampleApp = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin) - .settings( - cloudflowDockerBaseImage := "myRepositoryUrl/myRepositoryPath:adoptopenjdk/openjdk11:alpine", + .enablePlugins(CloudflowApplicationPlugin) + .settings( + cloudflowDockerBaseImage := "myRepositoryUrl/myRepositoryPath:adoptopenjdk/openjdk11:alpine", //end::docs-projectSetup-example[] - name := "sample-app", - organization := "com.lightbend.cloudflow", - scalaVersion := "2.12.15", - libraryDependencies ++= Seq( - "com.lightbend.akka" %% "akka-stream-alpakka-file" % "1.1.2", - "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", - "ch.qos.logback" % "logback-classic" % "1.2.11", - "com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ) - ) + name := "sample-app", + organization := "com.lightbend.cloudflow", + scalaVersion := "2.12.15", + libraryDependencies ++= Seq( + "com.lightbend.akka" %% "akka-stream-alpakka-file" % "1.1.2", + "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", + "ch.qos.logback" % "logback-classic" % "1.4.6", + "com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test", + "org.scalatest" %% "scalatest" % "3.0.8" % "test")) diff --git a/examples/snippets/modules/ROOT/examples/sensor-data-scala/build.sbt b/examples/snippets/modules/ROOT/examples/sensor-data-scala/build.sbt index c184d4497..11069a07c 100644 --- a/examples/snippets/modules/ROOT/examples/sensor-data-scala/build.sbt +++ b/examples/snippets/modules/ROOT/examples/sensor-data-scala/build.sbt @@ -1,34 +1,30 @@ //tag::get-started[] //tag::local-conf[] -lazy val sensorData = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) - .settings( - scalaVersion := "2.13.3", - runLocalConfigFile := Some("src/main/resources/local.conf"), //<1> - runLocalLog4jConfigFile := Some("src/main/resources/log4j.xml"), //<2> - name := "sensor-data-scala", -//end::local-conf[] - - libraryDependencies ++= Seq( +lazy val sensorData = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin) + .settings( + scalaVersion := "2.13.3", + runLocalConfigFile := Some("src/main/resources/local.conf"), //<1> + runLocalLog4jConfigFile := Some("src/main/resources/log4j.xml"), //<2> + name := "sensor-data-scala", +//end::local-conf[] + libraryDependencies ++= Seq( Cloudflow.library.CloudflowAvro, - "com.lightbend.akka" %% "akka-stream-alpakka-file" % "1.1.2", - "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", - "ch.qos.logback" % "logback-classic" % "1.2.11", - "com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ) - ) -//end::get-started[] - .enablePlugins(ScalafmtPlugin) - .settings( - scalafmtOnCompile := true, - - organization := "com.lightbend.cloudflow", - headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), - - crossScalaVersions := Vector(scalaVersion.value), - scalacOptions ++= Seq( - "-encoding", "UTF-8", + "com.lightbend.akka" %% "akka-stream-alpakka-file" % "1.1.2", + "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", + "ch.qos.logback" % "logback-classic" % "1.4.6", + "com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test", + "org.scalatest" %% "scalatest" % "3.0.8" % "test")) + //end::get-started[] + .enablePlugins(ScalafmtPlugin) + .settings( + scalafmtOnCompile := true, + organization := "com.lightbend.cloudflow", + headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), + crossScalaVersions := Vector(scalaVersion.value), + scalacOptions ++= Seq( + "-encoding", + "UTF-8", "-target:jvm-1.8", "-Xlog-reflective-calls", "-Xlint", @@ -36,12 +32,9 @@ lazy val sensorData = (project in file(".")) "-deprecation", "-feature", "-language:_", - "-unchecked" - ), - - Compile / console / scalacOptions --= Seq("-Ywarn-unused"), - Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, - Test / console / scalacOptions := (Compile / console / scalacOptions).value - ) + "-unchecked"), + Compile / console / scalacOptions --= Seq("-Ywarn-unused"), + Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, + Test / console / scalacOptions := (Compile / console / scalacOptions).value) ThisBuild / dynverSeparator := "-" diff --git a/examples/templates/single-backend-java/build.sbt b/examples/templates/single-backend-java/build.sbt index 0560abaea..8cc79dda5 100644 --- a/examples/templates/single-backend-java/build.sbt +++ b/examples/templates/single-backend-java/build.sbt @@ -2,23 +2,21 @@ import sbt._ import sbt.Keys._ lazy val templateJavaProject = (project in file(".")) - .enablePlugins(CloudflowAkkaPlugin, CloudflowApplicationPlugin, ScalafmtPlugin) - .settings( - scalafmtOnCompile := true, - libraryDependencies ++= Seq( + .enablePlugins(CloudflowAkkaPlugin, CloudflowApplicationPlugin, ScalafmtPlugin) + .settings( + scalafmtOnCompile := true, + libraryDependencies ++= Seq( Cloudflow.library.CloudflowAvro, - "ch.qos.logback" % "logback-classic" % "1.2.11", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ), - - name := "template-java", - organization := "com.lightbend.cloudflow", - headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), - - scalaVersion := "2.12.15", - crossScalaVersions := Vector(scalaVersion.value), - scalacOptions ++= Seq( - "-encoding", "UTF-8", + "ch.qos.logback" % "logback-classic" % "1.4.6", + "org.scalatest" %% "scalatest" % "3.0.8" % "test"), + name := "template-java", + organization := "com.lightbend.cloudflow", + headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), + scalaVersion := "2.12.15", + crossScalaVersions := Vector(scalaVersion.value), + scalacOptions ++= Seq( + "-encoding", + "UTF-8", "-target:jvm-1.8", "-Xlog-reflective-calls", "-Xlint", @@ -27,12 +25,10 @@ lazy val templateJavaProject = (project in file(".")) "-deprecation", "-feature", "-language:_", - "-unchecked" - ), - runLocalConfigFile := Some("src/main/resources/local.conf"), - Compile / console / scalacOptions --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), - avroStringType := "String", - Test / console / scalacOptions := (Compile / console / scalacOptions).value - ) + "-unchecked"), + runLocalConfigFile := Some("src/main/resources/local.conf"), + Compile / console / scalacOptions --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), + avroStringType := "String", + Test / console / scalacOptions := (Compile / console / scalacOptions).value) ThisBuild / dynverSeparator := "-" diff --git a/examples/templates/single-backend-scala/build.sbt b/examples/templates/single-backend-scala/build.sbt index 50929c0d8..8e3952e73 100644 --- a/examples/templates/single-backend-scala/build.sbt +++ b/examples/templates/single-backend-scala/build.sbt @@ -6,32 +6,29 @@ lazy val templateScala = (project in file(".")) .settings( scalafmtOnCompile := true, libraryDependencies ++= Seq( - Cloudflow.library.CloudflowAvro, - "ch.qos.logback" % "logback-classic" % "1.2.11", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ), + Cloudflow.library.CloudflowAvro, + "ch.qos.logback" % "logback-classic" % "1.4.6", + "org.scalatest" %% "scalatest" % "3.0.8" % "test"), name := "template-scala", organization := "com.lightbend.cloudflow", headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), scalaVersion := "2.12.15", crossScalaVersions := Vector(scalaVersion.value), scalacOptions ++= Seq( - "-encoding", - "UTF-8", - "-target:jvm-1.8", - "-Xlog-reflective-calls", - "-Xlint", - "-Ywarn-unused", - "-Ywarn-unused-import", - "-deprecation", - "-feature", - "-language:_", - "-unchecked" - ), + "-encoding", + "UTF-8", + "-target:jvm-1.8", + "-Xlog-reflective-calls", + "-Xlint", + "-Ywarn-unused", + "-Ywarn-unused-import", + "-deprecation", + "-feature", + "-language:_", + "-unchecked"), runLocalConfigFile := Some("src/main/resources/local.conf"), Compile / console / scalacOptions --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, - Test / console / scalacOptions := (Compile / console / scalacOptions).value - ) + Test / console / scalacOptions := (Compile / console / scalacOptions).value) ThisBuild / dynverSeparator := "-" diff --git a/examples/tensorflow-akka/build.sbt b/examples/tensorflow-akka/build.sbt index 8f0fafae8..51537081c 100644 --- a/examples/tensorflow-akka/build.sbt +++ b/examples/tensorflow-akka/build.sbt @@ -2,29 +2,29 @@ import sbt._ import sbt.Keys._ -lazy val tensorflowAkka = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin, ScalafmtPlugin) - .settings( +lazy val tensorflowAkka = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin, ScalafmtPlugin) + .settings( //end::docs-projectSetup-example[] - scalafmtOnCompile := true, - libraryDependencies ++= Seq( + scalafmtOnCompile := true, + libraryDependencies ++= Seq( Cloudflow.library.CloudflowAvro, - "ch.qos.logback" % "logback-classic" % "1.2.11", - "com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test", - "org.tensorflow" % "tensorflow" % "1.15.0", - "org.tensorflow" % "proto" % "1.15.0", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" + "ch.qos.logback" % "logback-classic" % "1.4.6", + "com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test", + "org.tensorflow" % "tensorflow" % "1.15.0", + "org.tensorflow" % "proto" % "1.15.0", + "org.scalatest" %% "scalatest" % "3.0.8" % "test" //tag::docs-projectName-example[] ), - name := "tensorflow-akka", + name := "tensorflow-akka", //end::docs-projectName-example[] - organization := "com.lightbend.cloudflow", - headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), - - scalaVersion := "2.12.15", - crossScalaVersions := Vector(scalaVersion.value), - scalacOptions ++= Seq( - "-encoding", "UTF-8", + organization := "com.lightbend.cloudflow", + headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), + scalaVersion := "2.12.15", + crossScalaVersions := Vector(scalaVersion.value), + scalacOptions ++= Seq( + "-encoding", + "UTF-8", "-target:jvm-1.8", "-Xlog-reflective-calls", "-Xlint", @@ -33,12 +33,10 @@ lazy val tensorflowAkka = (project in file(".")) "-deprecation", "-feature", "-language:_", - "-unchecked" - ), - Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, - runLocalConfigFile := Some("src/main/resources/local.conf"), - Compile / console / scalacOptions --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), - Test / console / scalacOptions := (Compile / console / scalacOptions).value, - ) + "-unchecked"), + Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, + runLocalConfigFile := Some("src/main/resources/local.conf"), + Compile / console / scalacOptions --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), + Test / console / scalacOptions := (Compile / console / scalacOptions).value) ThisBuild / dynverSeparator := "-"