Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

This is a real noob question. I work for a company that makes 100's of apps that use much of the same components. There is some minor customization at build time and we would like to speed that up to increase efficiency. The majority of the customization is done at runtime downloading data from a server.

The fastest that we can get a project to a finish .apk is about 15 minutes. This process involves changing package names, icons, and a couple of string resources. But when you're dealing with 15-20 apps a day that can become a real time killer and I'd rather spend my time writing new code.

I've read about using Maven or Gradle to streamline the build process but am not really sure if this the best way to go about decreasing build time. Frankly I don't even know if they are the appropriate tools or not.

Can someone please explain to me if using one of these tools would accomplish what I'm looking for or if there is some other way to decrease build times? Any suggestion would be appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
229 views
Welcome To Ask or Share your Answers For Others

1 Answer

Adopting some command-line build tools like Maven or Ant is definitely the right direction to go, it enables the possibilities of batching build process using Unix/Windows shell scripts.

Those minor customization you required are quite easy to achieve using maven-properties-plugin and android-maven-plugin together. android-maven-plugin support resource filtering. you can define your customized properties for each build cycle into several properties files, during the build process, android-maven-plugin can read those value from external properties file and substitute those value in AndroidManifest.xml and other resource file like res/values/strings.xml. android-maven-plugin also fully support Android Library Project, which let you extract/centralize common android code and manage all of them easily.

Suppose you want to build 5 apk distributions from a same Android Project with different package/app name, app icon and some resources in string.xml, you can create shell script run mvn deploy 5 time,with each time copy one of your customize.properties with proper other icon.png files into the project directory and overwrite the existing one. this gives you an end-to-end auto build batch processing that doesn't need any human interaction.

You can find a sample project MorseFlash examine the resource filtering used by android-maven-plugin.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...