From 06f07c2544ba8df12072b6aa6879fce0fc65a531 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Thu, 21 Sep 2023 18:58:40 +0200 Subject: [PATCH] Clean unused imports (#2776) Pull request: https://github.com/com-lihaoyi/mill/pull/2776 --- bsp/src/mill/bsp/BspContext.scala | 3 +-- bsp/src/mill/bsp/BspWorker.scala | 3 +-- .../src/mill/contrib/versionfile/VersionFileModule.scala | 1 - main/api/src/mill/api/IO.scala | 2 -- main/api/src/mill/api/PathRef.scala | 2 -- main/define/src/mill/define/Applicative.scala | 3 +-- main/define/src/mill/define/Cross.scala | 1 - main/define/src/mill/define/Ctx.scala | 2 -- main/define/src/mill/define/Module.scala | 1 - main/define/src/mill/define/Task.scala | 2 +- main/eval/src/mill/eval/Evaluator.scala | 2 +- main/eval/src/mill/eval/EvaluatorPaths.scala | 2 +- main/eval/test/src/mill/eval/CrossTests.scala | 2 +- .../src/mill/resolve/ResolveNotFoundHandler.scala | 3 +-- .../resolve/src/mill/resolve/SimpleTaskTokenReader.scala | 2 +- main/src/mill/main/MainModule.scala | 2 +- main/src/mill/main/RootModule.scala | 5 +---- main/test/src/mill/UTestFramework.scala | 6 ++---- main/test/src/mill/util/TestEvaluator.scala | 8 +++++--- main/testkit/src/mill/testkit/MillTestkit.scala | 2 -- main/util/src/mill/util/Classpath.scala | 4 ---- main/util/src/mill/util/Jvm.scala | 9 +-------- main/util/src/mill/util/PrintLogger.scala | 4 +--- main/util/src/mill/util/Util.scala | 2 +- runner/src/mill/runner/MillMain.scala | 2 +- runner/src/mill/runner/RunnerState.scala | 2 +- scalajslib/src/mill/scalajslib/ScalaJSModule.scala | 2 -- scalajslib/test/src/mill/scalajslib/SourceMapTests.scala | 1 - .../1/src/mill/scalajslib/worker/jsenv/Phantom.scala | 1 - scalalib/src/mill/scalalib/Dependency.scala | 1 - scalalib/src/mill/scalalib/JsonFormatters.scala | 2 -- scalalib/src/mill/scalalib/Lib.scala | 2 +- scalalib/src/mill/scalalib/PublishModule.scala | 4 +--- scalalib/src/mill/scalalib/ScalaModule.scala | 1 - scalalib/src/mill/scalalib/SemanticDbJavaModule.scala | 2 +- .../dependency/updates/ModuleDependenciesUpdates.scala | 1 - .../scalalib/dependency/versions/VersionsFinder.scala | 6 ++---- .../src/mill/scalalib/internal/JavaModuleUtils.scala | 2 +- scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala | 1 - .../src/mill/scalalib/publish/SonatypePublisher.scala | 1 - .../src/mill/scalanativelib/ScalaNativeModule.scala | 4 ---- .../mill/scalanativelib/worker/ScalaNativeWorker.scala | 4 ---- .../src/mill/scalanativelib/HelloNativeWorldTests.scala | 4 ++-- .../scalanativelib/worker/api/ScalaNativeWorkerApi.scala | 1 - 44 files changed, 31 insertions(+), 86 deletions(-) diff --git a/bsp/src/mill/bsp/BspContext.scala b/bsp/src/mill/bsp/BspContext.scala index 6b289eef227..4755c765a13 100644 --- a/bsp/src/mill/bsp/BspContext.scala +++ b/bsp/src/mill/bsp/BspContext.scala @@ -1,7 +1,6 @@ package mill.bsp -import mill.api.{DummyInputStream, Logger, SystemStreams, internal} -import mill.eval.Evaluator +import mill.api.{DummyInputStream, Logger, SystemStreams} import java.io.PrintStream import scala.util.control.NonFatal diff --git a/bsp/src/mill/bsp/BspWorker.scala b/bsp/src/mill/bsp/BspWorker.scala index 333b43aa27d..c8c435c6f18 100644 --- a/bsp/src/mill/bsp/BspWorker.scala +++ b/bsp/src/mill/bsp/BspWorker.scala @@ -1,7 +1,6 @@ package mill.bsp -import mill.api.{Ctx, Logger, SystemStreams, internal} -import mill.eval.Evaluator +import mill.api.{Ctx, Logger, SystemStreams} import os.Path import java.io.PrintStream diff --git a/contrib/versionfile/src/mill/contrib/versionfile/VersionFileModule.scala b/contrib/versionfile/src/mill/contrib/versionfile/VersionFileModule.scala index b91b45dc546..995f0652eea 100644 --- a/contrib/versionfile/src/mill/contrib/versionfile/VersionFileModule.scala +++ b/contrib/versionfile/src/mill/contrib/versionfile/VersionFileModule.scala @@ -64,7 +64,6 @@ trait VersionFileModule extends Module { case snapshot: Version.Snapshot => s"Setting next version to $version" } - import upickle.core._ import upickle.default._ implicit val shellableReadWriter: ReadWriter[os.Shellable] = diff --git a/main/api/src/mill/api/IO.scala b/main/api/src/mill/api/IO.scala index d299ba303c6..9c2e3cba0ab 100644 --- a/main/api/src/mill/api/IO.scala +++ b/main/api/src/mill/api/IO.scala @@ -1,7 +1,5 @@ package mill.api -import java.io.{InputStream, OutputStream} - /** * Misc IO utilities, eventually probably should be pushed upstream into * ammonite-ops diff --git a/main/api/src/mill/api/PathRef.scala b/main/api/src/mill/api/PathRef.scala index 39ecebf6760..d31a07ed48a 100644 --- a/main/api/src/mill/api/PathRef.scala +++ b/main/api/src/mill/api/PathRef.scala @@ -6,8 +6,6 @@ import java.util.concurrent.ConcurrentHashMap import scala.util.{DynamicVariable, Using} import upickle.default.{ReadWriter => RW} -import scala.runtime.ScalaRunTime - /** * A wrapper around `os.Path` that calculates it's hashcode based * on the contents of the filesystem underneath it. Used to ensure filesystem diff --git a/main/define/src/mill/define/Applicative.scala b/main/define/src/mill/define/Applicative.scala index 1ba368a12f0..7c88ebef9cc 100644 --- a/main/define/src/mill/define/Applicative.scala +++ b/main/define/src/mill/define/Applicative.scala @@ -2,8 +2,7 @@ package mill.define import mill.api.internal -import scala.annotation.{StaticAnnotation, compileTimeOnly} -import scala.language.higherKinds +import scala.annotation.compileTimeOnly import scala.reflect.macros.blackbox.Context /** diff --git a/main/define/src/mill/define/Cross.scala b/main/define/src/mill/define/Cross.scala index 737d56d381a..746f48c8ae7 100644 --- a/main/define/src/mill/define/Cross.scala +++ b/main/define/src/mill/define/Cross.scala @@ -3,7 +3,6 @@ package mill.define import mill.api.Lazy import language.experimental.macros -import scala.collection.SeqView import scala.reflect.ClassTag import scala.reflect.macros.blackbox diff --git a/main/define/src/mill/define/Ctx.scala b/main/define/src/mill/define/Ctx.scala index 1c88ed3c17b..4d6c5fbe41e 100644 --- a/main/define/src/mill/define/Ctx.scala +++ b/main/define/src/mill/define/Ctx.scala @@ -1,7 +1,5 @@ package mill.define -import os.Path - import scala.annotation.implicitNotFound /** diff --git a/main/define/src/mill/define/Module.scala b/main/define/src/mill/define/Module.scala index 0883899e949..fb03f9879f2 100644 --- a/main/define/src/mill/define/Module.scala +++ b/main/define/src/mill/define/Module.scala @@ -2,7 +2,6 @@ package mill.define import mill.api.internal -import scala.language.experimental.macros import scala.reflect.ClassTag /** diff --git a/main/define/src/mill/define/Task.scala b/main/define/src/mill/define/Task.scala index 7a94d6d6c72..7b2a949aa22 100644 --- a/main/define/src/mill/define/Task.scala +++ b/main/define/src/mill/define/Task.scala @@ -2,7 +2,7 @@ package mill.define import mill.api.{CompileProblemReporter, Logger, PathRef, Result, TestReporter} import mill.define.Applicative.Applyable -import upickle.default.{ReadWriter => RW, Reader => R, Writer => W} +import upickle.default.{ReadWriter => RW, Writer => W} import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context diff --git a/main/eval/src/mill/eval/Evaluator.scala b/main/eval/src/mill/eval/Evaluator.scala index 2c4cfdca4bd..c89048b92ee 100644 --- a/main/eval/src/mill/eval/Evaluator.scala +++ b/main/eval/src/mill/eval/Evaluator.scala @@ -2,7 +2,7 @@ package mill.eval import mill.api.{CompileProblemReporter, DummyTestReporter, Result, TestReporter, Val} import mill.api.Strict.Agg -import mill.define.{BaseModule, NamedTask, Segments, Task} +import mill.define.{BaseModule, Segments, Task} import mill.eval.Evaluator.{Results, formatFailing} import mill.util.{ColorLogger, MultiBiMap} diff --git a/main/eval/src/mill/eval/EvaluatorPaths.scala b/main/eval/src/mill/eval/EvaluatorPaths.scala index 04f22cc6b8a..b1516a10453 100644 --- a/main/eval/src/mill/eval/EvaluatorPaths.scala +++ b/main/eval/src/mill/eval/EvaluatorPaths.scala @@ -1,7 +1,7 @@ package mill.eval import mill.api.internal -import mill.define.{NamedTask, Segment, Segments, Target} +import mill.define.{NamedTask, Segment, Segments} case class EvaluatorPaths private (dest: os.Path, meta: os.Path, log: os.Path) { private def copy(dest: os.Path = dest, meta: os.Path = meta, log: os.Path = log): EvaluatorPaths = diff --git a/main/eval/test/src/mill/eval/CrossTests.scala b/main/eval/test/src/mill/eval/CrossTests.scala index 378125c26fd..39445a5c782 100644 --- a/main/eval/test/src/mill/eval/CrossTests.scala +++ b/main/eval/test/src/mill/eval/CrossTests.scala @@ -1,6 +1,5 @@ package mill.eval -import mill.define.Discover import mill.util.{TestEvaluator, TestGraphs} import mill.util.TestGraphs.{ crossResolved, @@ -12,6 +11,7 @@ import mill.util.TestGraphs.{ crossExtension } import utest._ + object CrossTests extends TestSuite { val tests = Tests { "singleCross" - { diff --git a/main/resolve/src/mill/resolve/ResolveNotFoundHandler.scala b/main/resolve/src/mill/resolve/ResolveNotFoundHandler.scala index 724a48b3ce0..3ce3b071690 100644 --- a/main/resolve/src/mill/resolve/ResolveNotFoundHandler.scala +++ b/main/resolve/src/mill/resolve/ResolveNotFoundHandler.scala @@ -1,7 +1,6 @@ package mill.resolve -import mill.api.internal -import mill.define.{BaseModule, Discover, Segment, Segments} +import mill.define.{Segment, Segments} import mill.resolve.ResolveCore.Resolved /** diff --git a/main/resolve/src/mill/resolve/SimpleTaskTokenReader.scala b/main/resolve/src/mill/resolve/SimpleTaskTokenReader.scala index e9c75041df2..d3fca5d79b0 100644 --- a/main/resolve/src/mill/resolve/SimpleTaskTokenReader.scala +++ b/main/resolve/src/mill/resolve/SimpleTaskTokenReader.scala @@ -1,7 +1,7 @@ package mill.resolve import mainargs.TokensReader -import mill.define.{Target, Task, Args} +import mill.define.{Target, Task} /** * Transparently handle `Task[T]` like simple `T` but lift the result into a T.task. diff --git a/main/src/mill/main/MainModule.scala b/main/src/mill/main/MainModule.scala index 56ff048e473..11fcfebbc4f 100644 --- a/main/src/mill/main/MainModule.scala +++ b/main/src/mill/main/MainModule.scala @@ -8,7 +8,7 @@ import mill.define.{Command, NamedTask, Segments, Task} import mill.eval.{Evaluator, EvaluatorPaths, Terminal} import mill.resolve.{Resolve, SelectMode} import mill.resolve.SelectMode.Separated -import mill.util.{PrintLogger, Watchable} +import mill.util.Watchable import pprint.{Renderer, Tree, Truncated} import scala.collection.mutable diff --git a/main/src/mill/main/RootModule.scala b/main/src/mill/main/RootModule.scala index 96ce0a3937b..25607d5e17f 100644 --- a/main/src/mill/main/RootModule.scala +++ b/main/src/mill/main/RootModule.scala @@ -1,10 +1,7 @@ package mill.main -import mill.api.{PathRef, internal} +import mill.api.internal import mill.define.{Caller, Discover, Segments} -import TokenReaders._ - -import scala.collection.mutable /** * Used to mark a module in your `build.sc` as a top-level module, so it's diff --git a/main/test/src/mill/UTestFramework.scala b/main/test/src/mill/UTestFramework.scala index 6e31e0c257a..3deeecbbb48 100644 --- a/main/test/src/mill/UTestFramework.scala +++ b/main/test/src/mill/UTestFramework.scala @@ -1,12 +1,10 @@ package mill -import utest.framework.{Result, StackMarker} -import utest.ufansi.Str class UTestFramework extends utest.runner.Framework { - override def exceptionStackFrameHighlighter(s: StackTraceElement) = { + override def exceptionStackFrameHighlighter(s: StackTraceElement): Boolean = { s.getClassName.startsWith("mill.") } - override def setup() = { + override def setup(): Unit = { os.remove.all(os.pwd / "target" / "workspace") } diff --git a/main/test/src/mill/util/TestEvaluator.scala b/main/test/src/mill/util/TestEvaluator.scala index 22408b5c59b..886aea22bc5 100644 --- a/main/test/src/mill/util/TestEvaluator.scala +++ b/main/test/src/mill/util/TestEvaluator.scala @@ -4,10 +4,12 @@ import java.io.{InputStream, PrintStream} import mill.eval.Evaluator import utest.framework.TestPath -import language.experimental.macros -import mill.api.{DummyInputStream, Result} +import mill.api.DummyInputStream + object TestEvaluator { - def static(module: => TestUtil.BaseModule)(implicit fullName: sourcecode.FullName) = { + def static(module: => TestUtil.BaseModule)(implicit + fullName: sourcecode.FullName + ): TestEvaluator = { new TestEvaluator(module)(fullName, TestPath(Nil)) } } diff --git a/main/testkit/src/mill/testkit/MillTestkit.scala b/main/testkit/src/mill/testkit/MillTestkit.scala index 69321749bc9..ce5011e1988 100644 --- a/main/testkit/src/mill/testkit/MillTestkit.scala +++ b/main/testkit/src/mill/testkit/MillTestkit.scala @@ -11,8 +11,6 @@ import mill.eval.Evaluator import mill.resolve.{Resolve, SelectMode} import mill.util.PrintLogger -import language.experimental.macros - trait MillTestKit { def defaultTargetDir: os.Path = diff --git a/main/util/src/mill/util/Classpath.scala b/main/util/src/mill/util/Classpath.scala index ad59abffcc8..2f47110dea4 100644 --- a/main/util/src/mill/util/Classpath.scala +++ b/main/util/src/mill/util/Classpath.scala @@ -2,12 +2,8 @@ package mill.util import java.io.File import java.net.URL -import java.nio.file.{Path, Paths} -import java.util.zip.{ZipFile, ZipInputStream} -import mill.java9rtexport.Export import scala.collection.mutable -import scala.util.control.NonFatal /** * Loads the jars that make up the classpath of the scala-js-fiddle diff --git a/main/util/src/mill/util/Jvm.scala b/main/util/src/mill/util/Jvm.scala index 2e7dc5be46b..1c44317767f 100644 --- a/main/util/src/mill/util/Jvm.scala +++ b/main/util/src/mill/util/Jvm.scala @@ -1,22 +1,15 @@ package mill.util -import mill.api.BuildInfo import mill.api.Loose.Agg import mill.api._ import mill.main.client.InputPumper import os.SubProcess -import upickle.default.{ReadWriter => RW} import java.io._ import java.lang.reflect.Modifier -import java.net.URI import java.nio.file.attribute.PosixFilePermission -import java.nio.file.{FileSystems, Files, StandardOpenOption} -import java.util.Collections -import java.util.jar.{Attributes, JarFile, Manifest} -import scala.jdk.CollectionConverters._ +import java.nio.file.Files import scala.util.Properties.isWin -import scala.util.Using object Jvm extends CoursierSupport { diff --git a/main/util/src/mill/util/PrintLogger.scala b/main/util/src/mill/util/PrintLogger.scala index dc9687b4f5f..a3823dafc09 100644 --- a/main/util/src/mill/util/PrintLogger.scala +++ b/main/util/src/mill/util/PrintLogger.scala @@ -1,9 +1,7 @@ package mill.util import java.io._ -import java.nio.file.{Files, StandardOpenOption} -import scala.util.DynamicVariable -import mill.api.{Logger, SystemStreams} +import mill.api.SystemStreams class PrintLogger( override val colored: Boolean, diff --git a/main/util/src/mill/util/Util.scala b/main/util/src/mill/util/Util.scala index a25d7cb6771..a8b24e50bf1 100644 --- a/main/util/src/mill/util/Util.scala +++ b/main/util/src/mill/util/Util.scala @@ -2,7 +2,7 @@ package mill.util import coursier.Repository import mill.api.Loose.Agg -import mill.api.{BuildInfo, Ctx, IO, Loose, PathRef, Result} +import mill.api.{BuildInfo, Ctx, IO, PathRef, Result} object Util { diff --git a/runner/src/mill/runner/MillMain.scala b/runner/src/mill/runner/MillMain.scala index df54a6be78c..47ab7efe8e0 100644 --- a/runner/src/mill/runner/MillMain.scala +++ b/runner/src/mill/runner/MillMain.scala @@ -9,7 +9,7 @@ import mill.java9rtexport.Export import mill.api.{DummyInputStream, internal} import mill.api.SystemStreams import mill.bsp.{BspContext, BspServerResult} -import mill.util.{PrintLogger, Util} +import mill.util.PrintLogger @internal object MillMain { diff --git a/runner/src/mill/runner/RunnerState.scala b/runner/src/mill/runner/RunnerState.scala index 1f76ab34647..dd9a416eb26 100644 --- a/runner/src/mill/runner/RunnerState.scala +++ b/runner/src/mill/runner/RunnerState.scala @@ -1,7 +1,7 @@ package mill.runner import mill.api.{PathRef, Val, internal} -import mill.define.{BaseModule, Segments} +import mill.define.Segments import mill.util.Watchable import upickle.default.{ReadWriter, macroRW} import mill.api.JsonFormatters._ diff --git a/scalajslib/src/mill/scalajslib/ScalaJSModule.scala b/scalajslib/src/mill/scalajslib/ScalaJSModule.scala index 2cd944a7d98..cc656617cd6 100644 --- a/scalajslib/src/mill/scalajslib/ScalaJSModule.scala +++ b/scalajslib/src/mill/scalajslib/ScalaJSModule.scala @@ -13,8 +13,6 @@ import mill.scalajslib.internal.ScalaJSUtils.getReportMainFilePathRef import mill.scalajslib.worker.{ScalaJSWorker, ScalaJSWorkerExternalModule} import mill.scalalib.bsp.{ScalaBuildTarget, ScalaPlatform} -import scala.jdk.CollectionConverters._ - trait ScalaJSModule extends scalalib.ScalaModule { outer => def scalaJSVersion: T[String] diff --git a/scalajslib/test/src/mill/scalajslib/SourceMapTests.scala b/scalajslib/test/src/mill/scalajslib/SourceMapTests.scala index 2b6a5a81532..ce0e98ea495 100644 --- a/scalajslib/test/src/mill/scalajslib/SourceMapTests.scala +++ b/scalajslib/test/src/mill/scalajslib/SourceMapTests.scala @@ -3,7 +3,6 @@ package mill.scalajslib import mill.define.Discover import mill.util.{TestEvaluator, TestUtil} import utest._ -import mill.define.Target object SourceMapTests extends TestSuite { val workspacePath = TestUtil.getOutPathStatic() / "source-map" diff --git a/scalajslib/worker/1/src/mill/scalajslib/worker/jsenv/Phantom.scala b/scalajslib/worker/1/src/mill/scalajslib/worker/jsenv/Phantom.scala index d82ad92f5d0..55f4e695320 100644 --- a/scalajslib/worker/1/src/mill/scalajslib/worker/jsenv/Phantom.scala +++ b/scalajslib/worker/1/src/mill/scalajslib/worker/jsenv/Phantom.scala @@ -1,7 +1,6 @@ package mill.scalajslib.worker.jsenv import mill.scalajslib.worker.api._ -import org.scalajs.jsenv.nodejs.NodeJSEnv.SourceMap object Phantom { def apply(config: JsEnvConfig.Phantom) = diff --git a/scalalib/src/mill/scalalib/Dependency.scala b/scalalib/src/mill/scalalib/Dependency.scala index dc29606c623..2f9f4399a1e 100644 --- a/scalalib/src/mill/scalalib/Dependency.scala +++ b/scalalib/src/mill/scalalib/Dependency.scala @@ -3,7 +3,6 @@ package mill.scalalib import mill.T import mill.define.{Command, Discover, ExternalModule} import mill.eval.Evaluator -import mill.main.EvaluatorTokenReader import mill.scalalib.dependency.DependencyUpdatesImpl import mill.scalalib.dependency.updates.ModuleDependenciesUpdates diff --git a/scalalib/src/mill/scalalib/JsonFormatters.scala b/scalalib/src/mill/scalalib/JsonFormatters.scala index 766d2f51503..751ebcc60b3 100644 --- a/scalalib/src/mill/scalalib/JsonFormatters.scala +++ b/scalalib/src/mill/scalalib/JsonFormatters.scala @@ -2,8 +2,6 @@ package mill.scalalib import upickle.default.{ReadWriter => RW} -import scala.reflect.ClassTag - trait JsonFormatters { implicit lazy val publicationFormat: RW[coursier.core.Publication] = upickle.default.macroRW implicit lazy val extensionFormat: RW[coursier.core.Extension] = upickle.default.macroRW diff --git a/scalalib/src/mill/scalalib/Lib.scala b/scalalib/src/mill/scalalib/Lib.scala index e6fbc8704bc..7fd7d6a0e2c 100644 --- a/scalalib/src/mill/scalalib/Lib.scala +++ b/scalalib/src/mill/scalalib/Lib.scala @@ -2,7 +2,7 @@ package mill package scalalib import coursier.util.Task -import coursier.{Dependency, LocalRepositories, Repositories, Repository, Resolution} +import coursier.{Dependency, Repository, Resolution} import mill.api.{Ctx, Loose, PathRef, Result} import mill.main.BuildInfo import mill.util.Util diff --git a/scalalib/src/mill/scalalib/PublishModule.scala b/scalalib/src/mill/scalalib/PublishModule.scala index 6eea39d1549..9fd339707b4 100644 --- a/scalalib/src/mill/scalalib/PublishModule.scala +++ b/scalalib/src/mill/scalalib/PublishModule.scala @@ -3,10 +3,8 @@ package scalalib import mill.define.{Command, ExternalModule, Target, Task} import mill.api.{JarManifest, PathRef, Result} -import mill.main.Tasks -import mill.util.Jvm import mill.scalalib.PublishModule.checkSonatypeCreds -import mill.scalalib.publish.{Artifact, SonatypePublisher, VersionScheme} +import mill.scalalib.publish.{Artifact, SonatypePublisher} /** * Configuration necessary for publishing a Scala module to Maven Central or similar diff --git a/scalalib/src/mill/scalalib/ScalaModule.scala b/scalalib/src/mill/scalalib/ScalaModule.scala index d4857d58268..0c87e0d2837 100644 --- a/scalalib/src/mill/scalalib/ScalaModule.scala +++ b/scalalib/src/mill/scalalib/ScalaModule.scala @@ -9,7 +9,6 @@ import mill.util.Jvm.createJar import mill.api.Loose.Agg import mill.scalalib.api.{CompilationResult, Versions, ZincWorkerUtil} -import scala.jdk.CollectionConverters._ import mainargs.Flag import mill.scalalib.bsp.{BspBuildTarget, BspModule, ScalaBuildTarget, ScalaPlatform} import mill.scalalib.dependency.versions.{ValidVersion, Version} diff --git a/scalalib/src/mill/scalalib/SemanticDbJavaModule.scala b/scalalib/src/mill/scalalib/SemanticDbJavaModule.scala index 237be740b62..d52603aeb90 100644 --- a/scalalib/src/mill/scalalib/SemanticDbJavaModule.scala +++ b/scalalib/src/mill/scalalib/SemanticDbJavaModule.scala @@ -1,7 +1,7 @@ package mill.scalalib import mill.api.{PathRef, Result, experimental} -import mill.define.{ModuleRef, Target, Task} +import mill.define.{ModuleRef, Target} import mill.main.BuildInfo import mill.scalalib.api.{CompilationResult, Versions, ZincWorkerUtil} import mill.scalalib.bsp.BspBuildTarget diff --git a/scalalib/src/mill/scalalib/dependency/updates/ModuleDependenciesUpdates.scala b/scalalib/src/mill/scalalib/dependency/updates/ModuleDependenciesUpdates.scala index 1705edec671..3ac18f458ef 100644 --- a/scalalib/src/mill/scalalib/dependency/updates/ModuleDependenciesUpdates.scala +++ b/scalalib/src/mill/scalalib/dependency/updates/ModuleDependenciesUpdates.scala @@ -1,6 +1,5 @@ package mill.scalalib.dependency.updates -import mill.scalalib.JavaModule import mill.scalalib.dependency.versions.Version import scala.collection.SortedSet diff --git a/scalalib/src/mill/scalalib/dependency/versions/VersionsFinder.scala b/scalalib/src/mill/scalalib/dependency/versions/VersionsFinder.scala index a3326a0bdc8..e7859df9c8a 100644 --- a/scalalib/src/mill/scalalib/dependency/versions/VersionsFinder.scala +++ b/scalalib/src/mill/scalalib/dependency/versions/VersionsFinder.scala @@ -1,12 +1,10 @@ package mill.scalalib.dependency.versions -import scala.reflect.ClassTag - import coursier.Dependency -import mill.define.{BaseModule, Task} +import mill.define.{BaseModule} import mill.eval.Evaluator import mill.scalalib.dependency.metadata.MetadataLoaderFactory -import mill.scalalib.{Dep, JavaModule, Lib} +import mill.scalalib.{JavaModule, Lib} import mill.api.Ctx.{Home, Log} import mill.T diff --git a/scalalib/src/mill/scalalib/internal/JavaModuleUtils.scala b/scalalib/src/mill/scalalib/internal/JavaModuleUtils.scala index b5caf44e7de..51a6a41863d 100644 --- a/scalalib/src/mill/scalalib/internal/JavaModuleUtils.scala +++ b/scalalib/src/mill/scalalib/internal/JavaModuleUtils.scala @@ -1,6 +1,6 @@ package mill.scalalib.internal -import mill.define.{Module, Segments} +import mill.define.Module import mill.scalalib.JavaModule @mill.api.internal diff --git a/scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala b/scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala index f794be34c31..e7011c1aea5 100644 --- a/scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala +++ b/scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala @@ -4,7 +4,6 @@ import java.util.Base64 import scala.annotation.tailrec import scala.concurrent.duration._ -import scala.util.control.NonFatal import mill.main.BuildInfo import requests.BaseSession diff --git a/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala b/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala index ce1c31d97db..4d024efea71 100644 --- a/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala +++ b/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala @@ -5,7 +5,6 @@ import java.security.MessageDigest import mill.api.Logger import mill.util.Jvm -import os.Shellable class SonatypePublisher( uri: String, diff --git a/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala b/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala index da91281351f..af032d613aa 100644 --- a/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala +++ b/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala @@ -23,10 +23,6 @@ import mill.testrunner.{TestResult, TestRunner, TestRunnerUtils} import mill.scalanativelib.api._ import mill.scalanativelib.worker.{ScalaNativeWorkerExternalModule, api => workerApi} -import scala.jdk.CollectionConverters._ -import scala.jdk.OptionConverters._ -import upickle.default.{macroRW, ReadWriter => RW} - trait ScalaNativeModule extends ScalaModule { outer => def scalaNativeVersion: T[String] override def platformSuffix = s"_native${scalaNativeBinaryVersion()}" diff --git a/scalanativelib/src/mill/scalanativelib/worker/ScalaNativeWorker.scala b/scalanativelib/src/mill/scalanativelib/worker/ScalaNativeWorker.scala index 67fa0927beb..a111918ab5c 100644 --- a/scalanativelib/src/mill/scalanativelib/worker/ScalaNativeWorker.scala +++ b/scalanativelib/src/mill/scalanativelib/worker/ScalaNativeWorker.scala @@ -1,11 +1,7 @@ package mill.scalanativelib.worker -import java.io.File -import java.net.URLClassLoader - import mill.define.{Discover, Worker} import mill.{Agg, PathRef, T} -import mill.scalanativelib.api import mill.scalanativelib.worker.{api => workerApi} private[scalanativelib] class ScalaNativeWorker extends AutoCloseable { diff --git a/scalanativelib/test/src/mill/scalanativelib/HelloNativeWorldTests.scala b/scalanativelib/test/src/mill/scalanativelib/HelloNativeWorldTests.scala index 0d1df299c3e..618320d60af 100644 --- a/scalanativelib/test/src/mill/scalanativelib/HelloNativeWorldTests.scala +++ b/scalanativelib/test/src/mill/scalanativelib/HelloNativeWorldTests.scala @@ -6,8 +6,8 @@ import mill.api.Result import mill.define.Discover import mill.eval.EvaluatorPaths import mill.scalalib.api.ZincWorkerUtil -import mill.scalalib.{CrossScalaModule, DepSyntax, Lib, PublishModule, ScalaModule, TestModule} -import mill.testrunner.{TestResult, TestRunner} +import mill.scalalib.{DepSyntax, PublishModule, ScalaModule, TestModule} +import mill.testrunner.TestResult import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl} import mill.scalanativelib.api._ import mill.util.{TestEvaluator, TestUtil} diff --git a/scalanativelib/worker-api/src/mill/scalanativelib/worker/api/ScalaNativeWorkerApi.scala b/scalanativelib/worker-api/src/mill/scalanativelib/worker/api/ScalaNativeWorkerApi.scala index 5a16ae346a4..422bac7c4f2 100644 --- a/scalanativelib/worker-api/src/mill/scalanativelib/worker/api/ScalaNativeWorkerApi.scala +++ b/scalanativelib/worker-api/src/mill/scalanativelib/worker/api/ScalaNativeWorkerApi.scala @@ -1,7 +1,6 @@ package mill.scalanativelib.worker.api import java.io.File -import sbt.testing.Framework private[scalanativelib] trait ScalaNativeWorkerApi {