From 3b930619766b31788cdf0e3dae8cd32b638732e6 Mon Sep 17 00:00:00 2001 From: Marek Goldmann <goldmann@fedoraproject.org> Date: Fri, 11 May 2012 13:27:55 +0200 Subject: [PATCH] Allow to pacakge the index file into jar --- src/main/java/org/jboss/jandex/Main.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jboss/jandex/Main.java b/src/main/java/org/jboss/jandex/Main.java index c4c4915..b11eeee 100644 --- a/src/main/java/org/jboss/jandex/Main.java +++ b/src/main/java/org/jboss/jandex/Main.java @@ -40,6 +40,7 @@ public class Main { private boolean modify; private boolean verbose; private boolean dump; + private boolean jarFile; private File outputFile; private File source; @@ -68,7 +69,7 @@ public class Main { long start = System.currentTimeMillis(); Indexer indexer = new Indexer(); - Result result = (source.isDirectory()) ? indexDirectory(source, indexer) : JarIndexer.createJarIndex(source, indexer,modify,false,verbose); + Result result = (source.isDirectory()) ? indexDirectory(source, indexer) : JarIndexer.createJarIndex(source, indexer,modify,jarFile,verbose); double time = (System.currentTimeMillis() - start) / 1000.00; System.out.printf("Wrote %s in %.4f seconds (%d classes, %d annotations, %d instances, %d bytes)\n", result.getName(), time, result.getClasses(), result.getAnnotations(), result.getInstances(), result.getBytes()); } catch (Exception e) { @@ -166,6 +167,7 @@ public class Main { System.out.println(" -v verbose output"); System.out.println(" -m modify directory or jar instead of creating an external index file"); System.out.println(" -o name the external index file file-name"); + System.out.println(" -j export the index file to a jar file"); System.out.println(" -d dump the index file index-file-name"); System.out.println("\nThe default behavior, with no options specified, is to autogenerate an external index file"); } @@ -200,6 +202,10 @@ public class Main { verbose = true; optionCount++; break; + case 'j': + jarFile = true; + optionCount++; + break; case 'o': if (i >= args.length) throw new IllegalArgumentException("-o reuires an output file name"); -- 1.7.10.1