Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated toolsClasspath targets in favor of uniquely named new ones #1475

Merged
merged 2 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions contrib/playlib/src/mill/playlib/RouterModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ trait RouterModule extends ScalaModule with Version {
def compileRouter: T[CompilationResult] = T.persistent {
T.log.debug(s"compiling play routes with ${playVersion()} worker")
routeCompilerWorker.routeCompilerWorker().compile(
toolsClasspath().map(_.path),
routeFiles().map(_.path),
routesAdditionalImport,
generateForwardsRouter,
generateReverseRouter,
namespaceReverseRouter,
generatorType,
T.dest
routerClasspath = playRouterToolsClasspath().map(_.path),
files = routeFiles().map(_.path),
additionalImports = routesAdditionalImport,
forwardsRouter = generateForwardsRouter,
reverseRouter = generateReverseRouter,
namespaceReverseRouter = namespaceReverseRouter,
generatorType = generatorType,
dest = T.dest
)
}

Expand All @@ -90,7 +90,12 @@ trait RouterModule extends ScalaModule with Version {
)
}

@deprecated("Use playRouterToolsClasspath instead", "mill after 0.10.0-M1")
def toolsClasspath = T {
playRouterToolsClasspath()
}

def playRouterToolsClasspath = T {
playRouteCompilerWorkerClasspath() ++ routerClasspath()
}

Expand Down
7 changes: 6 additions & 1 deletion contrib/scoverage/src/ScoverageModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ trait ScoverageModule extends ScalaModule { outer: ScalaModule =>
ivy"org.scoverage:::scalac-scoverage-plugin:${outer.scoverageVersion()}"
}

@deprecated("Use scoverageToolsClasspath instead.", "mill after 0.10.0-M1")
def toolsClasspath: T[Agg[PathRef]] = T {
scoverageToolsClasspath()
}

def scoverageToolsClasspath: T[Agg[PathRef]] = T {
scoverageReportWorkerClasspath() ++
resolveDeps(T.task {
Agg(ivy"org.scoverage:scalac-scoverage-plugin_${mill.BuildInfo.scalaVersion}:${outer.scoverageVersion()}")
Expand All @@ -90,7 +95,7 @@ trait ScoverageModule extends ScalaModule { outer: ScalaModule =>
def doReport(reportType: ReportType): Task[Unit] = T.task {
ScoverageReportWorker
.scoverageReportWorker()
.bridge(toolsClasspath().map(_.path))
.bridge(scoverageToolsClasspath().map(_.path))
.report(reportType, allSources().map(_.path), Seq(data().path))
}

Expand Down
2 changes: 1 addition & 1 deletion contrib/scoverage/src/ScoverageReport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ trait ScoverageReport extends Module {
val dataPaths: Seq[Path] = T.sequence(dataTasks)().map(_.path)
scoverageReportWorkerModule
.scoverageReportWorker()
.bridge(workerModule.toolsClasspath().map(_.path))
.bridge(workerModule.scoverageToolsClasspath().map(_.path))
.report(reportType, sourcePaths, dataPaths)
PathRef(T.dest)
}
Expand Down
47 changes: 26 additions & 21 deletions scalajslib/src/ScalaJSModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,34 @@ trait ScalaJSModule extends scalalib.ScalaModule { outer =>
)
}

def toolsClasspath = T { scalaJSWorkerClasspath() ++ scalaJSLinkerClasspath() }
@deprecated("Use scalaJSToolsClasspath instead", "mill after 0.10.0-M1")
def toolsClasspath = T { scalaJSToolsClasspath() }

def scalaJSToolsClasspath = T { scalaJSWorkerClasspath() ++ scalaJSLinkerClasspath() }

def fastOpt = T {
link(
ScalaJSWorkerApi.scalaJSWorker(),
toolsClasspath(),
runClasspath(),
finalMainClassOpt().toOption,
worker = ScalaJSWorkerApi.scalaJSWorker(),
toolsClasspath = scalaJSToolsClasspath(),
runClasspath = runClasspath(),
mainClass = finalMainClassOpt().toOption,
testBridgeInit = false,
FastOpt,
moduleKind(),
useECMAScript2015()
mode = FastOpt,
moduleKind = moduleKind(),
useECMAScript2015 = useECMAScript2015()
)
}

def fullOpt = T {
link(
ScalaJSWorkerApi.scalaJSWorker(),
toolsClasspath(),
runClasspath(),
finalMainClassOpt().toOption,
worker = ScalaJSWorkerApi.scalaJSWorker(),
toolsClasspath = scalaJSToolsClasspath(),
runClasspath = runClasspath(),
mainClass = finalMainClassOpt().toOption,
testBridgeInit = false,
FullOpt,
moduleKind(),
useECMAScript2015()
mode = FullOpt,
moduleKind = moduleKind(),
useECMAScript2015 = useECMAScript2015()
)
}

Expand All @@ -99,7 +102,7 @@ trait ScalaJSModule extends scalalib.ScalaModule { outer =>
case Left(err) => Result.Failure(err)
case Right(_) =>
ScalaJSWorkerApi.scalaJSWorker().run(
toolsClasspath().map(_.path),
scalaJSToolsClasspath().map(_.path),
jsEnvConfig(),
fastOpt().path.toIO
)
Expand Down Expand Up @@ -150,9 +153,11 @@ trait ScalaJSModule extends scalalib.ScalaModule { outer =>
).map(PathRef(_))
}

override def mandatoryScalacOptions = super.mandatoryScalacOptions() ++ {
if (isScala3(scalaVersion())) Seq("-scalajs")
else Seq.empty
override def mandatoryScalacOptions = T {
super.mandatoryScalacOptions() ++ {
if (isScala3(scalaVersion())) Seq("-scalajs")
else Seq.empty
}
}

override def scalacPluginIvyDeps = T {
Expand Down Expand Up @@ -204,7 +209,7 @@ trait TestScalaJSModule extends ScalaJSModule with TestModule {
def fastOptTest = T {
link(
ScalaJSWorkerApi.scalaJSWorker(),
toolsClasspath(),
scalaJSToolsClasspath(),
scalaJSTestDeps() ++ runClasspath(),
None,
testBridgeInit = true,
Expand All @@ -222,7 +227,7 @@ trait TestScalaJSModule extends ScalaJSModule with TestModule {
): Task[(String, Seq[TestRunner.Result])] = T.task {

val (close, framework) = mill.scalajslib.ScalaJSWorkerApi.scalaJSWorker().getFramework(
toolsClasspath().map(_.path),
scalaJSToolsClasspath().map(_.path),
jsEnvConfig(),
testFramework(),
fastOptTest().path.toIO,
Expand Down