Reputation: 948
I'm using the Mill Build Tool for a Scala project, which uses a build.sc file to list specific dependencies for different modules within the project. Now, I'm trying to dockerize the project and would like to install the dependencies in the image before having to copy over the entire repository. I want to avoid this, so that the dependencies don't have to be installed every time I make a small change in the source code. Is there any simple way of doing this? Thanks!
Here's a similar post for sbt: sbt only fetch dependencies
Upvotes: 6
Views: 802
Reputation: 546
Updated answer:
Since mill 0.9.3 there is support to easily prepare offline work.
See pull request #951 for details.
In short, you can use the prepareOffline
target to fetch dependencies in advance.
mill __.prepareOffline
Original answer:
There is currently no easy and straight forward way of doing this. Although you can force the resolution of all compile dependencies by running mill __.compileClasspath
, but this will also trigger the compilation of all inter-module dependencies.
As a work around you could try to generate IntelliJ IDEA project files, which will also trigger dependency resolution. Afterwards you can delete the generated directories (.idea/
and .idea_modules/
).
Technically, it is quite simple to introduce a new fetchIvyDeps
target for exactly that purpose, but it's not there yet. You might want to open a feature request or create a pull request.
Upvotes: 4