< prev index next >

make/jdk/src/classes/build/tools/module/GenModuleInfoSource.java

Print this page
rev 52923 : 8226346: Build better binary builders
Reviewed-by: andrew

@@ -55,15 +55,18 @@
  *
  * @see build.tools.module.ModuleInfoExtraTest for basic testing
  */
 public class GenModuleInfoSource {
     private final static String USAGE =
-        "Usage: GenModuleInfoSource -o <output file> \n" +
+            "Usage: GenModuleInfoSource \n" +
+                    " [-d]\n" +
+                    " -o <output file>\n" +
         "  --source-file <module-info-java>\n" +
         "  --modules <module-name>[,<module-name>...]\n" +
         "  <module-info.java.extra> ...\n";
 
+    static boolean debug = false;
     static boolean verbose = false;
     public static void main(String... args) throws Exception {
         Path outfile = null;
         Path moduleInfoJava = null;
         Set<String> modules = Collections.emptySet();

@@ -71,10 +74,13 @@
         // validate input arguments
         for (int i = 0; i < args.length; i++){
             String option = args[i];
             String arg = i+1 < args.length ? args[i+1] : null;
             switch (option) {
+                case "-d":
+                    debug = true;
+                    break;
                 case "-o":
                     outfile = Paths.get(arg);
                     i++;
                     break;
                 case "--source-file":

@@ -144,15 +150,17 @@
              PrintWriter writer = new PrintWriter(bw)) {
             // write the copyright header and lines up to module declaration
             for (String l : lines) {
                 writer.println(l);
                 if (l.trim().startsWith("module ")) {
+                    if (debug) {
                     // print URI rather than file path to avoid escape
                     writer.format("    // source file: %s%n", sourceFile.toUri());
-                    for (Path file: extraFiles) {
+                        for (Path file : extraFiles) {
                         writer.format("    //              %s%n", file.toUri());
                     }
+                    }
                     break;
                 }
             }
 
             // requires
< prev index next >