Makes the generated module-info.java files reproducible (removes a captured build...
authorEmmanuel Bourg <ebourg@apache.org>
Thu, 17 Oct 2024 08:59:51 +0000 (10:59 +0200)
committerMatthias Klose <doko@ubuntu.com>
Thu, 17 Oct 2024 08:59:51 +0000 (10:59 +0200)
Forwarded: no

Gbp-Pq: Name reproducible-module-info.diff

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

index ce9b94db7a627f1b6300022bc52103d33c3b578f..fa34d92228c8d7e33f0ff4926991383a73060443 100644 (file)
@@ -156,9 +156,10 @@ public class GenModuleInfoSource {
                 if (l.trim().startsWith("module ")) {
                     if (debug) {
                         // print URI rather than file path to avoid escape
-                        writer.format("    // source file: %s%n", sourceFile.toUri());
+                       String buildPath = System.getProperty("user.dir").replaceAll("make$", "");
+                       writer.format("    // source file: %s%n", sourceFile.toUri().toString().replace(buildPath, ""));
                         for (Path file : extraFiles) {
-                            writer.format("    //              %s%n", file.toUri());
+                           writer.format("    //              %s%n", file.toUri().toString().replace(buildPath, ""));
                         }
                     }
                     break;