diff --git a/cloudflow-it/swiss-knife/build.sbt b/cloudflow-it/swiss-knife/build.sbt index 1e116a2..d144c8c 100644 --- a/cloudflow-it/swiss-knife/build.sbt +++ b/cloudflow-it/swiss-knife/build.sbt @@ -2,70 +2,49 @@ 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, - flink, - akka, - spark - ) -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, flink, akka, spark) +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.10", - ) - ) + .settings(name := "swiss-knife-akka", libraryDependencies ++= Seq("ch.qos.logback" % "logback-classic" % "1.2.10")) .dependsOn(datamodel) lazy val spark = (project in file("./spark")) .enablePlugins(CloudflowNativeSparkPlugin) - .settings(commonSettings) - .settings( - name := "swiss-knife-spark", - ) + .settings(commonSettings) + .settings(name := "swiss-knife-spark") .dependsOn(datamodel) lazy val flink = (project in file("./flink")) .enablePlugins(CloudflowNativeFlinkPlugin) .settings(commonSettings) - .settings( - name := "swiss-knife-flink", - ) + .settings(name := "swiss-knife-flink") .dependsOn(datamodel) lazy val commonSettings = Seq( headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), - scalaVersion := "2.12.15", + scalaVersion := "2.12.17", scalacOptions ++= Seq( - "-encoding", "UTF-8", + "-encoding", + "UTF-8", "-target:jvm-1.8", "-Xlog-reflective-calls", "-Xlint", @@ -74,8 +53,6 @@ lazy val commonSettings = Seq( "-deprecation", "-feature", "-language:_", - "-unchecked" - ) -) + "-unchecked")) dynverSeparator in ThisBuild := "-" diff --git a/cloudflow-sbt-flink/src/sbt-test/sbt-cloudflow/simple-flink/build.sbt b/cloudflow-sbt-flink/src/sbt-test/sbt-cloudflow/simple-flink/build.sbt index 8ee2e75..cd56d8f 100644 --- a/cloudflow-sbt-flink/src/sbt-test/sbt-cloudflow/simple-flink/build.sbt +++ b/cloudflow-sbt-flink/src/sbt-test/sbt-cloudflow/simple-flink/build.sbt @@ -1,11 +1,10 @@ -lazy val helloWorld = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowNativeFlinkPlugin) - .settings( - scalaVersion := "2.12.15", - name := "hello-world", - version := "0.0.1", - resolvers += "Flink 13.0".at("https://repository.apache.org/content/repositories/orgapacheflink-1420/"), - ) +lazy val helloWorld = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowNativeFlinkPlugin) + .settings( + scalaVersion := "2.12.17", + name := "hello-world", + version := "0.0.1", + resolvers += "Flink 13.0".at("https://repository.apache.org/content/repositories/orgapacheflink-1420/")) val checkCRFile = taskKey[Unit]("Testing the CR file") checkCRFile := { @@ -13,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/cloudflow-sbt-spark/src/sbt-test/sbt-cloudflow/simple-spark/build.sbt b/cloudflow-sbt-spark/src/sbt-test/sbt-cloudflow/simple-spark/build.sbt index 2c7e18f..8da070e 100644 --- a/cloudflow-sbt-spark/src/sbt-test/sbt-cloudflow/simple-spark/build.sbt +++ b/cloudflow-sbt-spark/src/sbt-test/sbt-cloudflow/simple-spark/build.sbt @@ -1,10 +1,6 @@ -lazy val helloWorld = (project in file(".")) - .enablePlugins(CloudflowApplicationPlugin, CloudflowNativeSparkPlugin) - .settings( - scalaVersion := "2.12.15", - name := "hello-world", - version := "0.0.1", - ) +lazy val helloWorld = (project in file(".")) + .enablePlugins(CloudflowApplicationPlugin, CloudflowNativeSparkPlugin) + .settings(scalaVersion := "2.12.17", name := "hello-world", version := "0.0.1") val checkCRFile = taskKey[Unit]("Testing the CR file") checkCRFile := { @@ -12,10 +8,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/examples/call-record-aggregator/build.sbt b/examples/call-record-aggregator/build.sbt index de7c1c9..fe1e392 100644 --- a/examples/call-record-aggregator/build.sbt +++ b/examples/call-record-aggregator/build.sbt @@ -4,79 +4,58 @@ import sbt.Keys._ 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( - callRecordPipeline, - datamodel, - akkaCdrIngestor, - akkaJavaAggregationOutput, - sparkAggregation - ) + .aggregate(callRecordPipeline, datamodel, akkaCdrIngestor, akkaJavaAggregationOutput, sparkAggregation) //tag::docs-CloudflowApplicationPlugin-example[] lazy val callRecordPipeline = appModule("call-record-pipeline") .enablePlugins(CloudflowApplicationPlugin) .settings(commonSettings) - .settings( - name := "call-record-aggregator" - ) - + .settings(name := "call-record-aggregator") + //end::docs-CloudflowApplicationPlugin-example[] lazy val datamodel = appModule("datamodel") .settings( Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, - libraryDependencies += Cloudflow.library.CloudflowAvro - ) + libraryDependencies += Cloudflow.library.CloudflowAvro) -lazy val akkaCdrIngestor= appModule("akka-cdr-ingestor") - .enablePlugins(CloudflowAkkaPlugin) - .settings( - commonSettings, - libraryDependencies ++= Seq( - "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", - "ch.qos.logback" % "logback-classic" % "1.2.10", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ) - ) +lazy val akkaCdrIngestor = appModule("akka-cdr-ingestor") + .enablePlugins(CloudflowAkkaPlugin) + .settings( + commonSettings, + libraryDependencies ++= Seq( + "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", + "ch.qos.logback" % "logback-classic" % "1.2.10", + "org.scalatest" %% "scalatest" % "3.0.8" % "test")) .dependsOn(datamodel) -lazy val akkaJavaAggregationOutput= appModule("akka-java-aggregation-output") +lazy val akkaJavaAggregationOutput = appModule("akka-java-aggregation-output") .enablePlugins(CloudflowAkkaPlugin) .settings( commonSettings, libraryDependencies ++= Seq( - "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", - "ch.qos.logback" % "logback-classic" % "1.2.10", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ) - ) + "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", + "ch.qos.logback" % "logback-classic" % "1.2.10", + "org.scalatest" %% "scalatest" % "3.0.8" % "test")) .dependsOn(datamodel) lazy val sparkAggregation = appModule("spark-aggregation") - .enablePlugins(CloudflowNativeSparkPlugin) - .settings( - commonSettings, - Test / parallelExecution := false, - Test / fork := true, - libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.10", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ) - ) + .enablePlugins(CloudflowNativeSparkPlugin) + .settings( + commonSettings, + Test / parallelExecution := false, + Test / fork := true, + libraryDependencies ++= Seq( + "ch.qos.logback" % "logback-classic" % "1.2.10", + "org.scalatest" %% "scalatest" % "3.0.8" % "test")) .dependsOn(datamodel) def appModule(moduleID: String): Project = { Project(id = moduleID, base = file(moduleID)) - .settings( - name := moduleID - ) + .settings(name := moduleID) .withId(moduleID) .settings(commonSettings) } @@ -84,10 +63,11 @@ def appModule(moduleID: String): Project = { lazy val commonSettings = Seq( organization := "com.lightbend.cloudflow", headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), - scalaVersion := "2.12.15", + scalaVersion := "2.12.17", javacOptions += "-Xlint:deprecation", scalacOptions ++= Seq( - "-encoding", "UTF-8", + "-encoding", + "UTF-8", "-target:jvm-1.8", "-Xlog-reflective-calls", "-Xlint", @@ -96,12 +76,8 @@ lazy val commonSettings = Seq( "-deprecation", "-feature", "-language:_", - "-unchecked" - ), - + "-unchecked"), scalacOptions in (Compile, console) --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), - scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value - -) + scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value) dynverSeparator in ThisBuild := "-" diff --git a/examples/taxi-ride/build.sbt b/examples/taxi-ride/build.sbt index 14683cf..3418da1 100644 --- a/examples/taxi-ride/build.sbt +++ b/examples/taxi-ride/build.sbt @@ -5,20 +5,10 @@ import cloudflow.sbt.CommonSettingsAndTasksPlugin._ lazy val root = Project(id = "root", base = file(".")) .enablePlugins(ScalafmtPlugin) - .settings( - name := "root", - publish / skip := true, - scalafmtOnCompile := true, - ) + .settings(name := "root", publish / skip := true, scalafmtOnCompile := true) .withId("root") .settings(commonSettings) - .aggregate( - taxiRidePipeline, - datamodel, - ingestor, - processor, - ridelogger - ) + .aggregate(taxiRidePipeline, datamodel, ingestor, processor, ridelogger) lazy val taxiRidePipeline = appModule("taxi-ride-pipeline") .enablePlugins(CloudflowApplicationPlugin) @@ -26,43 +16,35 @@ lazy val taxiRidePipeline = appModule("taxi-ride-pipeline") .settings( name := "taxi-ride-fare", runLocalConfigFile := Some("taxi-ride-pipeline/src/main/resources/local.conf"), - runLocalLog4jConfigFile := Some("taxi-ride-pipeline/src/main/resources/log4j.properties") - ) + runLocalLog4jConfigFile := Some("taxi-ride-pipeline/src/main/resources/log4j.properties")) lazy val datamodel = appModule("datamodel") .settings( commonSettings, Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).taskValue, - libraryDependencies += Cloudflow.library.CloudflowAvro - ) + libraryDependencies += Cloudflow.library.CloudflowAvro) lazy val ingestor = appModule("ingestor") .enablePlugins(CloudflowAkkaPlugin) .settings( commonSettings, libraryDependencies ++= Seq( - "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", - "ch.qos.logback" % "logback-classic" % "1.2.10", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ) - ) + "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.12", + "ch.qos.logback" % "logback-classic" % "1.2.10", + "org.scalatest" %% "scalatest" % "3.0.8" % "test")) .dependsOn(datamodel) - lazy val processor = appModule("processor") .enablePlugins(CloudflowNativeFlinkPlugin) .settings( commonSettings, libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.10", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ), + "ch.qos.logback" % "logback-classic" % "1.2.10", + "org.scalatest" %% "scalatest" % "3.0.8" % "test"), dependencyOverrides ++= Seq( - "org.apache.kafka" % "kafka-clients" % "3.0.0", - "org.apache.commons" % "commons-compress" % "1.21" - ), - parallelExecution in Test := false - ) + "org.apache.kafka" % "kafka-clients" % "3.0.0", + "org.apache.commons" % "commons-compress" % "1.21"), + parallelExecution in Test := false) .dependsOn(datamodel) lazy val ridelogger = appModule("logger") @@ -70,17 +52,13 @@ lazy val ridelogger = appModule("logger") .settings( commonSettings, libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.2.10", - "org.scalatest" %% "scalatest" % "3.0.8" % "test" - ) - ) + "ch.qos.logback" % "logback-classic" % "1.2.10", + "org.scalatest" %% "scalatest" % "3.0.8" % "test")) .dependsOn(datamodel) def appModule(moduleID: String): Project = { Project(id = moduleID, base = file(moduleID)) - .settings( - name := moduleID - ) + .settings(name := moduleID) .withId(moduleID) .settings(commonSettings) } @@ -88,9 +66,10 @@ def appModule(moduleID: String): Project = { lazy val commonSettings = Seq( organization := "com.lightbend.cloudflow", headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. ")), - scalaVersion := "2.12.15", + scalaVersion := "2.12.17", scalacOptions ++= Seq( - "-encoding", "UTF-8", + "-encoding", + "UTF-8", "-target:jvm-1.8", "-Xlog-reflective-calls", "-Xlint", @@ -99,10 +78,8 @@ lazy val commonSettings = Seq( "-deprecation", "-feature", "-language:_", - "-unchecked" - ), + "-unchecked"), scalacOptions in (Compile, console) --= Seq("-Ywarn-unused", "-Ywarn-unused-import"), - scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value, -) + scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value) dynverSeparator in ThisBuild := "-" diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 71ecd20..135f18d 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -3,7 +3,7 @@ import sbt._ object Dependencies { - val Scala212 = "2.12.15" + val Scala212 = "2.12.17" val Scala213 = "2.13.8" object Versions {