Skip to content

How can I split build.sc into multiple files? #1293

Answered by lefou
micheal-hill asked this question in Q&A
Discussion options

You must be logged in to vote
2. The import itself works, however it requires a second import to obtain `ScalaCommon` from the file. More importantly, it seems to break mill if I try to use it; resulting in an error: `Modules, Targets and Commands can only be defined within a mill Module`

The second import is normal, but the error not. Defining trait which contains targets should work. Only objects (the real modules in mill) need to be located in the build.sc.

To get to the cause of your specific error, you might need to share some code.

3. I couldn't figure out a way to make this work at all

Mill supports foreign modules which should the way to support your project layout. Note, that you may not be able to refe…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@itegebo
Comment options

@lefou
Comment options

lefou Jun 8, 2021
Maintainer

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