Local.properties in the Engine repository

My development system doesn’t have Android Studio installed, and I’m experimenting with Intellij IDEA. Every time I load the Engine into IDEA, I get errors because IDEA looks for Android Studio and doesn’t find it.

I think this is because the Engine repo at GitHub includes a “local.properties” file. That file contains information specific to a local installation, such as the path to the Android Studio installation. For this reason, the file shouldn’t be under source control. (Aufricer explained this to me in discussion of PR 1685.)

After deleting the “local.properties” file from my clone of the repo, my IDEA errors vanished.

“local.properties” was added to the repo in 2015. I’m surprised nobody’s complained about it in past 6 years. I don’t want to delete it without notice, so I’m raising the idea here.

I think the “local.properties” file should be deleted from the repo and listed in “.gitignore” so it won’t get added again accidentally. Are there any concerns with this proposed change?

4 Likes

Indeed, I also think this file should be ignored.
I never complained about this because I thought the file was needed for some reason (continuous build or something else) and because the annoyance was limited.

BTW, the problem also occurs with Android Studio of course, since it is based on Intellij.

1 Like

Further reading in support of removing and ignoring: https://stackoverflow.com/a/25318217

1 Like

It would be great if it was deleted. I have android installed for IDEA and it attempts to set the correct path in the local.properties every time I open the project, thus I have to remember to exclude it from my commit ever time.

1 Like

And down the drain it goes …

4 Likes

Well, local.properties is used yo locate android SDK and android NDK to build both native android and java code, for IDEA the IDE ignores it, for android studio the IDE automatically configures the SDK location inside the local properties and the NDK can be configured manually, removing the file may lead to some disturbances when building android (I don’t know if android studio creates that file if it was missing).

Edit : jme3 uses the old android, so I am not sure of the consequence of removing the file, but I am pretty sure that anyone can create this file manually.

1 Like

Well, the CI builds on GH do build android natives, and the build succeeded on the PR…

1 Like

I don’t know how the CI works, but if you are sure that’s won’t lead to any problems then no problem.

1 Like

I am pretty sure that anyone can create this file manually.

Me too. And that’s the plan!

Edit: I wonder if it would work to add “sdk.dir=C:\AndroidSDK” or whatever to the “gradle.properties” file in your GRADLE_USER_HOME directory (which on Linux is “~/.gradle”).

1 Like

Yes, we could do that like the NDK path :

But the ndkpath is then used to manually build natives :

While the SDK path auto builds java based on the local.properties.

1 Like