-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.mill
261 lines (227 loc) · 8.53 KB
/
build.mill
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
// build.sc
import mill._, scalalib._, scalajslib._, scalanativelib._, publish._
trait Common extends ScalaModule
{ def version = "0.3.4snap"
def scalaVersion = "3.6.3"
def scalacOptions = Seq("-feature", "-language:higherKinds,implicitConversions", "-noindent", "-deprecation", "-encoding", "UTF-8", "-unchecked")
}
trait CommonJvm extends Common
{ Outer =>
trait InnerTests extends ScalaTests
{ def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.8.4")
def testFramework = "utest.runner.Framework"
def sources = T.sources(Outer.millSourcePath / "TestSrc", millSourcePath / "src")
def resources = T.sources(Outer.millSourcePath / "TestRes", millSourcePath / "res")
}
}
trait CommonJs extends ScalaJSModule with Common
{ def scalaJSVersion = "1.18.1"
def ivyDeps = Agg(ivy"org.scala-js::scalajs-dom_sjs1:2.8.0")
}
object Util extends CommonJvm
{ def sources1 = T.sources(Seq("src", "srcArr", "srcParse", "srcPersist").map(name => PathRef(millSourcePath / name)))
def sources2 = T.sources(millSourcePath / "srcRArr", millSourcePath / "JvmSrc")
def sources = T.sources{ sources1() ++ sources2() }
def resources = T.sources(millSourcePath / "res", T.workspace / "User")
object test extends InnerTests
}
object UtilJs extends CommonJs
{
def source2 = Task{
val str = os.read(T.workspace / "Util/srcRArr/RArr.scala").mkString
val str2 = str.replaceAll("AnyVal with ", "")
os.write(T.dest / "RArr.scala", str2)
PathRef(T.dest)
}
def sources = Util.sources1() :+ source2()
}
object Geom extends CommonJvm
{
def sources1 = T.sources(
Seq("src", "srcLines", "srcShapes", "srcPoly", "srcUnits", "srcImperial", "srcGraphic", "srcGui", "srcTrans", "srcUnits", "srcWeb", "srcEarth").
map(name => PathRef(millSourcePath / name)))
def sources2 = T.sources(millSourcePath / "JvmSrc")
def sources = T.sources { sources1() ++ sources2() }
def moduleDeps = Seq(Util)
object test extends InnerTests
}
object GeomFx extends CommonJvm
{ def sources = T.sources(T.workspace / "Geom" / "GeomFx" / "src")
def moduleDeps = Seq(Geom)
def unmanagedClasspath = T {
import coursier._, parse.DependencyParser
val fxMod = Dependency(Module(org"org.openjfx", ModuleName("javafx-controls")), "15.0.1")
val files = Fetch().addDependencies(fxMod).run()
val pathRefs = files.map(f => PathRef(os.Path(f)))
Agg(pathRefs: _*)
}
def forkArgs = Seq("--module-path",
sys.env("JAVAFX_HOME") + ":" + "/Users/ajr/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/openjfx/javafx-controls/15.0.1",
"--add-modules", "javafx.controls"
)
}
object GeomJs extends CommonJs
{ def moduleDeps = Seq(UtilJs)
def source2 = T.source(T.workspace / "Geom" / "GeomJs" / "src")
def sources = Geom.sources1() :+ source2()
}
object GeomExs extends CommonJvm
{ def moduleDeps = Seq(Geom)
def sources1 = T.sources{ Seq("src", "srcLessons").map(name => PathRef(T.workspace / "Geom" / "GeomExs" / name)) }
def source2 = T.source(T.workspace / "Geom" / "GeomExs" / "JvmSrc")
def sources = T.sources { sources1() :+ source2() }
def mainClass = Some("learn.LsE1App")
}
object GeomExsJs extends CommonJs
{ def moduleDeps = Seq(GeomJs)
def source2 = T.source(T.workspace / "Geom" / "GeomExs" / "GeomExsJs" / "src")
def sources = GeomExs.sources1() :+ source2()
def mainClass = Some("learn.LessonAppJs")
}
object Tiling extends CommonJvm
{ def moduleDeps = Seq(Geom)
def sources1 = T.sources(Seq("src", "srcHex", "srcHLayer", "srcSq", "srcSqLayer").map(name => PathRef(millSourcePath / name)))
def sources = sources1()
object test extends InnerTests
}
object TilingJs extends CommonJs
{ def moduleDeps = Seq(GeomJs)
def sources = Tiling.sources1()
}
object TilingExs extends CommonJvm
{ def moduleDeps = Seq(Tiling)
def sources = T.sources(T.workspace / "Tiling" / "TilingExs" / "src")
object test extends InnerTests
def mainClass = Some("ostrat.pZero.TilingTryApp")
}
object EGrid extends CommonJvm
{ def moduleDeps = Seq(Tiling)
def sources1 = T.sources(Seq("src", "srcPts").map(name => PathRef(millSourcePath / name)))
def source2 = T.source(T.workspace / "EGrid" / "JvmSrc")
def sources = sources1() :+ source2()
object test extends InnerTests
}
object EGridJs extends CommonJs
{ def moduleDeps = Seq(TilingJs)
def sources = EGrid.sources1()
trait Base extends CommonJs
{ def name: String
def sources = T.sources(Seq(PathRef(T.workspace / "EGrid" / "EGridJs" / "src")))
def moduleDeps = Seq(EGridJs)
def mainClass = Some("ostrat.pSJs." + name + "Js")
}
object EG1300 extends Base { def name = "EG1300" }
object EG1000 extends Base { def name = "EG1000" }
object EG640 extends Base { def name = "EG640" }
object EG460 extends Base { def name = "EG460" }
object EG320 extends Base { def name = "EG320" }
object EG220Europe extends Base { def name = "EG220Europe" }
object EG220EuropeWide extends Base { def name = "EG220EuropeWide" }
object EG220NAmerica extends Base { def name = "EG220NAmerica" }
object EG160Europe extends Base { def name = "EG160Europe" }
object EG120Europe extends Base { def name = "EG120Europe" }
object EG80Europe extends Base { def name = "EG80Europe" }
object EarthApp extends Base { def name = "EarthApp"}
}
object Apps extends CommonJvm
{ def moduleDeps = Seq(EGrid)
def sources1 = T.sources(Seq("src", "srcStrat").map(name => PathRef(millSourcePath / name)))
def sources = sources1()
object test extends InnerTests
}
object AppsJs extends CommonJs
{ def moduleDeps = Seq(EGridJs)
def source2 = T.source(PathRef(T.workspace / "Apps" / "AppsJs" / "src"))
def sources = Apps.sources1() :+ source2()
def ivyDeps = Agg(ivy"io.github.cquiroz::scala-java-time_sjs1:2.6.0")
}
trait AppsJs extends CommonJs
{ def moduleDeps = Seq(AppsJs)
}
object AppJs extends Module
{
trait Base extends AppsJs
{ def name: String
def mainClass = Some("ostrat.pSJs." + name + "AppJs")
}
object DicelessApp extends Base { def name = "Diceless" }
object WW2App extends Base { def name = "WW2" }
object PericuloApp extends Base { def name = "Periculo" }
object WW1App extends Base { def name = "WW1" }
object BC305App extends Base { def name = "BC305" }
object SorsApp extends Base { def name = "Sors" }
object PeriApp extends Base { def name = "Peri" }
object DiscovApp extends Base { def name = "Discov" }
object IndRevApp extends Base { def name = "IndRev" }
object UnitLocApp extends Base { def name = "UnitLoc" }
object CivRiseApp extends Base { def name = "CivRise" }
object ZugApp extends Base { def name = "Zug" }
object FlagsApp extends Base { def name = "Flags" }
object DungeonApp extends Base { def name = "Dungeon" }
object PlanetsApp extends Base { def name = "Planets" }
object ChessApp extends Base { def name = "Chess" }
}
object Dev extends CommonJvm
{ def moduleDeps = Seq(GeomExs, TilingExs, EGrid, Apps)
def source1 = T.source(millSourcePath / "src")
def source2 = T.source(millSourcePath / "JvmSrc")
def sources = T.sources(Seq(source1(), source2()))
def mainClass = Some("ostrat.pDev.SiteHtmlWrite")
}
object DevFx extends CommonJvm
{ def moduleDeps = Seq(Dev, GeomFx)
def sources = T.sources(T.workspace / "Dev" / "DevFx" / "src")
def mainClass = Some("ostrat.pFx.DevApp")
}
def run() = DevFx.runBackground()
def SiteStage = Task{
import AppJs._, EGridJs._
DicelessApp.fullLinkJS()
WW2App.fullLinkJS()
PericuloApp.fullLinkJS()
WW1App.fullLinkJS()
BC305App.fullLinkJS()
SorsApp.fullLinkJS()
IndRevApp.fullLinkJS()
DiscovApp.fullLinkJS()
UnitLocApp.fullLinkJS()
CivRiseApp.fullLinkJS()
ZugApp.fullLinkJS()
FlagsApp.fullLinkJS()
DungeonApp.fullLinkJS()
PlanetsApp.fullLinkJS()
ChessApp.fullLinkJS()
EG1300.fullLinkJS()
EG1000.fullLinkJS()
EG640.fullLinkJS()
EG460.fullLinkJS()
EG320.fullLinkJS()
EG220Europe.fullLinkJS()
EG220EuropeWide.fullLinkJS()
EG220NAmerica.fullLinkJS()
EG160Europe.fullLinkJS()
EG120Europe.fullLinkJS()
EG80Europe.fullLinkJS()
EarthApp.fullLinkJS()
Dev.runner().run(mainClass = "ostrat.pDev.MillStaging", args = Array[String]())
}
object Servlet extends CommonJvm
{ def sources = T.sources(T.workspace / "Dev" / "Servlet" / "src")
def ivyDeps = Agg(ivy"jakarta.servlet:jakarta.servlet-api:6.0.0")
def moduleDeps = Seq(Dev)
}
object ServletExtras extends CommonJvm
{ def sources = T.sources(T.workspace / "Dev" / "ServletExtras" / "src")
def moduleDeps = Seq(Dev)
}
def packAll = Task{
Util.jar()
Geom.jar()
Tiling.jar()
EGrid.jar()
Dev.jar()
}
def ServletStage = Task{
packAll()
ServletExtras.runner().run(mainClass = "ostrat.pDev.MillStagingServlet", args = Array[String]())
}