github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/test/spark/app/build.sbt (about)

     1  import build.BuildType
     2  
     3  val baseName = "sonnets"
     4  
     5  val projectVersion = "0.1.0"
     6  
     7  // Spark versions 2.4.7 and 3.0.1 use different Scala versions.  Changing this is a deep
     8  // change, so key the Spark distinction by the Scala distinction.  sbt doesn't appear to
     9  // support other ways of changing emitted Scala binary versions using the same compiler.
    10  
    11  // SO https://stackoverflow.com/a/60177627/192263 hints that we cannot use 2.11 here before
    12  // this version
    13  val scala211Version = "2.11.12"
    14  val scala212Version = "2.12.13"
    15  
    16  def settingsToCompileIn() = {
    17    Seq(
    18      Compile / scalaSource := (ThisBuild / baseDirectory).value / "src" / "main" / "scala",
    19    )
    20  }
    21  
    22  def generateProject(buildType: BuildType) =
    23    Project(s"${baseName}-${buildType.name}", file(s"target/${baseName}-${buildType.name}"))
    24      .settings(
    25        sharedSettings,
    26        settingsToCompileIn(),
    27        scalaVersion := buildType.scalaVersion,
    28        libraryDependencies ++= Seq(
    29          "org.apache.spark" %% "spark-sql" % buildType.sparkVersion % "provided",
    30          "org.apache.hadoop" % "hadoop-aws" % buildType.hadoopVersion,
    31          "org.apache.hadoop" % "hadoop-common" % buildType.hadoopVersion,
    32        ),
    33        target := { baseDirectory.value / "target" / s"${baseName}-${buildType.name}" }
    34      )
    35  
    36  lazy val proj24 = generateProject(new BuildType("246", scala211Version, "2.4.6", "2.7.7"))
    37  lazy val proj31 = generateProject(new BuildType("311", scala212Version, "3.1.1", "2.7.7"))
    38  
    39  lazy val root = (project in file("."))
    40    .aggregate(proj24, proj31)
    41    .settings(
    42        compile / skip := true,
    43        publish / skip := true,
    44    )
    45  
    46  
    47  lazy val commonSettings = Seq(
    48    version := projectVersion,
    49    // Use an older JDK to be Spark compatible
    50    javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
    51    scalacOptions ++= Seq("-target:jvm-1.8", "-deprecation", "-feature")
    52  )
    53  
    54  lazy val sharedSettings = commonSettings
    55  
    56  ThisBuild / organization := "io.lakefs"
    57  ThisBuild / organizationName := "Treeverse Labs"
    58  ThisBuild / organizationHomepage := Some(url("http://treeverse.io"))
    59  ThisBuild / description := "Spark test app for working with lakeFS"
    60  ThisBuild / licenses := List("Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt"))
    61  ThisBuild / homepage := Some(url("https://github.com/treeverse/lakeFS"))