Skip to content

Add support for access any classes via Package Stacking #5337

@ThijsBroersen

Description

@ThijsBroersen

Multi-file builds could be more concise with Package Stacking.
If I now want to use root or parent package object, I have to always import them with the full build.SomeThing path.
Package Stacking is by Mill correctly used as package, but any classes of shared packages are not imported by default.

e.g. taking a modified example from the docs

package build
import $packages._

import mill._, scalalib._

trait MyModule extends ScalaModule {
  def scalaVersion = "2.13.11"
}
package build
package foo
import mill._, scalalib._

object `package` extends RootModule with MyModule { // <- Not recognized
  def moduleDeps = Seq(build.bar.qux.mymodule)
  def ivyDeps = Agg(ivy"com.lihaoyi::mainargs:0.4.0")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions