aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2016-06-07 11:07:09 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2016-06-15 01:24:46 -0400
commitad2094b06eb7e313b3655ae0cae98b50787177d3 (patch)
tree1ea8a3a23991554d248a67c2f89f352609580720 /examples
parentb37e339c41483c15bf14f84be60c8470fd429d77 (diff)
downloadcbt-ad2094b06eb7e313b3655ae0cae98b50787177d3.tar.gz
cbt-ad2094b06eb7e313b3655ae0cae98b50787177d3.tar.bz2
cbt-ad2094b06eb7e313b3655ae0cae98b50787177d3.zip
separate sbt layout and scalatest plugins and create a more general plugin architecture
Diffstat (limited to 'examples')
-rw-r--r--examples/build-scalatest/build/build.scala17
-rw-r--r--examples/build-scalatest/build/build/build.scala9
-rw-r--r--examples/build-scalatest/src/main/scala/Hello.scala2
-rw-r--r--examples/build-scalatest/src/test/scala/Test.scala7
4 files changed, 15 insertions, 20 deletions
diff --git a/examples/build-scalatest/build/build.scala b/examples/build-scalatest/build/build.scala
index 29d7bf4..48248fd 100644
--- a/examples/build-scalatest/build/build.scala
+++ b/examples/build-scalatest/build/build.scala
@@ -1,10 +1,9 @@
import cbt._
-class Build(val context: Context) extends SbtLayout {
-
- override def dependencies = (
- super.dependencies ++
- Resolver( mavenCentral ).bind(
- ScalaDependency("org.scalatest","scalatest","2.2.4")
- )
- )
-} \ No newline at end of file
+class Build(val context: Context) extends SbtLayoutMain {
+ outer =>
+ override def test: Option[ExitCode] = Some{
+ new BasicBuild(context) with ScalaTest with SbtLayoutTest{
+ override def dependencies = outer +: super.dependencies
+ }.run
+ }
+}
diff --git a/examples/build-scalatest/build/build/build.scala b/examples/build-scalatest/build/build/build.scala
index 2aece46..d641b51 100644
--- a/examples/build-scalatest/build/build/build.scala
+++ b/examples/build-scalatest/build/build/build.scala
@@ -1,11 +1,8 @@
import cbt._
class Build(val context: Context) extends BuildBuild{
-
- override def dependencies = (
- super.dependencies ++
- Resolver( mavenCentral ).bind(
- ScalaDependency("org.scalatest","scalatest","2.2.4")
- ) :+ BuildDependency(new File(context.cbtHome + "/plugins/scalatest"))
+ override def dependencies = super.dependencies ++ Seq(
+ plugins.scalaTest,
+ plugins.sbtLayout
)
}
diff --git a/examples/build-scalatest/src/main/scala/Hello.scala b/examples/build-scalatest/src/main/scala/Hello.scala
index 5e56da4..099a84d 100644
--- a/examples/build-scalatest/src/main/scala/Hello.scala
+++ b/examples/build-scalatest/src/main/scala/Hello.scala
@@ -1,6 +1,6 @@
object Main extends App{
- println("Hell")
+ println("Hello World")
def square(x: Int) = x * x
diff --git a/examples/build-scalatest/src/test/scala/Test.scala b/examples/build-scalatest/src/test/scala/Test.scala
index d176080..48b0a36 100644
--- a/examples/build-scalatest/src/test/scala/Test.scala
+++ b/examples/build-scalatest/src/test/scala/Test.scala
@@ -2,6 +2,9 @@ import collection.mutable.Stack
import org.scalatest._
class Test extends FlatSpec with Matchers {
+ "square" should "return double" in {
+ Main.square(2) should be (4)
+ }
"A Stack" should "pop values in last-in-first-out order" in {
val stack = new Stack[Int]
@@ -17,8 +20,4 @@ class Test extends FlatSpec with Matchers {
emptyStack.pop()
}
}
-
- "square" should "return double" in {
- Main.square(2) should be (4)
- }
} \ No newline at end of file