-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify codegen prelude implicits (#3749)
Removed `MillBuildRootModule.Info` and `MillBuildRootModule.MillMiscInfo` and consolidated them into `RootModule.Info` and `SubfolderModule.Info`. Shouldn't affect anything semantically, just removes some unnecessary indirection that wasn't doing anything but packing and unpacking the same few values
- Loading branch information
Showing
6 changed files
with
93 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package mill.main; | ||
import mill._ | ||
import mill.define.{Caller, Ctx, Segments} | ||
|
||
object SubfolderModule { | ||
class Info(val millSourcePath0: os.Path, val segments: Seq[String]) { | ||
implicit val subFolderInfo: Info = this | ||
} | ||
} | ||
|
||
abstract class SubfolderModule()(implicit | ||
millModuleLine0: sourcecode.Line, | ||
millFile0: sourcecode.File, | ||
subFolderInfo: SubfolderModule.Info | ||
) extends mill.define.Module.BaseClass()( | ||
Ctx.make( | ||
millModuleEnclosing0 = subFolderInfo.segments.mkString("."), | ||
millModuleLine0 = millModuleLine0, | ||
millModuleBasePath0 = Ctx.BasePath(subFolderInfo.millSourcePath0 / os.up), | ||
segments0 = Segments.labels(subFolderInfo.segments.init: _*), | ||
external0 = Ctx.External(false), | ||
foreign0 = Ctx.Foreign(None), | ||
fileName = millFile0, | ||
enclosing = Caller(null) | ||
) | ||
) with Module {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters