Reputation: 1369
I need to brand my application, and only few images need to be customized, the codebase is the same except few generated constants.
As aapt allows to specify many resource directories, is there any way to specify res directories in Eclipse .classpath file? Something like
<classpathentry kind="androidres" path="res/common" />
<classpathentry kind="androidres" path="res/brand/mybrand_a" />
Or is there any other mean to do that?
Thanks
Upvotes: 8
Views: 2358
Reputation: 495
I have no trouble making aapt use multiple resource directories. The target for building the resources in my ant build.xml contains what is shown below, and the branded resources take precedence over the non-branded ones. I don't see any way to do the equivalent for building with Eclipse, however.
<exec executable="${aapt}" failonerror="true">
<arg value="package" />
<arg value="-m" />
<arg value="-J" />
<arg path="${folder.gen}" />
<arg value="-M" />
<arg path="AndroidManifest.xml" />
<arg value="-I" />
<arg path="${android.jar}" />
<arg value="-A" />
<arg path="${location.assets.branded}" />
<arg value="-S" />
<arg path="${location.res.branded}" />
<arg value="-S" />
<arg path="${location.resource}" />
</exec>
Upvotes: 0
Reputation: 1516
Have you tried using symlinks from your brand-specific dirs to the main res/
dir?
Upvotes: 1