Skip to content

Commit

Permalink
0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Aug 13, 2018
1 parent c4be0ad commit eddd2fd
Show file tree
Hide file tree
Showing 21 changed files with 44 additions and 25 deletions.
17 changes: 16 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -128,6 +128,21 @@ def uploadToGithub(authKey: String) = T.command{
for(example <- examples){
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 ")
Expand Down
14 changes: 9 additions & 5 deletions docs/pages/1 - Cask: a Scala HTTP micro-framework .md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/compress/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/compress2/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/compress3/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/cookies/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/decorated/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/decorated2/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/endpoints/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/formJsonPost/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/httpMethods/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/minimalApplication/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/minimalApplication2/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/redirectAbort/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/scalatags/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand Down
2 changes: 1 addition & 1 deletion example/staticFiles/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/todo/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion example/todoApi/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/todoDb/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion example/variableRoutes/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion example/websockets/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit eddd2fd

Please sign in to comment.