Looking for some advice / best practice here: I us...
# gradle
e
Looking for some advice / best practice here: I use gradle locally, but we do have a custom build script which builds a docker image and executes gradle commands there. Now, locally it seems convenient to increase gradle memory via
-Xmx4096m
but when I do the build in Docker then I don’t need this amount of memory. What’s the right way to tell my local gradle to use that amount of memory outside of my
gradle,properties
file in my project? I use IntelliJ IDEA and command line too, so ideally when I kick off a gradle command via the IDE or just type
gradle command
, the same settings would be picked up, but when it runs within the docker image, then it just ignores it.
e
~/.gradle/gradle.properties (GRADLE_USER_HOME) takes precedence over local properties
f
You could add it to your
$GRADLE_HOME/gradle.properties
file, but then it's used for every Gradle run on your system. Not sure if that would bother you. Alternatively you could use something like https://direnv.net/ but not sure regarding IDEA support. Of course you could set it there separately, but that can get annoying quickly...
e
thanks!