sbt なプロジェクトの雛形を作っておくなど
ええと、clone 元な URL は以下になってました。
一旦 .git を削除して git init しておきます。
$ rm -rf .git $ git init
あと、src/main/scala 配下は全部削除。
$ rm -rf src/main/scala/*
現状、以下な形になっておるのですが
$ find src src src/test src/test/scala src/test/scala/TestSample.scala src/main src/main/scala src/main/resources src/main/resources/bootstrap src/main/resources/bootstrap/css src/main/resources/bootstrap/css/bootstrap.css src/main/resources/bootstrap/css/bootstrap-responsive.css src/main/resources/bootstrap/css/bootstrap.min.css src/main/resources/bootstrap/css/bootstrap-responsive.min.css src/main/resources/bootstrap/js src/main/resources/bootstrap/js/bootstrap.js src/main/resources/bootstrap/js/bootstrap.min.js src/main/resources/bootstrap/img src/main/resources/bootstrap/img/glyphicons-halflings-white.png src/main/resources/bootstrap/img/glyphicons-halflings.png src/script src/script/Util.scala
この main/resources 配下のソレ達は一体何なのか。bootstrap 配下も削除かな。最後のソレも削除。現在以下な形。
src src/test src/test/scala src/test/scala/TestSample.scala src/main src/main/scala src/main/resources src/script
src/test/scala/TestSample.scala は以下なカンジ。
package shurijp import org.specs2._ class HelloSpec extends Specification { def is = "test test" ^ "'hello world' string should" ^ "contain 11 characters" ! e1^ "start with 'hello'" ! e2^ "end with 'world'" ! e3^ end def e1 = "hello world" must have size(11) def e2 = "hello world" must startWith("hello") def e3 = "hello world" must endWith("world") }
で、sbt test してみるとどうなるか。なんとなく重い。つうか compile でコケている模様。もしかして build.sbt が微妙なのかorz
以下にしてリトライ。
// Scalaのバージョンを指定 scalaVersion := "2.10.1" // 使用するライブラリを追加(依存するライブラリも取ってくる) libraryDependencies ++= List( "org.scalatest" %% "scalatest" % "1.9.1" % "test", "org.scalacheck" %% "scalacheck" % "1.10.0" % "test", "org.specs2" %% "specs2" % "1.13" % "test", "junit" % "junit" % "4.4" % "test", "org.jsoup" % "jsoup" % "1.7.2", "com.github.scala-incubator.io" %% "scala-io-core" % "0.4.2", "com.github.scala-incubator.io" %% "scala-io-file" % "0.4.2" ) // sbtプロンプトでconsoleを実行した時に最初に呼ばれる initialCommands in console := """import shurijp._"""
まだ削れるのかどうか。junit とか scalatest とか scalacheck とか scala-incubator.io とかを云々なソレは別途確認の方向。
とりあえず、
[info] HelloSpec [info] [info] test test [info] 'hello world' string should [info] + contain 11 characters [info] + start with 'hello' [info] + end with 'world' [info] [info] Total for specification HelloSpec [info] Finished in 114 ms [info] 3 examples, 0 failure, 0 error [info] [info] Passed: : Total 3, Failed 0, Errors 0, Passed 3, Skipped 0 [success] Total time: 80 s, completed May 4, 2013 4:43:52 PM
正常終了を確認。