我使用 Maven 3 来管理我的 Android 应用程序的构建和发布周期。在发布期间,使用 Proguard maven 插件对应用程序源进行混淆处理。理想情况下,我希望在发布过程中将更新的 Proguard 混淆映射提交到 git 存储库中。我目前将映射附加到推送到发布存储库的 Artifact ,但我想尽可能将映射保留在 git 中。
执行此操作的最佳方法是什么?
最佳答案
如果我理解正确,您需要传递配置,所以来自@khmarbaise 的解决方案是不够的。我建议在创建 proguard 映射后立即在附加的发布配置文件中使用 maven-scm 插件。
您需要添加映射文件: http://maven.apache.org/scm/maven-scm-plugin/add-mojo.html
然后 checkin http://maven.apache.org/scm/maven-scm-plugin/checkin-mojo.html
也许是这样的:
<profiles>
<profile>
<id>release</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-scm-plugin</artifactId>
...
<configuration>
... add your scm setup here ...
</configuration>
<executions>
<execution>
<id>addMap</id>
<phase>install</phase>
<goals>
<goal>add</goal>
</goals>
</execution>
<execution>
<id>commitMap</id>
<phase>install</phase>
<goals>
<goal>checkin</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
</profile>
</profiles>
关于android - 在 Maven 3 发布期间提交更新的 Proguard 映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9569224/