1- import AssemblyKeys ._ // put this at the top of the file
21
3- name := " catalyst"
4-
5- organization := " com.databricks"
6-
7- version := " 0.1-SNAPSHOT"
8-
9- scalaVersion := " 2.10.3"
10-
11- scalacOptions ++= Seq (" -deprecation" , " -feature" , " -unchecked" )
12-
13- resolvers += " Local Maven Repository" at " file://" + Path .userHome.absolutePath+ " /.m2/repository"
14-
15- // TODO: Remove when Spark 0.9.0 is released for real.
16- resolvers += " SparkStaging" at " https://repository.apache.org/content/repositories/orgapachespark-1006/"
17-
18- libraryDependencies += " org.apache.spark" %% " spark-core" % " 0.9.0-incubating"
19-
20- // Hive 0.10.0 relies on a weird version of jdo that is not published anywhere... Remove when we upgrade to 0.11.0
21- libraryDependencies += " javax.jdo" % " jdo2-api" % " 2.3-ec" from " http://www.datanucleus.org/downloads/maven2/javax/jdo/jdo2-api/2.3-ec/jdo2-api-2.3-ec.jar"
22-
23- libraryDependencies ++= Seq (
24- " org.apache.hadoop" % " hadoop-client" % " 1.0.4" ,
25- " org.scalatest" %% " scalatest" % " 1.9.1" % " test" ,
26- // "net.hydromatic" % "optiq-core" % "0.4.16-SNAPSHOT",
27- " org.apache.hive" % " hive-metastore" % " 0.12.0" ,
28- " org.apache.hive" % " hive-exec" % " 0.12.0" ,
29- " org.apache.hive" % " hive-serde" % " 0.12.0" ,
30- " com.typesafe" %% " scalalogging-slf4j" % " 1.0.1" )
31-
32- org.scalastyle.sbt.ScalastylePlugin .Settings
33-
34- // Multiple queries rely on the TestShark singleton. See comments there for more details.
35- parallelExecution in Test := false
36-
37- resolvers ++= Seq (
38- // For Optiq
39- " Conjars Repository" at " http://conjars.org/repo/" ,
40- // For jdo-2 required by Hive < 0.12.0
41- " Datanucleus Repository" at " http://www.datanucleus.org/downloads/maven2" )
42-
43- resolvers += " Databees" at " http://repository-databricks.forge.cloudbees.com/snapshot/"
44-
45- initialCommands in console := """
46- import catalyst.analysis._
47- import catalyst.dsl._
48- import catalyst.errors._
49- import catalyst.expressions._
50- import catalyst.frontend._
51- import catalyst.plans.logical._
52- import catalyst.rules._
53- import catalyst.types._
54- import catalyst.util._
55- import catalyst.execution.TestShark._"""
56-
57- site.settings
58-
59- ghpages.settings
60-
61- git.remoteRepo := " git@github.com:databricks/catalyst.git"
62-
63- site.settings
64-
65- site.includeScaladoc()
66-
67- assemblySettings
68-
69- test in assembly := {}
70-
71- mergeStrategy in assembly := {
72- case m if m.toLowerCase.endsWith(" manifest.mf" ) => MergeStrategy .discard
73- case m if m.toLowerCase.matches(" meta-inf.*\\ .sf$" ) => MergeStrategy .discard
74- case " log4j.properties" => MergeStrategy .discard
75- case m if m.toLowerCase.startsWith(" meta-inf/services/" ) => MergeStrategy .filterDistinctLines
76- case " reference.conf" => MergeStrategy .concat
77- case _ => MergeStrategy .first
78- }
79-
80- scalacOptions in (Compile , doc) <++= (baseDirectory) map {
81- bd => Seq (" -sourcepath" , bd.getAbsolutePath, " -doc-source-url" ," https://github.com/databricks/catalyst/blob/master/€{FILE_PATH}.scala" )
82- }
2+ lazy val catalyst = Project (" catalyst" , file(" catalyst" ), settings = catalystSettings)
3+ lazy val core = Project (" core" , file(" core" ), settings = coreSettings).dependsOn(catalyst)
4+ lazy val shark = Project (" shark" , file(" shark" ), settings = sharkSettings).dependsOn(core)
5+
6+ def sharedSettings = Defaults .defaultSettings ++ Seq (
7+ organization := " org.apache.spark.sql" ,
8+ version := " 0.1-SNAPSHOT" ,
9+ scalaVersion := " 2.10.3" ,
10+ scalacOptions ++= Seq (" -deprecation" , " -feature" , " -unchecked" ),
11+ // Common Dependencies.
12+ libraryDependencies ++= Seq (
13+ " org.scalatest" %% " scalatest" % " 1.9.1" % " test" ,
14+ " com.typesafe" %% " scalalogging-slf4j" % " 1.0.1" )
15+ ) ++ org.scalastyle.sbt.ScalastylePlugin .Settings
16+
17+ def catalystSettings = sharedSettings ++ Seq (
18+ name := " catalyst" ,
19+ // The mechanics of rewriting expression ids to compare trees in some test cases makes
20+ // assumptions about the the expression ids being contiguious. Running tests in parallel breaks
21+ // this non-deterministically. TODO: FIX THIS.
22+ parallelExecution in Test := false
23+ )
24+
25+ def coreSettings = sharedSettings ++ Seq (
26+ name := " core" ,
27+ libraryDependencies += " org.apache.spark" %% " spark-core" % " 0.9.0-incubating"
28+ )
29+
30+ def sharkSettings = sharedSettings ++ Seq (
31+ name := " shark" ,
32+ libraryDependencies ++= Seq (
33+ " org.apache.hadoop" % " hadoop-client" % " 1.0.4" ,
34+ " org.apache.hive" % " hive-metastore" % " 0.12.0" ,
35+ " org.apache.hive" % " hive-exec" % " 0.12.0" ,
36+ " org.apache.hive" % " hive-serde" % " 0.12.0" ),
37+ // Multiple queries rely on the TestShark singleton. See comments there for more details.
38+ parallelExecution in Test := false ,
39+ initialCommands in console :=
40+ """
41+ |import org.apache.spark.sql.catalyst.analysis._
42+ |import org.apache.spark.sql.catalyst.dsl._
43+ |import org.apache.spark.sql.catalyst.errors._
44+ |import org.apache.spark.sql.catalyst.expressions._
45+ |import org.apache.spark.sql.catalyst.plans.logical._
46+ |import org.apache.spark.sql.catalyst.rules._
47+ |import org.apache.spark.sql.catalyst.types._
48+ |import org.apache.spark.sql.catalyst.util._
49+ |import org.apache.spark.sql.execution
50+ |import org.apache.spark.sql.shark._
51+ |import org.apache.spark.sql.shark.TestShark._""" .stripMargin
52+ )
0 commit comments