1+ import scala .collection .Seq
12// ===== GLOBAL BUILD SETTINGS =====
23ThisBuild / organization := " com.flowforge"
34
@@ -10,9 +11,8 @@ ThisBuild / crossScalaVersions := Seq(
1011)
1112
1213// ===== REPOSITORY RESOLVERS =====
13- resolvers ++= Seq (
14+ resolvers ++= Resolver .sonatypeOssRepos( " public " ) ++ Seq (
1415 Resolver .mavenCentral,
15- Resolver .sonatypeRepo(" public" ),
1616 " Confluent" at " https://packages.confluent.io/maven/" ,
1717 " Apache Releases" at " https://repository.apache.org/content/repositories/releases/" ,
1818 " Google Cloud" at " https://maven-central.storage-download.googleapis.com/maven2/" ,
@@ -21,18 +21,54 @@ resolvers ++= Seq(
2121)
2222
2323// Compiler settings for all projects
24- ThisBuild / scalacOptions ++= Seq (
24+
25+ val scala3CompilerOptions = Seq (
26+ " -explain" ,
27+ " -explain-types" ,
28+ " -Wconf:cat=unused:s" , // suppress unused warnings
29+ " -Wconf:cat=deprecation:s" , // suppress deprecation warnings
30+ " -Wunused:nowarn" ,
31+ " -source:3.3" ,
32+ " -Wsafe-init" ,
33+ " -deprecation" ,
34+ " -Wunused:all" ,
35+ " -language:higherKinds" ,
36+ " -language:implicitConversions" ,
37+ " -Xlint:_,-missing-interpolator" ,
38+ " -Ywarn-dead-code" ,
39+ " -Ywarn-value-discard"
40+ )
41+ val scala2CompilerOptions = Seq (
2542 " -Xfatal-warnings" ,
43+ " -Wconf:deprecation:w" ,
2644 " -feature" ,
27- " -deprecation" ,
2845 " -unchecked" ,
46+ " -deprecation" ,
47+ " -Wunused:nowarn" ,
48+ " -Wunused:imports" ,
49+ " -Wunused:privates" ,
50+ " -Wunused:locals" ,
51+ " -Wunused:patvars" ,
52+ " -Wunused:params" ,
53+ " -Wunused:linted" ,
2954 " -language:higherKinds" ,
3055 " -language:implicitConversions" ,
3156 " -Xlint:_,-missing-interpolator" ,
3257 " -Ywarn-dead-code" ,
3358 " -Ywarn-value-discard"
3459)
3560
61+ def scalacOptionsForVersion (scalaVersion : String ): Seq [String ] =
62+ CrossVersion .partialVersion(scalaVersion) match {
63+ case Some ((2 , 13 )) =>
64+ scala2CompilerOptions
65+ case Some ((3 , _)) =>
66+ scala3CompilerOptions
67+ case _ => Seq .empty
68+ }
69+
70+ ThisBuild / scalacOptions ++= scalacOptionsForVersion(scalaVersion.value)
71+
3672// Test settings
3773ThisBuild / Test / parallelExecution := false
3874ThisBuild / Test / testOptions += Tests .Argument (" -oDF" )
@@ -71,7 +107,8 @@ lazy val core = moduleProject("core")
71107 description := " Core abstractions and type system for FlowForge" ,
72108 libraryDependencies ++= Dependencies .forModule(" core" ) ++ Seq (
73109 " com.chuusai" %% " shapeless" % Dependencies .Versions .shapeless % " provided"
74- )
110+ ),
111+ assembly / assemblyJarName := " flowforge-core.jar"
75112 )
76113
77114lazy val safety = moduleProject(" safety" )
@@ -129,7 +166,8 @@ lazy val enginesSpark = moduleProject("engines-spark")
129166 .dependsOn(engines, connectors)
130167 .settings(
131168 description := " Apache Spark execution engine" ,
132- libraryDependencies ++= Dependencies .forModule(" engines-spark" )
169+ libraryDependencies ++= Dependencies .forModule(" engines-spark" ),
170+ assembly / assemblyJarName := " flowforge-spark-engine.jar"
133171 )
134172
135173lazy val enginesFlink = moduleProject(" engines-flink" )
@@ -183,6 +221,7 @@ lazy val examples = moduleProject("examples")
183221 description := " Example implementations and tutorials" ,
184222 libraryDependencies ++= Dependencies .forModule(" examples" ),
185223 publish / skip := true ,
224+ assembly / assemblyJarName := " flowforge-examples.jar"
186225 )
187226
188227lazy val experimental = moduleProject(" experimental" )
@@ -238,3 +277,11 @@ addCommandAlias("assemblyCore", "core/assembly")
238277addCommandAlias(" assemblySpark" , " enginesSpark/assembly" )
239278addCommandAlias(" assemblyExamples" , " examples/assembly" )
240279
280+ // Assembly merge strategy
281+ ThisBuild / assemblyMergeStrategy := {
282+ case PathList (" META-INF" , xs @ _* ) => MergeStrategy .discard
283+ case x if x.endsWith(" .conf" ) => MergeStrategy .concat
284+ case x if x.endsWith(" .properties" ) => MergeStrategy .concat
285+ case x if x.endsWith(" .xml" ) => MergeStrategy .first
286+ case x => MergeStrategy .first
287+ }
0 commit comments