开发者

Eclipse : Specify multiple res directories like specifying multiple src directories

开发者 https://www.devze.com 2023-02-27 05:54 出处:网络
I need to brand my application, and only few images need to be customized, the codebase is the same except few generated constants.

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="androidre开发者_如何学Cs" path="res/brand/mybrand_a" />

Or is there any other mean to do that?

Thanks


Have you tried using symlinks from your brand-specific dirs to the main res/ dir?


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消