How to build with different configurations? #1441
-
I am looking for a way to produce development and release builds, the latter using inlining. Are there examples (in terms of mill-based open-source projects) that could serve as a blueprint? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I assume, you want to apply special/different 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
override def scalacOptions = // ..., e.g. enable inlining
}
} If you want to make one of the two configurations the default you could also let trait Settings extends ScalaModule {
// common settings and dependencies
}
object myapp extends Settings {
// development-specific settings
object prod extends Settings {
override def millSourcePath = myapp.millSourcePath
// production-specific settings
override def scalacOptions = // ..., e.g. enable inlining
}
} What are the alternatives?
|
Beta Was this translation helpful? Give feedback.
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.