Is there any way to ignore local.properties through Gradle options?

988 views
Skip to first unread message

Artem Zinnatullin

unread,
Nov 29, 2016, 6:45:57 PM11/29/16
to adt-dev
At the moment Android Gradle Plugin looks for `local.properties` and if it finds one, it grabs things like path to Android SDK from it. Even though required environment variables may be present. 

AS kinda forces you to create `local.properties` (or it autocreates it), but we need to ignore them to run some scripts. 

Would be very helpful if there would be an option that we could pass via Gradle paramets to disable `local.properties` lookup because currently we have to rename this file before running our scripts and then restore it back after which looks very awful from many points.

Thanks!

Michal Bendowski

unread,
Nov 30, 2016, 5:18:00 AM11/30/16
to adt-dev
What scripts are you talking about? local.properties are not meant to be checked-in to your VCS, hence we don't expect them to exist in a CI environment for instance.

Michal

Artem Zinnatullin

unread,
Nov 30, 2016, 5:39:13 AM11/30/16
to adt-dev
Sure, we don't commit `local.properties` to VCS. But we do need to run few scripts locally with ability to ignore `local.properties`.

If you curious in what I'm talking about in details: I'm setting up remote build when you as a developer work on project in AS on your local machine, but build it on a remote machine (with much better hardware) and results are transparently available on your local AS, it works, but we have to ignore `local.properties` from "local" machine during the build on "remote" machine which is currently only possible via renaming `local.properties`.

Michal Bendowski

unread,
Dec 1, 2016, 4:54:37 AM12/1/16
to adt-dev
So are you copying the entire project to a remote machine or just substituting certain tasks to run there? If the former, you should skip local.properties when copying. If the latter, than it seems you have control over the task, so you can change the compile classpath? 

Michal

Artem Zinnatullin

unread,
Dec 1, 2016, 6:03:52 AM12/1/16
to adt-dev
I'm mounting remote fs to local machine so project opened in AS is actually stored on a remote machine, then I run build step over ssh and at the end AS sees changes in project files and happily works with them (installs apk, runs tests, etc).

Artem Zinnatullin

unread,
Dec 4, 2016, 2:13:44 PM12/4/16
to adt-dev
Ok, nvm, switched to "archive, transfer, build, transfer back" workflow. Thanks for replies though :)
Reply all
Reply to author
Forward
0 new messages