Skip to content

Allowing directory structure and module name mismatch #3953

Answered by lefou
yoohaemin asked this question in Q&A
Discussion options

You must be logged in to vote

How about this:

// file: build.mill
package build

import mill._
import mill.scalalib._

object `package` extends RootModule {
  def millSourcePath = super.millSourcePath / "modules"

  object foo extends JavaModule
  object bar extends JavaModule
}
> mill show __.sources
[1/1] show
{
  "bar.sources": [
    "ref:v0:c984eca8:/tmp/mill-4/modules/bar/src"
  ],
  "foo.sources": [
    "ref:v0:c984eca8:/tmp/mill-4/modules/foo/src"
  ]
}

You can always override millSourcePath, if your module materializes in a different location.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@yoohaemin
Comment options

Answer selected by yoohaemin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants