@@ -12,19 +12,18 @@ import io.github.davidgregory084.TpolecatModule
12
12
13
13
object libVersion {
14
14
val scala = " 3.2.0"
15
- val scalajs = " 1.10.1 "
15
+ val scalajs = " 1.11.0 "
16
16
val zio = " 2.0.2"
17
17
val zhttp = " 2.0.0-RC11"
18
- val sttp = " 3.8.0 "
18
+ val sttp = " 3.8.2 "
19
19
val organizeimports = " 0.6.0"
20
20
val scalajsdom = " 2.3.0"
21
- val scalatest = " 3.2.13 "
21
+ val scalatest = " 3.2.14 "
22
22
}
23
23
24
24
trait Common extends ScalaModule with TpolecatModule with ScalafmtModule with ScalafixModule {
25
25
override def scalaVersion = libVersion.scala
26
26
def scalafixIvyDeps = Agg (ivy " com.github.liancheng::organize-imports: ${libVersion.organizeimports}" )
27
- // Add repositories for snapshot builds
28
27
def repositoriesTask = T .task { // Add snapshot repositories in case needed
29
28
super .repositoriesTask() ++ Seq (" oss" , " s01.oss" )
30
29
.map(r => s " https:// $r.sonatype.org/content/repositories/snapshots " )
@@ -36,27 +35,11 @@ trait Common extends ScalaModule with TpolecatModule with ScalafmtModule with Sc
36
35
)
37
36
}
38
37
39
- // -----------------------------------------------------------------------------
40
- // Global commands
41
- // -----------------------------------------------------------------------------
42
-
43
- def lint (ev : eval.Evaluator ) = T .command {
44
- mill.main.MainModule .evaluateTasks(
45
- ev,
46
- Seq (" __.fix" , " +" , " mill.scalalib.scalafmt.ScalafmtModule/reformatAll" , " __.sources" ),
47
- mill.define.SelectMode .Separated ,
48
- )(identity)
49
- }
50
-
51
- def deps (ev : eval.Evaluator ) = T .command {
52
- mill.scalalib.Dependency .showUpdates(ev)
53
- }
54
-
55
38
// -----------------------------------------------------------------------------
56
39
// Projects
57
40
// -----------------------------------------------------------------------------
58
41
59
- object shared extends Common
42
+ // object shared extends Common
60
43
61
44
object backend extends Common with DockerModule {
62
45
// Runtime dependencies
@@ -90,6 +73,7 @@ object frontend extends ScalaJSModule with Common {
90
73
def moduleKind = T (ModuleKind .ESModule )
91
74
def moduleSplitStyle = T (ModuleSplitStyle .SmallModulesFor (List (" com.carlosedp.zioscalajs.frontend" )))
92
75
76
+ // These two tasks are used by Vite to get update path
93
77
def fastLinkOut () = T .command {
94
78
val target = fastLinkJS()
95
79
println(target.dest.path)
@@ -107,3 +91,22 @@ object frontend extends ScalaJSModule with Common {
107
91
def jsEnvConfig = T (JsEnvConfig .JsDom ())
108
92
}
109
93
}
94
+
95
+ // -----------------------------------------------------------------------------
96
+ // Global commands
97
+ // -----------------------------------------------------------------------------
98
+
99
+ // Toplevel commands
100
+ def runTasks (t : Seq [String ])(implicit ev : eval.Evaluator ) = T .task {
101
+ mill.main.MainModule .evaluateTasks(
102
+ ev,
103
+ t.flatMap(x => x +: Seq (" +" )).flatMap(x => x.split(" " )).dropRight(1 ),
104
+ mill.define.SelectMode .Separated ,
105
+ )(identity)
106
+ }
107
+ def lint (implicit ev : eval.Evaluator ) = T .command {
108
+ runTasks(Seq (" __.fix" , " mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources" ))
109
+ }
110
+ def deps (ev : eval.Evaluator ) = T .command {
111
+ mill.scalalib.Dependency .showUpdates(ev)
112
+ }
0 commit comments