Skip to content

How to build with different configurations? #1441

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

You must be logged in to vote

I assume, you want to apply special/different scalacOptions in the release builds, but otherwise want to the same project sources and settings. I can't point you to existing example open source projects right now, but this kind of setup is easy to realize with mill. Of course there are multiple ways to accomplish this. My preferred solution is to have two almost identical sub modules.

object myapp extends module {
  trait Settings extends ScalaModule {
    override def millSourcePath = myapp.millSourcePath
    // common settings and dependencies
  }
  object dev extends Settings {
    // development-specific settings
  } 
  object prod extends Settings {
    // production-specific settings

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@informarte
Comment options

@lefou
Comment options

lefou Sep 6, 2021
Maintainer

@informarte
Comment options

Answer selected by informarte
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