与Maven Android插件变量包名 [英] Variable package name with Maven Android Plugin

查看:168
本文介绍了与Maven Android插件变量包名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Maven Android插件来构建我的应用程序。

I'm using the Maven Android Plugin to build my application.

其实,我要建3品牌版本的同一应用程序的(应用程序图标,颜色,等等的变化,而不是功能)。我知道,我需要使用不同的包名称为每个应用程序,它们被认为是不同的。

Actually, I'm building 3 "branded" versions of the same app (the app icon, colors, etc... change, but not the features). I'm aware that I need to use a different package name for each application, for them to be considered as different.

到目前为止,我已经成功地拥有动态的价值观,使用Maven过滤器的strings.xml:

So far I have managed to have "dynamic" values, using Maven filters in strings.xml :

<string name="app_name">${app_name}</string>
<string name="widget_name">${widget_name}</string>
<string name="app_icon">${app_icon}</string>

现在的问题是,这并不为包名工作!如果我做的:

The problem is that this does not work for the package name ! If I do :

<manifest package="${foo.bar}">

ADT(好,XML验证实际上)说笙歌的属性包有非法字符$

我找不到任何办法解决这个......有没有办法告诉ADT启动Maven的资源,过滤或类似的东西?

I can't find any workaround for this... Is there a way to tell ADT to launch the Maven resources filtering or something like that ?

推荐答案

在进一步的研究,这似乎是相当容易!

After further research, it appears to be fairly easy !

您只需要添加&LT; renameManifestPackage&GT; 中的Maven Android插件的配置。似乎工作起始版本> 2.9.0:

You just need to add <renameManifestPackage> in the configuration of the Maven Android Plugin. Seems to work starting at version > 2.9.0 :

<plugin>
    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
    <artifactId>maven-android-plugin</artifactId>
    <version>2.9.0-beta-5</version>
    <configuration>
        ...
        <renameManifestPackage>${manifest_package}</renameManifestPackage>
    </configuration>
</plugin>

这篇关于与Maven Android插件变量包名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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