Skip to content

Commit

Permalink
Update build and libraries in examples (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
lolgab authored Jul 23, 2023
1 parent 264a87c commit 53947e8
Show file tree
Hide file tree
Showing 27 changed files with 93 additions and 140 deletions.
6 changes: 3 additions & 3 deletions ci/upload.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def apply(uploadedFile: os.Path,
val body = requests.get(
s"https://api.github.com/repos/com-lihaoyi/cask/releases/tags/$tagName",
headers = Seq("Authorization" -> s"token $authKey")
).text
).text()

val parsed = ujson.read(body)

Expand All @@ -34,8 +34,8 @@ def apply(uploadedFile: os.Path,
)


println(res.text)
val longUrl = ujson.read(res.text)("browser_download_url").str.toString
println(res.text())
val longUrl = ujson.read(res.text())("browser_download_url").str.toString

longUrl
}
9 changes: 3 additions & 6 deletions example/compress/build.sc
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{


def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/compress2/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/compress3/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/cookies/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/decorated/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/decorated2/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/endpoints/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/formJsonPost/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9"
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0"
)
}
}
8 changes: 3 additions & 5 deletions example/httpMethods/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/minimalApplication/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/minimalApplication2/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/redirectAbort/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
10 changes: 4 additions & 6 deletions example/scalatags/build.sc
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
ivy"com.lihaoyi::scalatags:0.9.1".withDottyCompat(scalaVersion()),
ivy"com.lihaoyi::scalatags:0.12.0"
)

object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
9 changes: 3 additions & 6 deletions example/staticFiles/build.sc
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{


def forkWorkingDir = build.millSourcePath
def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)

def forkWorkingDir = build.millSourcePath
Expand Down
9 changes: 3 additions & 6 deletions example/staticFiles2/build.sc
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{


def forkWorkingDir = build.millSourcePath
def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)

def forkWorkingDir = build.millSourcePath
Expand Down
5 changes: 3 additions & 2 deletions example/todo/app/src/TodoServer.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app
import com.typesafe.config.ConfigFactory
import io.getquill.{SnakeCase, SqliteJdbcContext}
import io.getquill.context.ExecutionInfo
import scalatags.Text.all._
import scalatags.Text.tags2

Expand Down Expand Up @@ -36,13 +37,13 @@ object TodoServer extends cask.MainRoutes{
| text TEXT
|);
|""".stripMargin
)
)(ExecutionInfo.unknown, ())
ctx.executeAction(
"""INSERT INTO todo (checked, text) VALUES
|(1, 'Get started with Cask'),
|(0, 'Profit!');
|""".stripMargin
)
)(ExecutionInfo.unknown, ())

import ctx._

Expand Down
15 changes: 7 additions & 8 deletions example/todo/build.sc
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
ivy"org.xerial:sqlite-jdbc:3.41.2.1",
ivy"io.getquill::quill-jdbc:3.4.10",
ivy"com.lihaoyi::scalatags:0.9.1",
ivy"org.xerial:sqlite-jdbc:3.42.0.0",
ivy"io.getquill::quill-jdbc:4.6.1",
ivy"com.lihaoyi::scalatags:0.12.0",
ivy"org.slf4j:slf4j-simple:1.7.30",
)

object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
8 changes: 3 additions & 5 deletions example/todoApi/build.sc
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import mill._, scalalib._


trait AppModule extends CrossScalaModule{

def ivyDeps = Agg[Dep](
)
object test extends ScalaModuleTests{
def testFramework = "utest.runner.Framework"
object test extends ScalaTests with TestModule.Utest{

def ivyDeps = Agg(
ivy"com.lihaoyi::utest::0.7.10",
ivy"com.lihaoyi::requests::0.6.9",
ivy"com.lihaoyi::utest::0.8.1",
ivy"com.lihaoyi::requests::0.8.0",
)
}
}
Loading

0 comments on commit 53947e8

Please sign in to comment.