diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2011-02-01 15:11:08 -0800 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2011-02-01 15:11:08 -0800 |
commit | e5c4cd8a5e188592f8786a265c0cd073c69ac886 (patch) | |
tree | 031c4f814372a818f7574cfac84f1fc4749bd9d3 /project/build/SparkProject.scala | |
parent | dcfa2ce83bf884008b4e8c02e923da1e49027ba4 (diff) | |
download | spark-e5c4cd8a5e188592f8786a265c0cd073c69ac886.tar.gz spark-e5c4cd8a5e188592f8786a265c0cd073c69ac886.tar.bz2 spark-e5c4cd8a5e188592f8786a265c0cd073c69ac886.zip |
Made examples and core subprojects
Diffstat (limited to 'project/build/SparkProject.scala')
-rw-r--r-- | project/build/SparkProject.scala | 70 |
1 files changed, 38 insertions, 32 deletions
diff --git a/project/build/SparkProject.scala b/project/build/SparkProject.scala index 7ba03f6125..94345ca8de 100644 --- a/project/build/SparkProject.scala +++ b/project/build/SparkProject.scala @@ -1,46 +1,52 @@ import sbt._ import de.element34.sbteclipsify._ -import Process._ +import sbt.Process._ -class SparkProject(info: ProjectInfo) -extends DefaultProject(info) with Eclipsify +class SparkProject(info: ProjectInfo) extends ParentProject(info) { - val TARGET = path("target") / "scala_2.8.1" + lazy val core = project("core", "Spark Core", new CoreProject(_)) - val NATIVE_DIR = path("src") / "main" / "native" + lazy val examples = project("examples", "Spark Examples", core) - val NATIVE_SOURCES = NATIVE_DIR * "*.c" + class CoreProject(info: ProjectInfo) extends DefaultProject(info) with Eclipsify + { + val TARGET = path("target") / "scala_2.8.1" - val NATIVE_LIB = { - if (System.getProperty("os.name") == "Mac OS X") - "libspark_native.dylib" - else - "libspark_native.so" - } + val TEST_REPORT_DIR = TARGET / "test-report" - lazy val native = fileTask(TARGET / NATIVE_LIB from NATIVE_SOURCES) { - val makeTarget = " ../../../target/scala_2.8.1/native/" + NATIVE_LIB - (("make -C " + NATIVE_DIR + " " + makeTarget) ! log) - None - } dependsOn(compile) describedAs("Compiles native library.") + val NATIVE_DIR = path("src") / "main" / "native" - val TEST_REPORT_DIR = TARGET / "test-report" + val NATIVE_SOURCES = NATIVE_DIR * "*.c" - lazy val testReport = task { - log.info("Creating " + TEST_REPORT_DIR + "...") - if (!TEST_REPORT_DIR.exists) { - TEST_REPORT_DIR.asFile.mkdirs() + val NATIVE_LIB = { + if (System.getProperty("os.name") == "Mac OS X") + "libspark_native.dylib" + else + "libspark_native.so" } - log.info("Executing org.scalatest.tools.Runner...") - val command = ("scala -classpath " + testClasspath.absString + - " org.scalatest.tools.Runner -o " + - " -u " + TEST_REPORT_DIR.absolutePath + - " -p " + (TARGET / "test-classes").absolutePath) - val process = Process(command, path("."), "JAVA_OPTS" -> "-Xmx500m") - process ! - - None - } dependsOn(compile, testCompile) describedAs("Generate XML test report.") + lazy val native = fileTask(TARGET / NATIVE_LIB from NATIVE_SOURCES) { + val makeTarget = " ../../../target/scala_2.8.1/native/" + NATIVE_LIB + (("make -C " + NATIVE_DIR + " " + makeTarget) ! log) + None + } dependsOn(compile) describedAs("Compiles native library.") + + lazy val testReport = task { + log.info("Creating " + TEST_REPORT_DIR + "...") + if (!TEST_REPORT_DIR.exists) { + TEST_REPORT_DIR.asFile.mkdirs() + } + + log.info("Executing org.scalatest.tools.Runner...") + val command = ("scala -classpath " + testClasspath.absString + + " org.scalatest.tools.Runner -o " + + " -u " + TEST_REPORT_DIR.absolutePath + + " -p " + (TARGET / "test-classes").absolutePath) + val process = Process(command, path("."), "JAVA_OPTS" -> "-Xmx500m") + process ! + + None + } dependsOn(compile, testCompile) describedAs("Generate XML test report.") + } } |