remvee / android-mode

Emacs minor mode for Android application development
GNU General Public License v3.0
220 stars 57 forks source link

Starting app fails for Gradle projects #58

Closed WammKD closed 5 years ago

WammKD commented 5 years ago

Assuming the AndroidManifest.xml file has always been in its current place, this was always an issue but, perhaps, a more pressing one, now, since users are forced to use Android Studio to generate a new project layout since Google removed the ability to do so through the command-line and Android Studio uses gradle.

Since, for gradle projects, AndroidManifest.xml is not located in the project root but being able to get the project root is probably still a useful ability, keep the android-root function and add a android-manifest function to, specifically, search for the directory containing the AndroidManifest.xml file. Since the code is almost entire similar, also create a helper function by the name of android-find-dir.

Since some of the functions were using android-in-root on the assumption that that's where the AndroidManifest.xml was located, adjust android-in-root to allow the user to choose the location that default-directory should be set to and adjust the name to one that makes more sense, given the change.

Lastly, update the locations that were android-in-root to android-in-directory and operate in (android-root) or (android-manifest) depending on the need of the function (in truth, I just changed the ones to android-manifest that I knew needed it and kept the others in android-root since that's how it was, before; I didn't really test if the functions I didn't run into an issue with had the same issue).

remvee commented 5 years ago

Thanks!