From 2abddf0b9aac657da8438b6d90789f9828eb7e3b Mon Sep 17 00:00:00 2001 From: Alexander Slesarenko Date: Sat, 6 Dec 2014 11:55:58 +0300 Subject: [PATCH] initial commit --- project/Build.scala | 108 +++++++++++++++++++++++++++++++++++++++ project/build.properties | 1 + project/plugins.sbt | 11 ++++ version.sbt | 1 + 4 files changed, 121 insertions(+) create mode 100644 project/Build.scala create mode 100644 project/build.properties create mode 100644 project/plugins.sbt create mode 100644 version.sbt diff --git a/project/Build.scala b/project/Build.scala new file mode 100644 index 0000000..a12e296 --- /dev/null +++ b/project/Build.scala @@ -0,0 +1,108 @@ +import sbt._ +import sbt.Keys._ +//import sbtassembly.Plugin._ +//import AssemblyKeys._ +//import sbtrelease.ReleasePlugin._ + +object ScalanStartRootBuild extends Build { + val commonDeps = libraryDependencies ++= Seq( + "org.scalaz.stream" %% "scalaz-stream" % "0.6a", + //"junit" % "junit" % "4.11" % "test", + //("com.novocode" % "junit-interface" % "0.11" % "test").exclude("junit", "junit-dep").exclude("org.scala-tools.testing", "test-interface"), + "org.scalatest" %% "scalatest" % "2.2.1" % "test", + "org.scalacheck" %% "scalacheck" % "1.11.5" % "test") + + val testSettings = inConfig(ItTest)(Defaults.testTasks /*++ baseAssemblySettings*/) ++ Seq( + testOptions in Test := Seq(Tests.Argument(TestFrameworks.JUnit, "-a", "-s"), Tests.Filter(unitFilter)), + testOptions in ItTest := Seq(Tests.Argument(TestFrameworks.JUnit, "-v", "-a", "-s", "-q"), Tests.Filter(itFilter)), + // needed thanks to http://stackoverflow.com/questions/7898273/how-to-get-logging-working-in-scala-unit-tests-with-testng-slf4s-and-logback + parallelExecution in Test := false, + parallelExecution in ItTest := false, + publishArtifact in Test := true, + publishArtifact in(Test, packageDoc) := false + //jarName in(ItTest, assembly) := s"${name.value}-test-${version.value}.jar" + ) + + val buildSettings = Seq( + organization := "com.huawei.scalan", + scalaVersion := "2.10.4", + scalacOptions ++= Seq( + "-unchecked", "-deprecation", + "-feature", + "-language:higherKinds", + "-language:implicitConversions", + "-language:existentials", + "-language:postfixOps")) + + lazy val noPublishingSettings = Seq( + publishArtifact := false, + publish := {}, + publishLocal := {}) + + override lazy val settings = super.settings ++ buildSettings + + lazy val commonSettings = + buildSettings /*++ assemblySettings ++ releaseSettings*/ ++ testSettings ++ + Seq( + resolvers += "Scalaz Bintray Repo" at "http://dl.bintray.com/scalaz/releases", + publishTo := { + val nexus = "http://10.122.85.37:9081/nexus/" + if (version.value.trim.endsWith("SNAPSHOT")) + Some("snapshots" at (nexus + "content/repositories/snapshots")) + else + Some("releases" at (nexus + "content/repositories/releases")) + }, + commonDeps) + + implicit class ProjectExt(p: Project) { + def allConfigDependency = p % "compile->compile;test->test" + + def addTestConfigsAndCommonSettings = + p.configs(ItTest).settings(commonSettings: _*) + } + + def liteProject(name: String) = ProjectRef(file("../scalan-lite"), name) + + def liteDependency(name: String) = "com.huawei.scalan" %% name % "0.2.3" + +// lazy val all = project.aggregate(start).addTestConfigsAndCommonSettings. +// settings(noPublishingSettings: _*) + + lazy val start = Project( + id = "scalan-start", + base = file(".")).addTestConfigsAndCommonSettings. + settings(libraryDependencies ++= Seq(core, core % "test" classifier "tests")) + +// lazy val examples = Project("enterprise-edition-examples", file("examples")). +// dependsOn(enterprise.allConfigDependency).addTestConfigsAndCommonSettings +// +// lazy val meta = Project("enterprise-edition-meta", file("meta")).addTestConfigsAndCommonSettings +// .settings(noPublishingSettings: _*) +// .settings( +// fork in run := true, +// libraryDependencies += liteDependency("meta")) + + // lazy val core = liteProject("core").allConfigs + lazy val core = liteDependency("core") + + def itFilter(name: String): Boolean = + name endsWith "ItTests" + + def unitFilter(name: String): Boolean = !itFilter(name) + + lazy val ItTest = config("it").extend(Test) + + // lazy val community = project.aggregate(core, liteProject("community-edition"), liteProject("lms-backend")) + + publishArtifact in Test := true + + publishArtifact in (Test, packageDoc) := false + + publishTo in ThisBuild := { + val nexus = "http://10.122.85.37:9081/nexus/" + if (version.value.trim.endsWith("SNAPSHOT")) + Some("snapshots" at (nexus + "content/repositories/snapshots")) + else + Some("releases" at (nexus + "content/repositories/releases")) + } +} diff --git a/project/build.properties b/project/build.properties new file mode 100644 index 0000000..5075289 --- /dev/null +++ b/project/build.properties @@ -0,0 +1 @@ +sbt.version=0.13.5 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt new file mode 100644 index 0000000..be90e8f --- /dev/null +++ b/project/plugins.sbt @@ -0,0 +1,11 @@ +import sbt._ + +import sbt.Keys._ + +//addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0") +// +//addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2") +// +//addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0") +// +//addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.8.5") \ No newline at end of file diff --git a/version.sbt b/version.sbt new file mode 100644 index 0000000..3dc5c8b --- /dev/null +++ b/version.sbt @@ -0,0 +1 @@ +version in ThisBuild := "0.3.0-SNAPSHOT" \ No newline at end of file