Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scala-library to 2.12.17 #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 19 additions & 42 deletions cloudflow-it/swiss-knife/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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. <https://www.lightbend.com>"))
)
.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. <https://www.lightbend.com>")))
.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. <https://www.lightbend.com>")),
scalaVersion := "2.12.15",
scalaVersion := "2.12.17",
scalacOptions ++= Seq(
"-encoding", "UTF-8",
"-encoding",
"UTF-8",
"-target:jvm-1.8",
"-Xlog-reflective-calls",
"-Xlint",
Expand All @@ -74,8 +53,6 @@ lazy val commonSettings = Seq(
"-deprecation",
"-feature",
"-language:_",
"-unchecked"
)
)
"-unchecked"))

dynverSeparator in ThisBuild := "-"
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
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 := {
val data = ujson.read(file("target/hello-world.json"))

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" }
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
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 := {
val data = ujson.read(file("target/hello-world.json"))

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" }
}
86 changes: 31 additions & 55 deletions examples/call-record-aggregator/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,90 +4,70 @@ 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)
}

lazy val commonSettings = Seq(
organization := "com.lightbend.cloudflow",
headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2020", "Lightbend Inc. <https://www.lightbend.com>")),
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",
Expand All @@ -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 := "-"
Loading