mirah / pindah

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

Mirah source files included in Android package #15

Closed sattvik closed 10 years ago

sattvik commented 13 years ago

Since Pindah relies on Mirah source files being in the same directory as Android expects Java sources, Android will package any non-Java source files in that directory into the apk file. Off-hand, there are two ways to resolve this:

  1. Split Java/Mirah sources into different directories, such as 'src/java' and 'src/mirah'. This would presumably break existing projects, unless some backward-compatibility code were introduced.
  2. Add a step after packaging but before aligning/signing that removes any *.mirah files in the apk.

I can contribute a patch if there is a preference for one of these solutions.

zapnap commented 13 years ago

Good point. I think I like the src/ option, but it would be a breaking change. On the other hand we're early along enough now that it'd be a better time to do it than later. Perhaps it could default to looking for top-level package names in src/ if neither a src/java or src/mirah directory is found.

abscondment commented 11 years ago

We should try to make use of ANDROID_AAPT_IGNORE instead:

https://android.googlesource.com/platform/frameworks/base/+/90897ed87bce639bf6bb2ccf15fbabb59b131bab

AtomicPair commented 10 years ago

Hi, @sattvik. Sorry it's taken so long to get you a response on this!

Personally, I'm not against the idea of having split source directories, although I share the concern that it would likely break existing projects without the addition of some deprecation and transitional support code.

Given then choice, I would prefer @abscondment's solution of using the ANDROID_AAPT_IGNORE variable to exclude these source files. Simple, straightforward, and easily supported within our custom build process.

What do you guys think? If there are no objections to the contrary, I'll close this issue, the related pull request, and open a separate issue to add the AAPT_IGNORE variable into the upcoming 0.1.3 release.

AtomicPair commented 10 years ago

Closing this one for now and opening a separate issue for the ANDROID_AAPT_IGNORE solution. If the need for this solution arises in the future, or if anyone has any further input, please open a new issue and/or pull request.