Ok I am switching from ant to maven on an android project and wondering if it the following would be easy to implement:
Currently I have a custom build.xml script wh
In Maven, this is called resource filtering, android-maven-plugin support filtering the following resource types:
Sample res/value/config.xml:
${config.server.url}
Sample pom configuration for filtering all xml file under res/ directory:
${project.basedir}/res
true
${project.build.directory}/filtered-res
**/*.xml
maven-resources-plugin
initialize
resources
com.jayway.maven.plugins.android.generation2
android-maven-plugin
true
10
true
${project.build.directory}/filtered-res
There are several ways to define the substituted value, you can define them in an external properties file with properties-maven-plugin. For simplicity, I prefer to use Maven profiles and define them in pom.xml, like so:
dev
dev.company.com
Test
test.company.com
Prod
prod.company.com
Then use mvn clean install -Pxxx to build corresponding apk.