问题
I currently distribute my Android apps on Android Market, SlideMe and Amazon app store. Android Market and SlideMe require a signed binary, while Amazon requires an unsigned one. I also need to differentiate some of the code to be compiled depending on which store I'm targeting. Currently I only need to display different text/link information, but in the future there may be a need to change things like included libraries.
I am using Eclipse on Windows to build my projects. I am looking for the easiest way to conditionally compile the code and create multi-target builds as required for each store.
I don't need the builds to be triggered automatically by commits or timers or anything of that nature. I only need to trigger the builds manually.
Appreciate any suggestions.
回答1:
You might find that Jenkins will help with this. It supports parameterised builds, plus also matrix builds. Matrix builds multidimensional parameterised builds - you specify a series of sets of values, and every combination is built.
eg:
- Language (US English, UK English, French)
- Appstore (Amazon, Android, SlideMe)
Jenkins would build all the combinations of above.
Obviously you will still need an Ant build script to do the hard work, but I believe Android's SDK has reasonable support for Ant.
回答2:
You could just set up a Maven Android Plugin based build for your apk that uses resource filtering and profiles for your different configurations. Check the morseflash example of the official samples project to see how it is all done in detail.
Once you have the profiles set up you can use the maven invoker plugin to run it all in one sweep. And if you want to have it automated just put the build on Hudson.
http://code.google.com/p/maven-android-plugin/
http://code.google.com/p/maven-android-plugin/wiki/Samples
http://www.simpligility.com/2010/11/release-version-management-for-your-android-application/
来源:https://stackoverflow.com/questions/5731676/build-all-binaries-for-different-android-app-stores-in-a-single-step