Skip to content

Commit 7112ae1

Browse files
committed
use mill-moduledefs 0.11.0-M1 (with scala 3 port)
1 parent dc71022 commit 7112ae1

File tree

9 files changed

+18
-98
lines changed

9 files changed

+18
-98
lines changed

build.sc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ object Deps {
174174
val osLib = ivy"com.lihaoyi::os-lib:0.10.3"
175175
val pprint = ivy"com.lihaoyi::pprint:0.9.0"
176176
val mainargs = ivy"com.lihaoyi::mainargs:0.7.2"
177-
val millModuledefsVersion = "0.10.9"
177+
val millModuledefsVersion = "0.11.0-M1"
178178
val millModuledefsString = s"com.lihaoyi::mill-moduledefs:${millModuledefsVersion}"
179179
val millModuledefs = ivy"${millModuledefsString}"
180180
val millModuledefsPlugin =
@@ -422,11 +422,11 @@ trait MillScalaModule extends ScalaModule with MillJavaModule with ScalafixModul
422422
def scalacPluginIvyDeps =
423423
super.scalacPluginIvyDeps() ++
424424
Agg.when(!scalaVersion().startsWith("3."))(Deps.acyclic) ++
425-
Agg.when(scalaVersion().startsWith("2.13."))(Deps.millModuledefsPlugin)
425+
Agg(Deps.millModuledefsPlugin)
426426

427427
def mandatoryIvyDeps =
428428
super.mandatoryIvyDeps() ++
429-
Agg.when(scalaVersion().startsWith("2.13."))(Deps.millModuledefs)
429+
Agg(Deps.millModuledefs)
430430

431431
/** Default tests module. */
432432
lazy val test: MillScalaTests = new MillScalaTests {}
@@ -761,7 +761,7 @@ object main extends MillStableScalaModule with BuildInfo {
761761
if (scalaVersion().startsWith("3.")) Agg.empty else Agg(Deps.scalaReflect(scalaVersion()))
762762
}
763763
def ivyDeps = Agg(
764-
// Deps.millModuledefs, // TODO: port moduledefs to Scala 3
764+
Deps.millModuledefs,
765765
// Necessary so we can share the JNA classes throughout the build process
766766
Deps.jna,
767767
Deps.jnaPlatform,

contrib/buildinfo/src/mill/contrib/buildinfo/BuildInfo.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ trait BuildInfo extends JavaModule {
3535
*/
3636
def buildInfoMembers: T[Seq[BuildInfo.Value]] = Seq.empty[BuildInfo.Value]
3737

38-
// TODO: remove override when mill-moduledefs is ported to Scala 3
39-
override def resources: T[Seq[PathRef]] =
38+
def resources: T[Seq[PathRef]] =
4039
if (buildInfoStaticCompiled) super.resources
4140
else T.sources { super.resources() ++ Seq(buildInfoResources()) }
4241

main/define/src/mill/moduledefs/Cacher.scala

Lines changed: 0 additions & 68 deletions
This file was deleted.

main/define/src/mill/moduledefs/Scaladoc.java

Lines changed: 0 additions & 10 deletions
This file was deleted.

main/util/src/mill/util/Util.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ object Util {
7979
repositories: Seq[Repository],
8080
resolveFilter: os.Path => Boolean = _ => true,
8181
// this should correspond to the mill runtime Scala version
82-
artifactSuffix: String = "_2.13"
82+
artifactSuffix: String = "_3"
8383
): Result[Agg[PathRef]] = {
8484

8585
mill.util.Jvm.resolveDependencies(

runner/src/mill/runner/MillBuildRootModule.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ class MillBuildRootModule()(implicit
9696
Agg.from(
9797
MillIvy.processMillIvyDepSignature(parseBuildFiles().ivyDeps)
9898
.map(mill.scalalib.Dep.parse)
99-
) /*++
100-
Agg(ivy"com.lihaoyi::mill-moduledefs:${Versions.millModuledefsVersion}")*/
99+
) ++
100+
Agg(ivy"com.lihaoyi::mill-moduledefs:${Versions.millModuledefsVersion}")
101101
}
102102

103103
override def runIvyDeps = T {
@@ -247,7 +247,7 @@ class MillBuildRootModule()(implicit
247247
}
248248

249249
override def scalacPluginIvyDeps: T[Agg[Dep]] = Agg(
250-
// ivy"com.lihaoyi:::scalac-mill-moduledefs-plugin:${Versions.millModuledefsVersion}"
250+
ivy"com.lihaoyi:::scalac-mill-moduledefs-plugin:${Versions.millModuledefsVersion}"
251251
)
252252

253253
override def scalacOptions: T[Seq[String]] = T {

scalalib/src/mill/scalalib/JavaModule.scala

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ trait JavaModule
3535
with BspModule
3636
with SemanticDbJavaModule { outer =>
3737

38-
override def zincWorker: ModuleRef[ZincWorkerModule] = super.zincWorker // TODO: remove override with mill-moduledefs
38+
def zincWorker: ModuleRef[ZincWorkerModule] = super.zincWorker
3939
type JavaTests = JavaModuleTests
4040
@deprecated("Use JavaTests instead", since = "Mill 0.11.10")
4141
trait JavaModuleTests extends JavaModule with TestModule {
@@ -96,9 +96,9 @@ trait JavaModule
9696
* If none is specified, the classpath is searched for an appropriate main
9797
* class to use if one exists
9898
*/
99-
override def mainClass: T[Option[String]] = None // TODO: remove override with mill-moduledefs
99+
def mainClass: T[Option[String]] = None
100100

101-
override def finalMainClassOpt: T[Either[String, String]] = T { // TODO: remove override with mill-moduledefs
101+
def finalMainClassOpt: T[Either[String, String]] = T {
102102
mainClass() match {
103103
case Some(m) => Right(m)
104104
case None =>
@@ -114,7 +114,7 @@ trait JavaModule
114114
}
115115
}
116116

117-
override def finalMainClass: T[String] = T { // TODO: remove override with mill-moduledefs
117+
def finalMainClass: T[String] = T {
118118
finalMainClassOpt() match {
119119
case Right(main) => Result.Success(main)
120120
case Left(msg) => Result.Failure(msg)
@@ -132,7 +132,7 @@ trait JavaModule
132132
* ivy"org::name:version" for Scala dependencies or ivy"org:name:version"
133133
* for Java dependencies
134134
*/
135-
override def ivyDeps: T[Agg[Dep]] = T { Agg.empty[Dep] } // TODO: remove override with mill-moduledefs
135+
def ivyDeps: T[Agg[Dep]] = T { Agg.empty[Dep] }
136136

137137
/**
138138
* Aggregation of mandatoryIvyDeps and ivyDeps.
@@ -362,8 +362,7 @@ trait JavaModule
362362
* The folders where the resource files for this module live.
363363
* If you need resources to be seen by the compiler, use [[compileResources]].
364364
*/
365-
// TODO: remove override when mill-moduledefs is ported to scala 3
366-
override def resources: T[Seq[PathRef]] = T.sources { millSourcePath / "resources" }
365+
def resources: T[Seq[PathRef]] = T.sources { millSourcePath / "resources" }
367366

368367
/**
369368
* The folders where the compile time resource files for this module live.

scalalib/src/mill/scalalib/ScalaModule.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ trait ScalaModule extends JavaModule with TestModule.ScalaModuleBase { outer =>
175175
*/
176176
private def enablePluginScalacOptions: Target[Seq[String]] = T {
177177

178-
val resolvedJars = defaultResolver().resolveDeps(
178+
val resolvedJars = defaultResolver().resolveDeps0(
179179
scalacPluginIvyDeps().map(_.exclude("*" -> "*"))
180180
)
181-
resolvedJars.iterator.map(jar => s"-Xplugin:${jar.path}").toSeq
181+
resolvedJars.map(_.iterator.map(jar => s"-Xplugin:${jar.path}").toSeq)
182182
}
183183

184184
/**

scalalib/src/mill/scalalib/ZincWorkerModule.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object ZincWorkerModule extends ExternalModule with ZincWorkerModule with Coursi
2424
trait ZincWorkerModule extends mill.Module with OfflineSupportModule { self: CoursierModule =>
2525

2626
def classpath: T[Agg[PathRef]] = T {
27-
millProjectModule("mill-scalalib-worker", repositoriesTask(), artifactSuffix = "_3")
27+
millProjectModule("mill-scalalib-worker", repositoriesTask())
2828
}
2929

3030
def scalalibClasspath: T[Agg[PathRef]] = T {

0 commit comments

Comments
 (0)