diff --git a/contrib/scoverage/src/mill/contrib/scoverage/ScoverageModule.scala b/contrib/scoverage/src/mill/contrib/scoverage/ScoverageModule.scala index 121899d8bb3..e6514e80e3d 100644 --- a/contrib/scoverage/src/mill/contrib/scoverage/ScoverageModule.scala +++ b/contrib/scoverage/src/mill/contrib/scoverage/ScoverageModule.scala @@ -125,8 +125,7 @@ trait ScoverageModule extends ScalaModule { outer: ScalaModule => millProjectModule( workerArtifact, - repositoriesTask(), - resolveFilter = _.toString.contains(workerArtifact) + repositoriesTask() ) } diff --git a/kotlinlib/src/mill/kotlinlib/KotlinModule.scala b/kotlinlib/src/mill/kotlinlib/KotlinModule.scala index 5ce0f2c6483..826148265d6 100644 --- a/kotlinlib/src/mill/kotlinlib/KotlinModule.scala +++ b/kotlinlib/src/mill/kotlinlib/KotlinModule.scala @@ -88,8 +88,7 @@ trait KotlinModule extends JavaModule { outer => private[kotlinlib] def kotlinWorkerClasspath = Task { millProjectModule( "mill-kotlinlib-worker-impl", - repositoriesTask(), - resolveFilter = _.toString.contains("mill-kotlinlib-worker-impl") + repositoriesTask() ) } diff --git a/main/util/src/mill/util/CoursierSupport.scala b/main/util/src/mill/util/CoursierSupport.scala index 083d7f2216c..4c53ac7172d 100644 --- a/main/util/src/mill/util/CoursierSupport.scala +++ b/main/util/src/mill/util/CoursierSupport.scala @@ -52,6 +52,10 @@ trait CoursierSupport { * We do not bother breaking this out into the separate ZincWorkerApi classpath, * because Coursier is already bundled with mill/Ammonite to support the * `import $ivy` syntax. + * + * Avoid using `deprecatedResolveFilter` if you can. As a substitute, use exclusions + * (or upfront, mark some dependencies as provided aka compile-time when you publish them), + * or as a last resort, manually filter the file sequence returned by this function. */ def resolveDependencies( repositories: Seq[Repository], @@ -62,7 +66,7 @@ trait CoursierSupport { customizer: Option[Resolution => Resolution] = None, ctx: Option[mill.api.Ctx.Log] = None, coursierCacheCustomizer: Option[FileCache[Task] => FileCache[Task]] = None, - resolveFilter: os.Path => Boolean = _ => true, + deprecatedResolveFilter: os.Path => Boolean = _ => true, artifactTypes: Option[Set[Type]] = None, resolutionParams: ResolutionParams = ResolutionParams() ): Result[Agg[PathRef]] = { @@ -108,7 +112,7 @@ trait CoursierSupport { Agg.from( res.files .map(os.Path(_)) - .filter(resolveFilter) + .filter(deprecatedResolveFilter) .map(PathRef(_, quick = true)) ) ++ localTestDeps.flatten ) @@ -126,7 +130,7 @@ trait CoursierSupport { customizer: Option[Resolution => Resolution], ctx: Option[mill.api.Ctx.Log], coursierCacheCustomizer: Option[FileCache[Task] => FileCache[Task]], - resolveFilter: os.Path => Boolean, + deprecatedResolveFilter: os.Path => Boolean, artifactTypes: Option[Set[Type]] ): Result[Agg[PathRef]] = resolveDependencies( @@ -138,7 +142,7 @@ trait CoursierSupport { customizer, ctx, coursierCacheCustomizer, - resolveFilter, + deprecatedResolveFilter, artifactTypes, ResolutionParams() ) @@ -153,7 +157,7 @@ trait CoursierSupport { customizer: Option[Resolution => Resolution], ctx: Option[mill.api.Ctx.Log], coursierCacheCustomizer: Option[FileCache[Task] => FileCache[Task]], - resolveFilter: os.Path => Boolean + deprecatedResolveFilter: os.Path => Boolean ): Result[Agg[PathRef]] = resolveDependencies( repositories, @@ -164,8 +168,7 @@ trait CoursierSupport { customizer, ctx, coursierCacheCustomizer, - resolveFilter, - None + deprecatedResolveFilter ) @deprecated( diff --git a/main/util/src/mill/util/Util.scala b/main/util/src/mill/util/Util.scala index 9b7cdc60e7d..ddd51ca7827 100644 --- a/main/util/src/mill/util/Util.scala +++ b/main/util/src/mill/util/Util.scala @@ -73,7 +73,7 @@ object Util { def millProjectModule( artifact: String, repositories: Seq[Repository], - resolveFilter: os.Path => Boolean = _ => true, + deprecatedResolveFilter: os.Path => Boolean = _ => true, // this should correspond to the mill runtime Scala version artifactSuffix: String = "_2.13" ): Result[Agg[PathRef]] = { @@ -90,7 +90,7 @@ object Util { ) ), force = Nil, - resolveFilter = resolveFilter + deprecatedResolveFilter = deprecatedResolveFilter ).map(_.map(_.withRevalidateOnce)) } diff --git a/scalajslib/src/mill/scalajslib/ScalaJSModule.scala b/scalajslib/src/mill/scalajslib/ScalaJSModule.scala index 6ecd5dc2253..3164ff532d4 100644 --- a/scalajslib/src/mill/scalajslib/ScalaJSModule.scala +++ b/scalajslib/src/mill/scalajslib/ScalaJSModule.scala @@ -52,8 +52,7 @@ trait ScalaJSModule extends scalalib.ScalaModule { outer => def scalaJSWorkerClasspath = Task { mill.util.Util.millProjectModule( artifact = s"mill-scalajslib-worker-${scalaJSWorkerVersion()}", - repositories = repositoriesTask(), - resolveFilter = _.toString.contains("mill-scalajslib-worker") + repositories = repositoriesTask() ) } diff --git a/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala b/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala index 3eb6e84def0..892fadfbc00 100644 --- a/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala +++ b/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala @@ -52,8 +52,7 @@ trait ScalaNativeModule extends ScalaModule { outer => def scalaNativeWorkerClasspath = Task { millProjectModule( s"mill-scalanativelib-worker-${scalaNativeWorkerVersion()}", - repositoriesTask(), - resolveFilter = _.toString.contains("mill-scalanativelib-worker") + repositoriesTask() ) }