|
| 1 | +name := "ldbc_snb_datagen" |
| 2 | +organization := "ldbc.snb.datagen" |
| 3 | + |
| 4 | +scmInfo := { |
| 5 | + val org = "ldbc" |
| 6 | + val project = "ldbc_snb_datagen_spark" |
| 7 | + Some( ScmInfo(url( s"https://github.com/$org /$project "), s"[email protected]:$org /$project .git")) |
| 8 | +} |
| 9 | + |
| 10 | +Global / onChangedBuildSource := ReloadOnSourceChanges |
| 11 | +Global / cancelable := true |
1 | 12 | ThisBuild / Test / parallelExecution := false
|
2 | 13 | ThisBuild / Test / fork := true
|
3 |
| -ThisBuild / cancelable := true |
4 | 14 |
|
5 |
| -javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint") |
| 15 | +val sparkVersion = settingKey[String]("The version of Spark used for building.") |
| 16 | +val sparkCompatVersion = taskKey[String]("The compatibility version of Spark") |
| 17 | +val platformVersion = taskKey[String]("The version of the target platform") |
| 18 | + |
| 19 | +sparkVersion := "3.2.1" |
| 20 | +sparkCompatVersion := { sparkVersion.value.split("\\.", 3).take(2).mkString(".") } |
| 21 | +platformVersion := { scalaBinaryVersion.value + "_spark" + sparkCompatVersion.value } |
| 22 | + |
| 23 | +resolvers += "TUDelft Repository" at "https://simulation.tudelft.nl/maven/" |
| 24 | + |
| 25 | +libraryDependencies ++= Seq( |
| 26 | + "org.apache.spark" %% "spark-sql" % sparkVersion.value % "provided", |
| 27 | + "org.apache.spark" %% "spark-core" % sparkVersion.value % "provided", |
| 28 | + "com.chuusai" %% "shapeless" % "2.3.3", |
| 29 | + "com.github.scopt" %% "scopt" % "3.7.1", |
| 30 | + "org.javatuples" % "javatuples" % "1.2", |
| 31 | + "ca.umontreal.iro" % "ssj" % "2.5", |
| 32 | + "xml-apis" % "xml-apis" % "1.4.01", |
| 33 | + "org.specs2" %% "specs2-core" % "4.2.0" % Test, |
| 34 | + "org.specs2" %% "specs2-junit" % "4.2.0" % Test, |
| 35 | + "org.mockito" % "mockito-core" % "3.3.3" % Test, |
| 36 | + "org.scalatest" %% "scalatest" % "3.1.0" % Test withSources(), |
| 37 | + "junit" % "junit" % "4.13.1" % Test |
| 38 | +) |
| 39 | + |
| 40 | +scalaVersion := "2.12.16" |
| 41 | + |
| 42 | +scalacOptions ++= Seq( |
| 43 | + "-deprecation", // Emit warning and location for usages of deprecated APIs. |
| 44 | + "-encoding", "utf-8", // Specify character encoding used by source files. |
| 45 | + "-explaintypes", // Explain type errors in more detail. |
| 46 | + "-feature", // Emit warning and location for usages of features that should be imported explicitly. |
| 47 | + "-language:existentials", // Existential types (besides wildcard types) can be written and inferred |
| 48 | + "-language:experimental.macros", // Allow macro definition (besides implementation and application) |
| 49 | + "-language:higherKinds", // Allow higher-kinded types |
| 50 | + "-language:implicitConversions", // Allow definition of implicit functions called views |
| 51 | + "-unchecked", // Enable additional warnings where generated code depends on assumptions. |
| 52 | + "-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access. |
| 53 | + "-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver. |
| 54 | + "-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error. |
| 55 | + "-Xlint:delayedinit-select", // Selecting member of DelayedInit. |
| 56 | + "-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element. |
| 57 | + "-Xlint:inaccessible", // Warn about inaccessible types in method signatures. |
| 58 | + "-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`. |
| 59 | + "-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id. |
| 60 | + "-Xlint:nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'. |
| 61 | + "-Xlint:nullary-unit", // Warn when nullary methods return Unit. |
| 62 | + "-Xlint:option-implicit", // Option.apply used implicit view. |
| 63 | + "-Xlint:package-object-classes", // Class or object defined in package object. |
| 64 | + "-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds. |
| 65 | + "-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field. |
| 66 | + "-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component. |
| 67 | + "-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope. |
| 68 | +) |
6 | 69 |
|
7 |
| -assemblyMergeStrategy in assembly := { |
| 70 | +scalacOptions ++= |
| 71 | + scalaVersion { |
| 72 | + case sv if sv.startsWith("2.13") => List( |
| 73 | + ) |
| 74 | + |
| 75 | + case sv if sv.startsWith("2.12") => List( |
| 76 | + "-Yno-adapted-args", // Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver. |
| 77 | + "-Ypartial-unification", // Enable partial unification in type constructor inference |
| 78 | + "-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined. |
| 79 | + "-Ywarn-inaccessible", // Warn about inaccessible types in method signatures. |
| 80 | + "-Ywarn-infer-any", // Warn when a type argument is inferred to be `Any`. |
| 81 | + "-Ywarn-nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'. |
| 82 | + "-Ywarn-nullary-unit", // Warn when nullary methods return Unit. |
| 83 | + "-Ywarn-numeric-widen" // Warn when numerics are widened. |
| 84 | + ) |
| 85 | + |
| 86 | + case _ => Nil |
| 87 | + }.value |
| 88 | + |
| 89 | +// The REPL can’t cope with -Ywarn-unused:imports or -Xfatal-warnings so turn them off for the console |
| 90 | +Compile / console / scalacOptions --= Seq("-Ywarn-unused:imports", "-Xfatal-warnings") |
| 91 | + |
| 92 | +javacOptions ++= Seq( |
| 93 | + "-Xlint", |
| 94 | + "-source", "1.8", |
| 95 | + "-target", "1.8", |
| 96 | + "-g:vars" |
| 97 | +) |
| 98 | + |
| 99 | +assembly / assemblyMergeStrategy := { |
8 | 100 | case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
|
9 |
| - case x => MergeStrategy.first |
| 101 | + case _ => MergeStrategy.first |
| 102 | +} |
| 103 | + |
| 104 | +// Override JAR name |
| 105 | +assembly / assemblyJarName := { |
| 106 | + moduleName.value + "_" + platformVersion.value + "-" + version.value + "-jar-with-dependencies.jar" |
10 | 107 | }
|
| 108 | + |
| 109 | +// Put under target instead of target/<scala-binary-version> |
| 110 | +assembly / target := { target.value } |
0 commit comments