Secret Staircase

zip ファイルの diff を取る

zip ファイルの diff を取るプログラムを Scala で書きました。github にあります。

使用例:

$ java -jar **/diff-zip_*-one-jar.jar commons-lang-2.5.jar commons-lang-2.6.jar
Files exist only in commons-lang/2.5/commons-lang-2.5.jar
===========================================

Files exist only in commons-lang/2.6/commons-lang-2.6.jar
===========================================
org/apache/commons/lang/exception/CloneFailedException.class

Files exist in both but not same
===========================================
META-INF/MANIFEST.MF
META-INF/NOTICE.txt
META-INF/maven/commons-lang/commons-lang/pom.properties
META-INF/maven/commons-lang/commons-lang/pom.xml
...

Ant -> Maven や Maven1 -> Maven2/3 移行時に同じ war が作成されることの確認に使うと便利かも。

まとめ

  • 実行可能なスタンドアローン jar を作るために sbt-one-jar を使いました。手軽でよい。
  • コマンドライン引数解析に argot を使いました。ヘルプを自動生成してくれたりして便利。
  • 車輪の再発明楽しい zipdiff