diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/compress/build.sc | 2 | ||||
-rw-r--r-- | example/compress2/build.sc | 2 | ||||
-rw-r--r-- | example/compress3/build.sc | 2 | ||||
-rw-r--r-- | example/cookies/build.sc | 2 | ||||
-rw-r--r-- | example/decorated/build.sc | 2 | ||||
-rw-r--r-- | example/decorated2/build.sc | 2 | ||||
-rw-r--r-- | example/endpoints/build.sc | 2 | ||||
-rw-r--r-- | example/formJsonPost/build.sc | 2 | ||||
-rw-r--r-- | example/httpMethods/build.sc | 2 | ||||
-rw-r--r-- | example/minimalApplication/build.sc | 2 | ||||
-rw-r--r-- | example/minimalApplication2/build.sc | 2 | ||||
-rw-r--r-- | example/redirectAbort/build.sc | 2 | ||||
-rw-r--r-- | example/scalatags/build.sc | 2 | ||||
-rw-r--r-- | example/staticFiles/app/resources/cask/example.txt | 1 | ||||
-rw-r--r-- | example/staticFiles/app/src/StaticFiles.scala | 7 | ||||
-rw-r--r-- | example/staticFiles/app/test/src/ExampleTests.scala | 5 | ||||
-rw-r--r-- | example/staticFiles/build.sc | 11 | ||||
-rw-r--r-- | example/todo/app/src/TodoServer.scala | 4 | ||||
-rw-r--r-- | example/todo/build.sc | 2 | ||||
-rw-r--r-- | example/todoApi/build.sc | 2 | ||||
-rw-r--r-- | example/todoDb/build.sc | 2 | ||||
-rw-r--r-- | example/variableRoutes/build.sc | 2 | ||||
-rw-r--r-- | example/websockets/build.sc | 2 |
23 files changed, 40 insertions, 24 deletions
diff --git a/example/compress/build.sc b/example/compress/build.sc index 0e803b8..2166763 100644 --- a/example/compress/build.sc +++ b/example/compress/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/compress2/build.sc b/example/compress2/build.sc index 0e803b8..2166763 100644 --- a/example/compress2/build.sc +++ b/example/compress2/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/compress3/build.sc b/example/compress3/build.sc index 0e803b8..2166763 100644 --- a/example/compress3/build.sc +++ b/example/compress3/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/cookies/build.sc b/example/cookies/build.sc index 0e803b8..2166763 100644 --- a/example/cookies/build.sc +++ b/example/cookies/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/decorated/build.sc b/example/decorated/build.sc index 0e803b8..2166763 100644 --- a/example/decorated/build.sc +++ b/example/decorated/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/decorated2/build.sc b/example/decorated2/build.sc index 0e803b8..2166763 100644 --- a/example/decorated2/build.sc +++ b/example/decorated2/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/endpoints/build.sc b/example/endpoints/build.sc index 0e803b8..2166763 100644 --- a/example/endpoints/build.sc +++ b/example/endpoints/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/formJsonPost/build.sc b/example/formJsonPost/build.sc index 0e803b8..2166763 100644 --- a/example/formJsonPost/build.sc +++ b/example/formJsonPost/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/httpMethods/build.sc b/example/httpMethods/build.sc index 0e803b8..2166763 100644 --- a/example/httpMethods/build.sc +++ b/example/httpMethods/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/minimalApplication/build.sc b/example/minimalApplication/build.sc index 0e803b8..2166763 100644 --- a/example/minimalApplication/build.sc +++ b/example/minimalApplication/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/minimalApplication2/build.sc b/example/minimalApplication2/build.sc index 0e803b8..2166763 100644 --- a/example/minimalApplication2/build.sc +++ b/example/minimalApplication2/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/redirectAbort/build.sc b/example/redirectAbort/build.sc index 0e803b8..2166763 100644 --- a/example/redirectAbort/build.sc +++ b/example/redirectAbort/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/scalatags/build.sc b/example/scalatags/build.sc index 31bf5f6..d517c6b 100644 --- a/example/scalatags/build.sc +++ b/example/scalatags/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ivy"com.lihaoyi::scalatags:0.6.7", ) diff --git a/example/staticFiles/app/resources/cask/example.txt b/example/staticFiles/app/resources/cask/example.txt new file mode 100644 index 0000000..5184576 --- /dev/null +++ b/example/staticFiles/app/resources/cask/example.txt @@ -0,0 +1 @@ +the quick brown fox jumps over the lazy dog
\ No newline at end of file diff --git a/example/staticFiles/app/src/StaticFiles.scala b/example/staticFiles/app/src/StaticFiles.scala index 4da9805..e47f0a1 100644 --- a/example/staticFiles/app/src/StaticFiles.scala +++ b/example/staticFiles/app/src/StaticFiles.scala @@ -5,8 +5,11 @@ object StaticFiles extends cask.MainRoutes{ "Hello!" } - @cask.static("/static") - def staticRoutes() = "cask/test/resources/cask" + @cask.staticFiles("/static/file") + def staticFileRoutes() = "app/resources/cask" + + @cask.staticResources("/static/resource") + def staticResourceRoutes() = "cask" initialize() } diff --git a/example/staticFiles/app/test/src/ExampleTests.scala b/example/staticFiles/app/test/src/ExampleTests.scala index ddf7de3..c60f443 100644 --- a/example/staticFiles/app/test/src/ExampleTests.scala +++ b/example/staticFiles/app/test/src/ExampleTests.scala @@ -19,7 +19,10 @@ object ExampleTests extends TestSuite{ val tests = Tests{ 'StaticFiles - test(StaticFiles){ host => - requests.get(s"$host/static/example.txt").text() ==> + requests.get(s"$host/static/file/example.txt").text() ==> + "the quick brown fox jumps over the lazy dog" + + requests.get(s"$host/static/resource/example.txt").text() ==> "the quick brown fox jumps over the lazy dog" } diff --git a/example/staticFiles/build.sc b/example/staticFiles/build.sc index 0e803b8..00a7ee3 100644 --- a/example/staticFiles/build.sc +++ b/example/staticFiles/build.sc @@ -4,9 +4,11 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) + def forkWorkingDir = build.millSourcePath + object test extends Tests{ def testFrameworks = Seq("utest.runner.Framework") @@ -14,5 +16,12 @@ trait AppModule extends ScalaModule{ ivy"com.lihaoyi::utest::0.6.3", ivy"com.lihaoyi::requests::0.1.2", ) + + def forkWorkingDir = build.millSourcePath + + // redirect this to the forked `test` to make sure static file serving works + def testLocal(args: String*) = T.command{ + test(args:_*) + } } }
\ No newline at end of file diff --git a/example/todo/app/src/TodoServer.scala b/example/todo/app/src/TodoServer.scala index bfe4ea0..1a768d1 100644 --- a/example/todo/app/src/TodoServer.scala +++ b/example/todo/app/src/TodoServer.scala @@ -173,8 +173,8 @@ object TodoServer extends cask.MainRoutes{ ) } - @cask.static("/static") - def static() = "example/todo/resources/todo" + @cask.staticResources("/static") + def static() = "todo" initialize() } diff --git a/example/todo/build.sc b/example/todo/build.sc index c8cbe8e..ca0716a 100644 --- a/example/todo/build.sc +++ b/example/todo/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ivy"org.xerial:sqlite-jdbc:3.18.0", ivy"io.getquill::quill-jdbc:2.5.4", ivy"com.lihaoyi::scalatags:0.6.7", diff --git a/example/todoApi/build.sc b/example/todoApi/build.sc index 0e803b8..2166763 100644 --- a/example/todoApi/build.sc +++ b/example/todoApi/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/todoDb/build.sc b/example/todoDb/build.sc index 55e7b40..046e2e1 100644 --- a/example/todoDb/build.sc +++ b/example/todoDb/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ivy"org.xerial:sqlite-jdbc:3.18.0", ivy"io.getquill::quill-jdbc:2.5.4" ) diff --git a/example/variableRoutes/build.sc b/example/variableRoutes/build.sc index 0e803b8..2166763 100644 --- a/example/variableRoutes/build.sc +++ b/example/variableRoutes/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ diff --git a/example/websockets/build.sc b/example/websockets/build.sc index 561c652..96991eb 100644 --- a/example/websockets/build.sc +++ b/example/websockets/build.sc @@ -4,7 +4,7 @@ import mill._, scalalib._ trait AppModule extends ScalaModule{ def scalaVersion = "2.12.6" def ivyDeps = Agg( - ivy"com.lihaoyi::cask:0.0.9", + ivy"com.lihaoyi::cask:0.1.0", ) object test extends Tests{ |