From 22f4527b9b3f77790dd5685fcce626f3c1b71c38 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Thu, 11 Aug 2022 08:49:38 +0200 Subject: [PATCH] refactor: ensure everything works with all 0.10.x --- README.md | 2 +- build.sc | 3 +-- .../mill/github/dependency/graph/Resolver.scala | 13 ++----------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e76da19..6fe6e96 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The main benifits of doing this are: ## Requirements -- Right now this plugin requires **at least Mill 0.10.3**. +- Right now this plugin only supports the **Mill 0.10.x series**. - Make sure in your repo settings the Dependency Graph feature is enabled as well as Dependabot Alerts if you'd like them. (Settings -> Code security and analysis) diff --git a/build.sc b/build.sc index 1cbad5c..1f38ca8 100644 --- a/build.sc +++ b/build.sc @@ -15,8 +15,7 @@ import mill.scalalib.api.Util.scalaNativeBinaryVersion import de.tobiasroeser.mill.integrationtest._ import de.tobiasroeser.mill.vcs.version.VcsVersion -// TODO Should probably drop this to 0.10.0, but when I did a bunch of stuff breaks -val millVersion = "0.10.3" +val millVersion = "0.10.0" val scala213 = "2.13.8" val artifactBase = "mill-github-dependency-graph" diff --git a/plugin/src/io/kipp/mill/github/dependency/graph/Resolver.scala b/plugin/src/io/kipp/mill/github/dependency/graph/Resolver.scala index 49172af..c404809 100644 --- a/plugin/src/io/kipp/mill/github/dependency/graph/Resolver.scala +++ b/plugin/src/io/kipp/mill/github/dependency/graph/Resolver.scala @@ -6,7 +6,6 @@ import mill.eval.Evaluator import mill.scalalib.Dep import mill.scalalib.JavaModule import mill.scalalib.Lib -import mill.scalalib.internal.ModuleUtils /** Utils to help find all your modules and resolve their dependencies. */ @@ -33,7 +32,6 @@ object Resolver { val repos = javaModule.repositoriesTask() val mapDeps = javaModule.mapDependencies() val custom = javaModule.resolutionCustomizer() - val cacheCustom = javaModule.coursierCacheCustomizer() val (dependencies, resolution) = Lib.resolveDependenciesMetadata( @@ -42,7 +40,6 @@ object Resolver { deps = deps, mapDependencies = Some(mapDeps), customizer = custom, - coursierCacheCustomizer = cacheCustom, ctx = Some(T.log) ) @@ -57,12 +54,6 @@ object Resolver { } } - /** Quick and dirty, give me all the JavaModules. - */ - private[graph] def computeModules(ev: Evaluator): Seq[JavaModule] = { - ModuleUtils - .transitiveModules(ev.rootModule) - .collect { case jm: JavaModule => jm } - } - + private[graph] def computeModules(ev: Evaluator) = + ev.rootModule.millInternal.modules.collect { case j: JavaModule => j } }