剥皮与Maven Android应用程序建立配置文件 [英] Skinning Android app with Maven build profiles

查看:137
本文介绍了剥皮与Maven Android应用程序建立配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Maven化Android应用程序和客户想要的剥皮在构建时的支持。

I've got mavenized Android application and customer wants support for the skinning at build time.

例如: MVN全新安装-P开发, MVN全新安装-P的customer1, MVN全新安装-P的customer2

For example: mvn clean install -P Developer, mvn clean install -P Customer1, mvn clean install -P Customer2

在换句话说,不同客户的需求有点不同的图像,不同的字符串(的appName,版权等),同时,一些布局元素应该被隐藏或显示(开发者配置文件),因此不同的布局了。

In other words, different customer needs little bit different set of images, different strings (appName, copyright, etc) and also, some of the elements in layouts should be hidden or shown (Developer profile), so different layouts too.

我首先想到的是有像RES-的customer1,RES-中的customer2标准res目录并行文件夹和做在pom.xml的配置文件定义的互换,也将其重命名为资源,但似乎并没有工作。我总是得到原来的资源文件夹到构建在这种情况下,重复错误。

My first thought was to have folders like res-customer1, res-customer2 in parallel with standard res directory and do the swap in profile definition in pom.xml, also rename it to res, but that doesn't seem to work. I always get original res folder into the build and in this case, duplicates error.

这是否意味着交换应采取水库内的地方吗?我并没有在Android的Maven插件配置指定resourceDirectory。

Does this mean that swapping should take place inside of the res? I didn't specify resourceDirectory in configuration of android maven plugin.

我一直在Google上搜寻了很多,但到目前为止,我没有发现任何人有同样的问题。如何解决呢?有什么一般模式是什么?

I've been googling a lot, but so far, I didn't find anybody with same issue. How to solve it? Is there any general pattern for that?

在预先感谢

推荐答案

如果您要使用不同的资产或资源,不同的打造专业化的配置文件,如果你甚至要合并的每个多个这样的目录建立不同的,你可以按照这个伟大的博客文章:

If you want to use different assets or resources for different buid profiles and if you even want to merge multiple such directories of each build differently, you can follow this great blog post:

http://tech.ebuddy.com / 2013/04/08 /品牌 - Android的建立,使用Maven的/

这篇关于剥皮与Maven Android应用程序建立配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆