Skip to content

Commit

Permalink
Fix mill 0.12 runCommunityBuild command injects
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Nov 9, 2024
1 parent a7f722b commit 0a0bd7b
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,7 @@ class Scala3CommunityBuildMillAdapter(

val MillCommunityBuildInject = s"""
|// Main entry point for community build
|def runCommunityBuild(_evaluator: _root_.mill.eval.Evaluator, scalaVersion: _root_.scala.Predef.String, configJson: _root_.scala.Predef.String, projectDir: _root_.scala.Predef.String, targets: _root_.scala.Predef.String*) = ${Transform.TaskCommandType
.toString()} {
|def runCommunityBuild(_evaluator: _root_.mill.eval.Evaluator, scalaVersion: _root_.scala.Predef.String, configJson: _root_.scala.Predef.String, projectDir: _root_.scala.Predef.String, targets: _root_.scala.Predef.String*) = ${Transform.TaskCommandType.toString()} {
| implicit val ctx = MillCommunityBuild.Ctx(this, scalaVersion, _evaluator, _root_.mill.T.log)
| MillCommunityBuild.runBuild(configJson, projectDir, targets)
|}
Expand Down Expand Up @@ -422,12 +421,10 @@ class Scala3CommunityBuildMillAdapter(
"\nimport MillVersionCompat.compat.{Task => MillCompatTask}"
),
if (useLegacyTasks) None else Some("private object _OpenCommunityBuildOps {"),
if (useLegacyTasks && config.isMainBuildFile.forall(_ == true))
Some(MillCommunityBuildInject)
else None,
Some(MapScalacOptionsOps),
if (useLegacyMillCross) Some(MillCommunityBuildCrossInject) else None,
if (useLegacyTasks) None else Some("}\nimport _OpenCommunityBuildOps._")
if (useLegacyTasks) None else Some("}\nimport _OpenCommunityBuildOps._"),
Some(MillCommunityBuildInject),
).flatten ++
Seq("// End of OpenCB code injects\n")
}.mkString("\n")
Expand Down

0 comments on commit 0a0bd7b

Please sign in to comment.