summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-08-13 17:31:56 +0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-08-13 17:35:32 +0800
commiteddd2fdeb899e78ee605afc7b905c922a1f154ac (patch)
tree18f3c205b739da8c6da442a1ec9555177c2ab8cc
parentc4be0ad68e2eff9fe2d5fffdcb7d33ca539f6de5 (diff)
downloadcask-eddd2fdeb899e78ee605afc7b905c922a1f154ac.tar.gz
cask-eddd2fdeb899e78ee605afc7b905c922a1f154ac.tar.bz2
cask-eddd2fdeb899e78ee605afc7b905c922a1f154ac.zip
0.0.60.0.6
-rw-r--r--build.sc17
-rw-r--r--docs/pages/1 - Cask: a Scala HTTP micro-framework .md14
-rw-r--r--example/compress/build.sc2
-rw-r--r--example/compress2/build.sc2
-rw-r--r--example/compress3/build.sc2
-rw-r--r--example/cookies/build.sc2
-rw-r--r--example/decorated/build.sc2
-rw-r--r--example/decorated2/build.sc2
-rw-r--r--example/endpoints/build.sc2
-rw-r--r--example/formJsonPost/build.sc2
-rw-r--r--example/httpMethods/build.sc2
-rw-r--r--example/minimalApplication/build.sc2
-rw-r--r--example/minimalApplication2/build.sc2
-rw-r--r--example/redirectAbort/build.sc2
-rw-r--r--example/scalatags/build.sc2
-rw-r--r--example/staticFiles/build.sc2
-rw-r--r--example/todo/build.sc2
-rw-r--r--example/todoApi/build.sc2
-rw-r--r--example/todoDb/build.sc2
-rw-r--r--example/variableRoutes/build.sc2
-rw-r--r--example/websockets/build.sc2
21 files changed, 44 insertions, 25 deletions
diff --git a/build.sc b/build.sc
index 1e3ac3b..f82bbe3 100644
--- a/build.sc
+++ b/build.sc
@@ -58,7 +58,7 @@ object cask extends ScalaModule with PublishModule {
}
object example extends Module{
trait LocalModule extends ScalaModule{
- def ivyDeps = super.ivyDeps().filter(_ != ivy"com.lihaoyi::cask:0.0.5")
+ def ivyDeps = super.ivyDeps().filter(_ != ivy"com.lihaoyi::cask:0.0.6")
override def millSourcePath = super.millSourcePath / "app"
def moduleDeps = Seq(cask)
@@ -129,6 +129,21 @@ def uploadToGithub(authKey: String) = T.command{
val f = tmp.dir()
cp(example, f/'folder)
write.over(
+ f/'folder/"cask",
+ """#!/usr/bin/env bash
+ |
+ |if [ ! -f out/mill-cask ]; then
+ | echo "Initializing Cask/Mill build tool for the first time"
+ | mkdir -p out &&
+ | (echo "#!/usr/bin/env sh" && curl -L https://github.com/lihaoyi/mill/releases/download/0.2.6/0.2.6) > out/mill-cask
+ |fi
+ |
+ |chmod +x out/mill-cask
+ |"$(pwd)"/out/mill-cask "$@"
+ """.stripMargin
+ )
+ %%("chmod", "+x", f/'folder/"cask")(f/'folder)
+ write.over(
f/'folder/"build.sc",
read(f/'folder/"build.sc").replace("trait AppModule ", "object app ")
)
diff --git a/docs/pages/1 - Cask: a Scala HTTP micro-framework .md b/docs/pages/1 - Cask: a Scala HTTP micro-framework .md
index fff6270..b87c5a6 100644
--- a/docs/pages/1 - Cask: a Scala HTTP micro-framework .md
+++ b/docs/pages/1 - Cask: a Scala HTTP micro-framework .md
@@ -23,8 +23,6 @@ Getting Started
The easiest way to begin using Cask is by downloading the
[Mill](http://www.lihaoyi.com/mill/) example project:
-- Install [Mill](http://www.lihaoyi.com/mill/)
-
- Unzip one of the example projects available on this page (e.g. above) into a
folder. This should give you the following files:
@@ -37,7 +35,7 @@ app/test/src/ExampleTests.scala
- `cd` into the folder, and run
```bash
-mill -w app.runBackground
+./cask -w app.runBackground
```
This will server up the Cask application on `http://localhost:8080`. You can
@@ -64,7 +62,7 @@ These HTTP calls are part of the test suite for the example project, which you
can run using:
```bash
-mill -w app.test
+./cask -w app.test
```
Cask is just a Scala library, and you can use Cask in any existing Scala project
@@ -78,13 +76,19 @@ ivy"com.lihaoyi::cask:0.1.0"
"com.lihaoyi" %% "cask" % "0.1.0"
```
+The `./cask` command is just a wrapper around the
+[Mill build tool](http://www.lihaoyi.com/mill/); the `build.sc` files you see in
+all examples are Mill build files, and you can use your own installation of Mill
+instead of `./cask` if you wish. All normal Mill commands and functionality
+works for `./cask`.
+
Using Cask
----------
The following examples will walk you through how to use Cask to accomplish tasks
common to anyone writing a web application. Each example comes with a
downloadable example project with code and unit tests, which you can use via the
-same `mill -w app.runBackground` or `mill -w app.test` workflows we saw above.
+same `./cask -w app.runBackground` or `./cask -w app.test` workflows we saw above.
### Minimal Example
diff --git a/example/compress/build.sc b/example/compress/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/compress2/build.sc b/example/compress2/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/compress3/build.sc b/example/compress3/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/cookies/build.sc b/example/cookies/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/decorated/build.sc b/example/decorated/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/decorated2/build.sc b/example/decorated2/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/endpoints/build.sc b/example/endpoints/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/formJsonPost/build.sc b/example/formJsonPost/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/httpMethods/build.sc b/example/httpMethods/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/minimalApplication/build.sc b/example/minimalApplication/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/minimalApplication2/build.sc b/example/minimalApplication2/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/redirectAbort/build.sc b/example/redirectAbort/build.sc
index eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/scalatags/build.sc b/example/scalatags/build.sc
index a6d3dec..2a10807 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
ivy"com.lihaoyi::scalatags:0.6.7",
)
diff --git a/example/staticFiles/build.sc b/example/staticFiles/build.sc
index eec1a4b..1d4f2bb 100644
--- a/example/staticFiles/build.sc
+++ b/example/staticFiles/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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/todo/build.sc b/example/todo/build.sc
index e929625..b57f75c 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
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 eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/todoDb/build.sc b/example/todoDb/build.sc
index 834b8ba..e6cf583 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
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 eec1a4b..1d4f2bb 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{
diff --git a/example/websockets/build.sc b/example/websockets/build.sc
index 35812c2..a612c66 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.5",
+ ivy"com.lihaoyi::cask:0.0.6",
)
object test extends Tests{