Skip to content

Commit 579132a

Browse files
authored
Update to Mill 0.11.1 (#286)
1 parent edb2990 commit 579132a

File tree

6 files changed

+81
-120
lines changed

6 files changed

+81
-120
lines changed

.github/workflows/actions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
echo '-XX:MaxRAMPercentage=95.0' >> .mill-jvm-opts
2626
./mill -i --disable-ticker __.js.__.resolvedIvyDeps
27-
./mill -i --disable-ticker -j 0 all __.js.__.publishArtifacts __.js.__.compile __.js.__.fastOpt __.js.__.test
27+
./mill -i --disable-ticker -j 0 __.js.__.publishArtifacts + __.js.__.compile + __.js.__.fastOpt + __.js.__.test
2828
test-native:
2929
runs-on: ubuntu-22.04
3030
steps:
@@ -38,7 +38,7 @@ jobs:
3838
run: |
3939
echo '-XX:MaxRAMPercentage=95.0' >> .mill-jvm-opts
4040
./mill -i --disable-ticker __.native.__.resolvedIvyDeps
41-
./mill -i --disable-ticker -j 0 all __.native.__.publishArtifacts __.native.__.compile __.native.__.test
41+
./mill -i --disable-ticker -j 0 __.native.__.publishArtifacts + __.native.__.compile + __.native.__.test
4242
test-jvm:
4343
runs-on: ubuntu-22.04
4444
steps:
@@ -52,7 +52,7 @@ jobs:
5252
run: |
5353
echo '-XX:MaxRAMPercentage=95.0' >> .mill-jvm-opts
5454
./mill -i --disable-ticker __.jvm.__.resolvedIvyDeps
55-
./mill -i --disable-ticker -j 0 all __.jvm.__.publishArtifacts __.jvm.__.compile __.jvm.__.test
55+
./mill -i --disable-ticker -j 0 __.jvm.__.publishArtifacts + __.jvm.__.compile + __.jvm.__.test
5656
check-binary-compatibility:
5757
runs-on: ubuntu-22.04
5858
steps:

.mill-version

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
0.10.10
1+
0.11.1
2+

build.sc

Lines changed: 72 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import scalalib._
33
import scalajslib._
44
import scalanativelib._
55
import publish._
6-
import mill.eval.Result
6+
import mill.api.Result
77
import mill.modules.Jvm.createJar
88

9-
import mill.scalalib.api.Util.isScala3
10-
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.3.0`
9+
import mill.scalalib.api.ZincWorkerUtil.isScala3
10+
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
11+
import $ivy.`com.github.lolgab::mill-mima::0.0.23`
1112

1213
import de.tobiasroeser.mill.vcs.version.VcsVersion
13-
import $ivy.`com.github.lolgab::mill-mima::0.0.13`
1414
import com.github.lolgab.mill.mima._
1515

1616
val scala31 = "3.2.2"
@@ -20,24 +20,16 @@ val scala211 = "2.11.12"
2020
val scalaJS1 = "1.12.0"
2121
val scalaNative04 = "0.4.9"
2222
val crossVersions = Seq(scala31, scala213, scala212, scala211)
23-
val crossJsVersions = Seq(scala31 -> scalaJS1, scala213 -> scalaJS1, scala212 -> scalaJS1, scala211 -> scalaJS1)
24-
val crossNativeVersions = Seq(scala31 -> scalaNative04, scala213 -> scalaNative04, scala212 -> scalaNative04, scala211 -> scalaNative04)
25-
2623

2724
object fastparse extends Module{
28-
object jvm extends Cross[fastparseJvmModule](crossVersions:_*)
29-
class fastparseJvmModule(val crossScalaVersion: String) extends FastparseModule{
30-
def platformSegment = "jvm"
31-
object test extends Tests with CommonTestModule{
32-
def platformSegment = "jvm"
33-
}
25+
object jvm extends Cross[fastparseJvmModule](crossVersions)
26+
trait fastparseJvmModule extends FastparseModule{
27+
object test extends ScalaModuleTests with CommonTestModule
3428
}
3529

36-
object js extends Cross[fastparseJsModule](crossJsVersions:_*)
37-
class fastparseJsModule(val crossScalaVersion: String, crossScalaJsVersion: String) extends FastparseModule with ScalaJSModule {
38-
def platformSegment = "js"
39-
def millSourcePath = super.millSourcePath / os.up
40-
def scalaJSVersion = crossScalaJsVersion
30+
object js extends Cross[fastparseJsModule](crossVersions)
31+
trait fastparseJsModule extends FastparseModule with ScalaJSModule {
32+
def scalaJSVersion = scalaJS1
4133
private def sourceMapOptions = T.task {
4234
val vcsState = VcsVersion.vcsState()
4335
vcsState.lastTag.collect {
@@ -47,21 +39,17 @@ object fastparse extends Module{
4739
s"$sourcesOptionName:${T.workspace.toIO.toURI}->$baseUrl/$tag/"
4840
}
4941
}
42+
5043
override def scalacOptions = super.scalacOptions() ++ sourceMapOptions()
51-
object test extends Tests with CommonTestModule{
52-
def platformSegment = "js"
53-
}
44+
45+
object test extends ScalaJSModuleTests with CommonTestModule
5446
}
5547

56-
object native extends Cross[fastparseNativeModule](crossNativeVersions:_*)
57-
class fastparseNativeModule(val crossScalaVersion: String, crossScalaNativeVersion: String) extends FastparseModule with ScalaNativeModule {
58-
def platformSegment = "native"
59-
def millSourcePath = super.millSourcePath / os.up
60-
def scalaNativeVersion = crossScalaNativeVersion
48+
object native extends Cross[fastparseNativeModule](crossVersions)
49+
trait fastparseNativeModule extends FastparseModule with ScalaNativeModule {
50+
def scalaNativeVersion = scalaNative04
6151

62-
object test extends Tests with CommonTestModule{
63-
def platformSegment = "native"
64-
}
52+
object test extends ScalaNativeModuleTests with CommonTestModule
6553
}
6654
}
6755

@@ -70,6 +58,7 @@ trait FastparseModule extends CommonCrossModule with Mima{
7058
ivy"com.lihaoyi::sourcecode::0.3.0",
7159
ivy"com.lihaoyi::geny::1.0.0"
7260
)
61+
7362
def compileIvyDeps =
7463
if(isScala3(crossScalaVersion)) Agg.empty[Dep]
7564
else Agg(ivy"org.scala-lang:scala-reflect:$crossScalaVersion")
@@ -114,87 +103,77 @@ trait FastparseModule extends CommonCrossModule with Mima{
114103
.getOrElse(throw new Exception("Missing last tag"))
115104
)
116105

117-
def mimaPreviousArtifacts = if (isScala3(crossScalaVersion)) Agg.empty[Dep] else super.mimaPreviousArtifacts()
106+
def mimaPreviousArtifacts =
107+
if (isScala3(crossScalaVersion)) Agg.empty[Dep]
108+
else super.mimaPreviousArtifacts()
118109

119110
def mimaBinaryIssueFilters = super.mimaBinaryIssueFilters() ++ Seq(
120111
ProblemFilter.exclude[IncompatibleResultTypeProblem]("fastparse.Parsed#Failure.unapply")
121112
)
122113
}
123114

124115
object scalaparse extends Module{
125-
object js extends Cross[ScalaParseJsModule](crossJsVersions:_*)
126-
class ScalaParseJsModule(val crossScalaVersion: String, val crossScalaJsVersion: String) extends ExampleParseJsModule
116+
object js extends Cross[ScalaParseJsModule](crossVersions)
117+
trait ScalaParseJsModule extends ExampleParseJsModule
127118

128-
object jvm extends Cross[ScalaParseJvmModule](crossVersions:_*)
129-
class ScalaParseJvmModule(val crossScalaVersion: String) extends ExampleParseJvmModule
119+
object jvm extends Cross[ScalaParseJvmModule](crossVersions)
120+
trait ScalaParseJvmModule extends ExampleParseJvmModule
130121

131-
object native extends Cross[ScalaParseNativeModule](crossNativeVersions:_*)
132-
class ScalaParseNativeModule(val crossScalaVersion: String, val crossScalaNativeVersion: String) extends ExampleParseNativeModule
122+
object native extends Cross[ScalaParseNativeModule](crossVersions)
123+
trait ScalaParseNativeModule extends ExampleParseNativeModule
133124
}
134125

135126
object cssparse extends Module{
136-
object js extends Cross[CssParseJsModule](crossJsVersions:_*)
137-
class CssParseJsModule(val crossScalaVersion: String, val crossScalaJsVersion: String) extends ExampleParseJsModule
127+
object js extends Cross[CssParseJsModule](crossVersions)
128+
trait CssParseJsModule extends ExampleParseJsModule
138129

139-
object jvm extends Cross[CssParseJvmModule](crossVersions:_*)
140-
class CssParseJvmModule(val crossScalaVersion: String) extends ExampleParseJvmModule
130+
object jvm extends Cross[CssParseJvmModule](crossVersions)
131+
trait CssParseJvmModule extends ExampleParseJvmModule
141132

142-
object native extends Cross[CssParseNativeModule](crossNativeVersions:_*)
143-
class CssParseNativeModule(val crossScalaVersion: String, val crossScalaNativeVersion: String) extends ExampleParseNativeModule
133+
object native extends Cross[CssParseNativeModule](crossVersions)
134+
trait CssParseNativeModule extends ExampleParseNativeModule
144135
}
145136

146137
object pythonparse extends Module{
147-
object js extends Cross[PythonParseJsModule](crossJsVersions:_*)
148-
class PythonParseJsModule(val crossScalaVersion: String, val crossScalaJsVersion: String) extends ExampleParseJsModule
138+
object js extends Cross[PythonParseJsModule](crossVersions)
139+
trait PythonParseJsModule extends ExampleParseJsModule
149140

150-
object jvm extends Cross[PythonParseJvmModule](crossVersions:_*)
151-
class PythonParseJvmModule(val crossScalaVersion: String) extends ExampleParseJvmModule
141+
object jvm extends Cross[PythonParseJvmModule](crossVersions)
142+
trait PythonParseJvmModule extends ExampleParseJvmModule
152143

153-
object native extends Cross[PythonParseNativeModule](crossNativeVersions:_*)
154-
class PythonParseNativeModule(val crossScalaVersion: String, val crossScalaNativeVersion: String) extends ExampleParseNativeModule
144+
object native extends Cross[PythonParseNativeModule](crossVersions)
145+
trait PythonParseNativeModule extends ExampleParseNativeModule
155146
}
156147

157148
trait ExampleParseJsModule extends CommonCrossModule with ScalaJSModule{
158-
def moduleDeps = Seq(fastparse.js(crossScalaVersion, crossScalaJsVersion))
159-
def crossScalaJsVersion: String
160-
def scalaJSVersion = crossScalaJsVersion
161-
def platformSegment = "js"
162-
def millSourcePath = super.millSourcePath / os.up
163-
object test extends Tests with CommonTestModule{
164-
def platformSegment = "js"
165-
}
166-
}
149+
def moduleDeps = Seq(fastparse.js())
150+
def scalaJSVersion = scalaJS1
167151

152+
object test extends ScalaJSModuleTests with CommonTestModule
153+
}
168154

169155
trait ExampleParseJvmModule extends CommonCrossModule{
170156
def moduleDeps = Seq(fastparse.jvm())
171-
def platformSegment = "jvm"
172-
object test extends Tests with CommonTestModule{
173-
def platformSegment = "jvm"
157+
158+
object test extends ScalaModuleTests with CommonTestModule{
174159
def ivyDeps = super.ivyDeps() ++ Agg(
175160
ivy"net.sourceforge.cssparser:cssparser:0.9.18",
176-
) ++ (if (isScala3(crossScalaVersion)) Agg.empty[Dep] else Agg(ivy"org.scala-lang:scala-compiler:$crossScalaVersion"))
161+
) ++ Agg.when(!isScala3(crossScalaVersion))(
162+
ivy"org.scala-lang:scala-compiler:$crossScalaVersion"
163+
)
177164
}
178165
}
179166

180167
trait ExampleParseNativeModule extends CommonCrossModule with ScalaNativeModule{
181-
def platformSegment = "native"
182-
def crossScalaNativeVersion: String
183-
def scalaNativeVersion = crossScalaNativeVersion
184-
def millSourcePath = super.millSourcePath / os.up
185-
def moduleDeps = Seq(fastparse.native(crossScalaVersion, crossScalaNativeVersion))
186-
object test extends Tests with CommonTestModule{
187-
def platformSegment = "native"
188-
}
189-
}
168+
def scalaNativeVersion = scalaNative04
169+
def moduleDeps = Seq(fastparse.native())
190170

171+
object test extends ScalaNativeModuleTests with CommonTestModule
172+
}
191173

192-
193-
trait CommonCrossModule extends CrossScalaModule with PublishModule {
194-
174+
trait CommonCrossModule extends CrossScalaModule with PublishModule with PlatformScalaModule{
195175
def publishVersion = VcsVersion.vcsState().format()
196176

197-
def artifactName = millModuleSegments.parts.dropRight(2).mkString("-").stripSuffix(s"-$platformSegment")
198177
def pomSettings = PomSettings(
199178
description = artifactName(),
200179
organization = "com.lihaoyi",
@@ -210,42 +189,25 @@ trait CommonCrossModule extends CrossScalaModule with PublishModule {
210189
)
211190

212191
def scalaDocPluginClasspath = T{ Agg[PathRef]() }
213-
// def scalacOptions = T{ if (scalaVersion() == "2.12.10") Seq("-opt:l:method") else Nil }
214192

215-
def platformSegment: String
216-
def millSourcePath = super.millSourcePath / os.up
217193
def sources = T.sources {
218-
super.sources()
219-
.flatMap{p => Seq(p, PathRef(p.path / os.up / s"${p.path.last}-$platformSegment")) } ++
220-
(if (scalaVersion() != scala211) {
221-
Seq(PathRef(millSourcePath / "src-2.12+"))
222-
} else Seq())
194+
super.sources() ++
195+
Agg.when(scalaVersion() != scala211)(PathRef(millSourcePath / "src-2.12+"))
223196
}
224197
}
225-
trait CommonTestModule extends ScalaModule with TestModule.Utest{
226198

227-
def platformSegment: String
228-
def ivyDeps = Agg(
229-
ivy"com.lihaoyi::utest::0.8.1",
230-
)
231-
override def scalacOptions = super.scalacOptions() ++
232-
(if (scalaVersion() == scala213) Seq("-Xfatal-warnings", "-Wconf:cat=feature:s,cat=deprecation:s") else Nil)
199+
trait CommonTestModule extends ScalaModule with TestModule.Utest{
200+
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.8.1")
233201

234-
def sources = T.sources {
235-
super.sources().flatMap { p => Seq(p, PathRef(p.path / os.up / s"${p.path.last}-$platformSegment")) }
236-
}
202+
override def scalacOptions =
203+
super.scalacOptions() ++
204+
Agg.when(scalaVersion() == scala213)(
205+
"-Xfatal-warnings",
206+
"-Wconf:cat=feature:s,cat=deprecation:s"
207+
)
237208
}
238209

239210
object perftests extends Module{
240-
object bench1 extends PerfTestModule {
241-
def scalaVersion0 = scala213
242-
def ivyDeps = super.ivyDeps() ++ Agg(
243-
ivy"com.lihaoyi::scalaparse:1.0.0",
244-
ivy"com.lihaoyi::pythonparse:1.0.0",
245-
ivy"com.lihaoyi::cssparse:1.0.0",
246-
)
247-
}
248-
249211
object bench2 extends PerfTestModule {
250212
def scalaVersion0 = scala213
251213
def moduleDeps = Seq(
@@ -254,7 +216,6 @@ object perftests extends Module{
254216
cssparse.jvm(scala213).test,
255217
fastparse.jvm(scala213).test,
256218
)
257-
258219
}
259220

260221
object benchScala3 extends PerfTestModule {
@@ -266,17 +227,16 @@ object perftests extends Module{
266227
cssparse.jvm(scala31).test,
267228
fastparse.jvm(scala31).test,
268229
)
269-
270230
}
271231

272-
273232
object compare extends PerfTestModule {
274-
def scalaVersion0 = scala213
233+
def scalaVersion0 = scala212
275234
def moduleDeps = Seq(
276235
fastparse.jvm(scala212).test,
277236
scalaparse.jvm(scala212).test,
278237
pythonparse.jvm(scala212).test
279238
)
239+
280240
def ivyDeps = super.ivyDeps() ++ Agg(
281241
ivy"org.json4s::json4s-ast:3.6.0",
282242
ivy"org.json4s::json4s-native:3.6.0",
@@ -299,22 +259,21 @@ object perftests extends Module{
299259
Seq(PathRef(perftests.millSourcePath / "resources")) ++
300260
fastparse.jvm(scalaVersion0).test.resources()
301261
}
302-
def ivyDeps = Agg(
303-
ivy"com.lihaoyi::utest::0.8.1",
304-
// ivy"org.scala-lang:scala-compiler:${scalaVersion()}"
305-
)
262+
263+
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.8.1")
306264
}
307265
}
308266

309267
object demo extends ScalaJSModule{
310268
def scalaJSVersion = scalaJS1
311269
def scalaVersion = scala213
312270
def moduleDeps = Seq(
313-
scalaparse.js(scala213, scalaJS1),
314-
cssparse.js(scala213, scalaJS1),
315-
pythonparse.js(scala213, scalaJS1),
316-
fastparse.js(scala213, scalaJS1).test,
271+
scalaparse.js(scala213),
272+
cssparse.js(scala213),
273+
pythonparse.js(scala213),
274+
fastparse.js(scala213).test,
317275
)
276+
318277
def ivyDeps = Agg(
319278
ivy"org.scala-js::scalajs-dom::0.9.8",
320279
ivy"com.lihaoyi::scalatags::0.9.3"

fastparse/test/src-2.12+/fastparse/CustomWhitespaceMathTests.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import utest._
88
*/
99
object CustomWhitespaceMathTests extends TestSuite{
1010
implicit object whitespace extends Whitespace{
11-
def apply(implicit ctx: P[_]): P[Unit] = {
11+
def apply(ctx: fastparse.ParsingRun[_]): P[Unit] = {
12+
implicit val ctx0 = ctx
1213
CharsWhileIn(" \t", 0)
1314
}
1415
}

mill

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
set -e
88

99
if [ -z "${DEFAULT_MILL_VERSION}" ] ; then
10-
DEFAULT_MILL_VERSION=0.10.10
10+
DEFAULT_MILL_VERSION=0.11.1
1111
fi
1212

1313
if [ -z "$MILL_VERSION" ] ; then

scalaparse/test/src/scalaparse/TestUtil.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ object TestUtil {
6868

6969
def check[T](input: String, tag: String = "", skipIterator: Boolean = false) = {
7070
println("Checking...\n" )
71-
println(input)
71+
// println(input)
7272
check0(input, input.length, tag)
7373
if (!skipIterator) {
7474
for(chunkSize <- Seq(1, 5, 18, 67, 260, 1029)) {

0 commit comments

Comments
 (0)