Hi, I have a beginning of a mono repo which contai...
# gradle
u
Hi, I have a beginning of a mono repo which contains 3 apps with shared code. In android studio when I hit the green hammer, all apps are built. This is okay when I want it, but usually is a waste. I can get around it to have a separate settings.gradle on hand, but its kind of annoying to copy paste, and remember not to commit etc
g
Never use green hammer, pretty useless button imo
2
It rebuilding more than it needed on practice, use run configurations instead
There is even a feature in gradle-doctor plugin which fails build if multiple apps are building at the same time to avoid misusage of this feature
u
What do you use, the play button? Doesnt thay deploy the apk as well?
g
You can configure any kind Gradle task as run configuration, just any kind combination of assemble tasks (for particular app, or for multiple apps), running tests, lint etc. Hammer button just builds everything and not configurable
b
☝️ the run button is just "running" the currently selected task, which by default deploys the artifact to the target device.
u
I see. Any chance you know a shortcut to switch the configurations? Since now Ill need to switch between just building and running a lot
This is so much better. Now I can stick my test runs and other flavors as well here, great. I used to do this via terminal, but that from what I can tell, spins up new gradle instance, and RAM just cries thx!
g
Cmd + Shift + R -> Select run config (supports search)
spins up new Gradle instance
You probably have different JVMs for IDE and console, configure one of the to use the same jvm
u
yea but I heard android tools team saying not to do it