mardi 1 juillet 2014

Maven + Android: exchange resources based on profile


Vote count:

0




I am using the android-maven-plugin version 3.9.0-rc.1. There are differnt resources for different releases. The respective resources should be copied to the "target" based on the maven profile used for the build. For that I'm using the maven-resources-plugin as follows:



<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/res</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${basedir}/releaseconfigs/beta</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>


This has no effect on the resources that are packed in the .apk. There is however a folder "bin" in the basedir containing a res/crunch/ folder that containing the resources that I want replaced. So I set the outupdirectory to that folder, but this still has no effect on the resources that are packed within the .apk.


Right now my only solution would be to copy them to the basedir/res folder during the validation phase and copy the "original" files back during the install phase or something. But this doesn't seem all too elegant.



asked 34 secs ago

fancy

374





Aucun commentaire:

Enregistrer un commentaire