-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
72 lines (62 loc) Β· 2.88 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import sbt.Def
import scala.{ Console => csl }
val developer = Developer(
"mvillafuertem",
"Miguel Villafuerte",
"mvillafuertem@email.com",
url("https://github.com/mvillafuertem")
)
Global / onLoad := {
val GREEN = csl.GREEN
val RESET = csl.RESET
println(s"""$GREEN
|$GREEN ββββββ βββ βββ ββββββββ
|$GREEN ββββββββ βββ βββ ββββββββ
|$GREEN ββββββββ βββ ββ βββ ββββββββ
|$GREEN ββββββββ ββββββββββ ββββββββ
|$GREEN βββ βββ ββββββββββ ββββββββ
|$GREEN βββ βββ ββββββββ ββββββββ
|$RESET v.${version.value}
|$RESET https://github.com/mvillafuertem/aws
|""".stripMargin)
(Global / onLoad).value
}
val scala213 = "2.13.10"
lazy val aws = (project in file("."))
.aggregate(cdktf)
.settings(
scalaVersion := scala213,
welcomeMessage
)
lazy val cdktf = (project in file("modules/cdktf"))
.settings(scalaVersion := scala213)
.settings(watchTriggers += baseDirectory.value.toGlob / "*.scala")
lazy val iam = (project in file("modules/iam"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(scalaVersion := scala213)
.settings(libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.15" % IntegrationTest)
.settings(libraryDependencies += "com.dimafeng" %% "testcontainers-scala-core" % "0.40.12" % IntegrationTest)
.dependsOn(cdktf)
lazy val vpc = (project in file("modules/vpc"))
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(scalaVersion := scala213)
.settings(libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.15" % Test)
.settings(libraryDependencies += "com.dimafeng" %% "testcontainers-scala-core" % "0.40.12" % IntegrationTest)
.dependsOn(cdktf)
def welcomeMessage: Def.Setting[String] = onLoadMessage := {
def header(text: String): String = s"${csl.BOLD}${csl.MAGENTA}$text${csl.RESET}"
def cmd(text: String, description: String = "") = f"${csl.GREEN}> ${csl.CYAN}$text%10s $description${csl.RESET}"
// def subItem(text: String): String = s" ${Console.YELLOW}> ${Console.CYAN}$text${Console.RESET}"
s"""|${header("sbt")}:
|${cmd("build", "- Prepares sources, compiles and runs tests")}
|${cmd("prepare", "- Prepares sources by applying both scalafix and scalafmt")}
|${cmd("fmt", "- Formats source files using scalafmt")}
|${cmd("cdktf/run", "- Create cdk.tf.json files")}
|
|${header("yarn")}:
|${cmd("--cwd modules/cdktf/ install")}
|${cmd("--cwd modules/cdktf/ get")}
""".stripMargin
}