add zio demo

This commit is contained in:
Mark Canlas 2022-12-01 06:50:22 -05:00
parent 1d8bc70bb9
commit 26a1e8c823
3 changed files with 23 additions and 1 deletions

View File

@ -6,7 +6,7 @@ lazy val firepower =
)
.withCats
.withTesting
.aggregate(nescant, scratchpad)
.aggregate(nescant, scratchpad, demo)
lazy val nescant =
project.withCats.withTesting
@ -15,3 +15,7 @@ lazy val scratchpad =
project
.withCats
.withTesting
lazy val demo =
module("demo")
.withEfectMonad

View File

@ -0,0 +1,8 @@
import zio.*
import java.io.IOException
object PrintPrograms extends ZIOAppDefault:
def run: IO[IOException, Unit] =
Console
.printLine("Hello, World!")

View File

@ -7,10 +7,20 @@ object ProjectPlugin extends AutoPlugin {
val autoImport = ThingsToImport
object ThingsToImport {
private def jarName(s: String) =
"firepower-" + s
def module(s: String): Project =
Project(s, file(jarName(s)))
.settings(name := jarName(s))
implicit class ProjectOps(p: Project) {
def withCats: Project =
p.settings(libraryDependencies += "org.typelevel" %% "cats-core" % "2.9.0")
def withEfectMonad: Project =
p.settings(libraryDependencies += "dev.zio" %% "zio" % "2.0.4")
def withTesting: Project = {
val weaverVersion =
"0.8.0"