weimingtom / nekonme

Automatically exported from code.google.com/p/nekonme
0 stars 0 forks source link

Android Extensions - Support for merging AndroidManifest.xml and copying over resources #256

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Attached are two patches. 

tools.patch:

This adds support for android exntesions to declare their own manifest file and 
for these custom declaration to be merged into the templated 
AndroidManifest.xml.

It also allows an android extension to declare an android resource directory, 
the contents of which will be copied over to the res directory in the generated 
android project.

To achieve this I've added optional "manifest" and "resources" properties to 
the java nmml node. e.g.

<java path="src" manifest="AndroidManifest.xml" resources="res"/>

I added these to the existing java node as these are very android specific and 
didn't want to introduce yet more nodes. Happy to change this if the latter is 
preferred.

The reason I added this support was because in order to build any type of fully 
fledged extension you really need to be able to add custom activities to the 
manifest and declare custom layouts/animations/styles/localised files etc as 
resources.

One limitation with this code is that I do a simple copy of the resources 
director into res. If multiple extensions have resources we'd want to merge 
common ones. Specifically files like strings.xml. I figured this was a good 
enough first drop however and further merging complexity could be added later.

When merging the manifest files into the master I add everything verbatim 
except the sdk min/max version element. This I simply replace the values with 
the highest found of each. Again more complex merging could be added later to 
avoid duplicates in the manifest, specifically around configuration settings.

21-Extension.patch:

I've updated this sample to use a custom activity to open a browser (together 
with simple view transition and progress bar). I removed some of the code I 
believed wasn't really needed. Happy to add anything back in that you feel 
should be in there.

I also fixed up the JNI classpaths to use '/' instead  of '.' as that was 
causing runtime errors. Discussed here 
http://www.haxenme.org/community/forums/general-discussion/extensions2

Original issue reported on code.google.com by stead.m...@gmail.com on 14 Aug 2012 at 11:42

Attachments:

GoogleCodeExporter commented 9 years ago
I've moved this over to a pull request on GitHub as much easier to manage. This 
can be closed as a duplicate.

https://github.com/haxenme/NME/pull/16

Original comment by stead.m...@gmail.com on 31 Aug 2012 at 6:39