mirah / pindah

Tools for building Android applications with Mirah
Apache License 2.0
228 stars 27 forks source link

Use split Mirah/Java source directories if available. #17

Closed sattvik closed 10 years ago

sattvik commented 13 years ago

This should address issue #15 (although I realise this request will create yet another issue).

As far as I can tell there is no really easy way to solve the problem without splitting source directories. If I understand it correctly, you should not modify a signed package. Unfortunately, for debug packages, packaging and signing are done in one step, and there is no chance to remove files.

So, I've created a patch that uses the same src parameter and checks for a 'mirah' subdirectory. This is not the most robust way to do things, since this will break if someone has a 'mirah' top-level package. However, I am guessing that should be rare.

If the mirah source directory exists, it makes sure a java source directory exists as well. This keeps the build from breaking.

If no mirah source directory exists, it prints a nice warning and retains the old behaviour.

The parameters sent to Ant are slightly modified so that Android knows where to look for the Java directory.

AtomicPair commented 10 years ago

Thanks for your contribution, @sattvik!

As I noted in #15, I share your concern about backwards compatibility. In lieu of any further input on this issue, and in the interest of keeping the code as clean and simple as possible, I believe the ANDROID_AAPT_IGNORE solution posed in that thread would be the preferred way to solve this problem.

Feel free to submit another issue and/or pull request if you think of any new ideas!