init: scala-cli project with some dependencies
This commit is contained in:
parent
8164f46045
commit
44cc9209b4
|
@ -0,0 +1,10 @@
|
||||||
|
#+title: Readme
|
||||||
|
* attempting to set up something more complex in a single small project
|
||||||
|
** adding dependencies:
|
||||||
|
#+begin_src scala
|
||||||
|
//> using dep com.lihaoyi::pprint:0.8.1
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
this should be on the very top of the file, otherwise it's not visible to scala-cli
|
||||||
|
|
||||||
|
that was my error for a while - having package declaration on top
|
|
@ -0,0 +1,31 @@
|
||||||
|
//> using dep com.lihaoyi::cask:0.9.1
|
||||||
|
//> using dep com.softwaremill.quicklens::quicklens:1.9.4
|
||||||
|
//> using dep com.lihaoyi::pprint:0.8.1
|
||||||
|
//> using dep org.scalameta::munit:1.0.0-M1
|
||||||
|
|
||||||
|
// import munit.FunSuite
|
||||||
|
package app
|
||||||
|
|
||||||
|
object Main {
|
||||||
|
def main(args: Array[String]) = {
|
||||||
|
final case class Thingy(a: String, b: Int, c: List[Double])
|
||||||
|
val th = Thingy("hello", 1234, List(1D, 1.523, 1234.1234))
|
||||||
|
pprint.pprintln(th)
|
||||||
|
println(th)
|
||||||
|
}
|
||||||
|
|
||||||
|
// object MinimalExample extends cask.MainRoutes {
|
||||||
|
// @cask.get("/")
|
||||||
|
// def hello() = {
|
||||||
|
// "Hello world!"
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @cask.post("/do-thing")
|
||||||
|
// def doThing(request: cask.Request) = {
|
||||||
|
// request.text().reverse
|
||||||
|
// }
|
||||||
|
|
||||||
|
// initialize()
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
//> using dep org.scalameta::munit::1.0.0-M1
|
//> using dep org.scalameta::munit::1.0.0-M1
|
||||||
|
|
||||||
|
|
||||||
class MyTests extends munit.FunSuite {
|
class MyTests extends munit.FunSuite {
|
||||||
test("test") {
|
test("test") {
|
||||||
val x = 2
|
val x = 2
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
|
//> using dep com.lihaoyi::pprint:0.8.1
|
||||||
|
|
||||||
object Hello {
|
object Hello {
|
||||||
def main(args: Array[String]): Unit = {
|
def main(args: Array[String]): Unit = {
|
||||||
println(s"hello, i guess '${OtherObject.yoyo}'!!!")
|
case class Thingy(a: Long, b: List[String])
|
||||||
|
val th = Thingy(1234L, List("hello", "worlds"))
|
||||||
|
pprint.pprintln(s"hello, i guess '${OtherObject.yoyo}'!!!")
|
||||||
|
pprint.pprintln(th)
|
||||||
|
println(th)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue