如何自动构建精简版和高级版的 android 版本? [英] How to automate android builds for lite and premium version?

查看:29
本文介绍了如何自动构建精简版和高级版的 android 版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种解决方案,让我无需手动操作即可构建 android 应用程序的精简版和高级版.我正在寻找的功能是:

I'm looking for a solutions which will allow me to build lite and premium versions of my android app without manual manipulations. The functionality I'm looking for is:

  • 自动重命名包
  • 在 AndroidManifest.xml 文件中更改主包名称.
  • 更改 java 或/和资源文件中的常量值或替换适合当前的文件应用程序版本.

谢谢.

推荐答案

我建议查看 Android 库项目来帮助解决这个问题.

I would suggest looking into Android Library Projects to help with this.

我将这种方法用于我的一个应用程序的精简版与免费版.我有一个库项目,其中包含应用程序的所有源代码和大部分资源,然后有 2 个项目使用第一个作为库项目,一个用于精简版,另一个用于完整版.

I use this approach for a Lite vs. Free edtions of one of my apps. I have a Library project that contains all of the source and most of the resources for the apps and then 2 projects that use the 1st as a library project, one for Lite and one for Full edition.

这两个依赖项目都有自己的资源和清单,允许命名空间不同,我可以根据版本交换不同的字符串、可绘制对象等.

The two dependent projects each have their own resources and manifest, allowing the namespace to be different and for me to swap in different strings, drawables, etc. depending on the edition.

我尝试了 Ant 方法,但它似乎比图书馆项目方法麻烦得多.希望有所帮助.

I tried the Ant approach but it seemed to be much more of a hassle than the Library project approach. Hope that helps.

注意 Ant 仍然用于构建每个项目,但不是分离版本解决方案的一部分.

Note that Ant is still used to build each of the projects, but not part of the solution for separating editions.

这篇关于如何自动构建精简版和高级版的 android 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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