commit 696e7f3d504d5675d993ea359260dc67d89d8714 Author: John Sirois Date: Mon Apr 13 13:09:35 2015 -0600 Initial port of twitter/commons jar-tool. Copy jar-tool in from twitter/commons. This ports the jar-tool used by pants but does not actually configure pants to use the ported tool. That will come later after the tool is published: https://github.com/pantsbuild/pants/issues/1361 The jar-tool in twitter/commons will be deleted after this tool is published and consumed by pants HEAD. Testing Done: Locally dogfooded the jar-tool to build itself comparing before/after: ```console $ PANTS_DEV=1 ./pants clean-all binary src/java/org/pantsbuild/tools/jar:main $ cp dist/jar-tool.jar dist/jar-tool.created-by.c.t.c.jar $ git diff diff --git a/BUILD.tools b/BUILD.tools index 81fc8d8..b233485 100644 --- a/BUILD.tools +++ b/BUILD.tools @@ -152,7 +152,8 @@ jar_library(name = 'spindle-codegen', jar_library(name = 'jar-tool', jars = [ - jar(org = 'com.twitter.common', name = 'jar-tool', rev = '0.1.9') + jar(org = 'com.twitter.common', name = 'jar-tool', rev = 'none', mutable=True, + url='file:///home/jsirois/dev/3rdparty/jsirois-pants4/dist/jar-tool.jar') ]) jar_library(name = 'jarjar', diff --git a/src/python/pants/backend/jvm/tasks/jar_task.py b/src/python/pants/backend/jvm/tasks/jar_task.py index 438e1e5..7298fac 100644 --- a/src/python/pants/backend/jvm/tasks/jar_task.py +++ b/src/python/pants/backend/jvm/tasks/jar_task.py @@ -288,7 +288,7 @@ class JarTask(NailgunTask): # need the same JVM args as its parent. jvm_options = self.context.config.getlist('jar-tool', 'jvm_args', default=['-Xmx64M']) self.runjava(self.tool_classpath('jar-tool'), - 'com.twitter.common.jar.tool.Main', + 'org.pantsbuild.tools.jar.Main', jvm_options=jvm_options, args=args, workunit_name='jar-tool',$ $ PANTS_DEV=1 ./pants clean-all binary src/java/org/pantsbuild/tools/jar:main $ mkdir /tmp/jar-tool.jar /tmp/jar-tool.created-by.c.t.c.jar $ unzip -qd /tmp/jar-tool.created-by.c.t.c.jar dist/jar-tool.created-by.c.t.c.jar $ unzip -qd /tmp/jar-tool.jar dist/jar-tool.jar $ diff -r /tmp/jar-tool.created-by.c.t.c.jar /tmp/jar-tool.jar diff -r /tmp/jar-tool.created-by.c.t.c.jar/META-INF/MANIFEST.MF /tmp/jar-tool.jar/META-INF/MANIFEST.MF 2c2 < Created-By: com.twitter.common.jar.tool.JarBuilder --- > Created-By: org.pantsbuild.tools.jar.JarBuilder ``` CI went green here: https://travis-ci.org/pantsbuild/pants/builds/58311252 Bugs closed: 1362, 1415 Reviewed at https://rbcommons.com/s/twitter/r/2071/ .../pantsbuild/args4j/ArgfileOptionHandler.java | 67 +++++++++++ .../pantsbuild/args4j/BooleanOptionHandler.java | 64 +++++++++++ .../pantsbuild/args4j/CollectionOptionHandler.java | 73 ++++++++++++ src/java/org/pantsbuild/args4j/Parser.java | 128 +++++++++++++++++++++ 4 files changed, 332 insertions(+)