2012-03-05 7 views
2

Maven 3を使用して、Androidアプリケーションのビルドとリリースサイクルを管理します。リリース中、Proguard Mavenプラグインを使用してアプリケーションソースを難読化します。理想的には、リリースプロセス中に、更新されたProguardの難読化マッピングをgitリポジトリにコミットすることをお勧めします。私は現在、リリースリポジトリにプッシュされた成果物にマッピングを添付していますが、可能であれば、gitでマッピングを維持したいと考えています。Maven 3のリリース中に更新されたProguardマッピングをコミットします

これを行うにはどのような方法が最適ですか?

答えて

1

私が正しく理解していれば、@ khmarbaiseの解決策では十分ではないように構成を渡す必要があります。私はproguardマッピングが作成された直後に添付されたリリースプロファイルでmaven-scmプラグインを使用することをお勧めします。 http://maven.apache.org/scm/maven-scm-plugin/add-mojo.html

、その後、おそらく 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> 
をあなたはマッピングファイルを追加することになるでしょう

0

コミットが発生する前に、ドキュメントに記載されているmaven-release-pluginで目標を実行できます。

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-release-plugin</artifactId> 
    <version>2.2.2</version> 
    <configuration> 
     <preparationGoals>clean verify</preparationGoals> 
    </configuration> 
</plugin> 
関連する問題