< prev index next >

make/src/classes/build/tools/jigsaw/GenGraphs.java

Print this page




 136 
 137     GenGraphs(Path dir, Set<ModuleDescriptor> javaGroup, Set<ModuleDescriptor> jdkGroup) {
 138         this.dir = dir;
 139         this.javaGroup = Collections.unmodifiableSet(javaGroup);
 140         this.jdkGroup = Collections.unmodifiableSet(jdkGroup);
 141     }
 142 
 143     /**
 144      * Generates a dot file for the given module reference as the root.
 145      */
 146     void genDotFile(ModuleReference mref) throws IOException {
 147         String name = mref.descriptor().name();
 148         genDotFile(name, Set.of(name));
 149     }
 150 
 151     /**
 152      * Generates a dot file for the given set of root modules.
 153      */
 154     void genDotFile(String name, Set<String> roots) throws IOException {
 155         Configuration cf =
 156             Configuration.empty().resolveRequires(ModuleFinder.ofSystem(),
 157                                                   ModuleFinder.of(),
 158                                                   roots);
 159 
 160         Set<ModuleDescriptor> mds = cf.modules().stream()
 161                 .map(ResolvedModule::reference)
 162                 .map(ModuleReference::descriptor)
 163                 .collect(toSet());
 164 
 165         // generate a dot file for the resolved graph
 166         try (OutputStream os = Files.newOutputStream(dir.resolve(name + ".dot"));
 167              PrintStream out = new PrintStream(os)) {
 168             printGraph(out, name, gengraph(cf),
 169                        mds.stream()
 170                           .collect(toMap(ModuleDescriptor::name, Function.identity()))
 171             );
 172         }
 173 
 174         if (name.equals("java.se") || name.equals("java.se.ee")) {
 175             // generate a dot file for Java SE module graph
 176             try (OutputStream os = Files.newOutputStream(dir.resolve(name + "-spec.dot"));




 136 
 137     GenGraphs(Path dir, Set<ModuleDescriptor> javaGroup, Set<ModuleDescriptor> jdkGroup) {
 138         this.dir = dir;
 139         this.javaGroup = Collections.unmodifiableSet(javaGroup);
 140         this.jdkGroup = Collections.unmodifiableSet(jdkGroup);
 141     }
 142 
 143     /**
 144      * Generates a dot file for the given module reference as the root.
 145      */
 146     void genDotFile(ModuleReference mref) throws IOException {
 147         String name = mref.descriptor().name();
 148         genDotFile(name, Set.of(name));
 149     }
 150 
 151     /**
 152      * Generates a dot file for the given set of root modules.
 153      */
 154     void genDotFile(String name, Set<String> roots) throws IOException {
 155         Configuration cf =
 156             Configuration.empty().resolve(ModuleFinder.ofSystem(),
 157                                           ModuleFinder.of(),
 158                                           roots);
 159 
 160         Set<ModuleDescriptor> mds = cf.modules().stream()
 161                 .map(ResolvedModule::reference)
 162                 .map(ModuleReference::descriptor)
 163                 .collect(toSet());
 164 
 165         // generate a dot file for the resolved graph
 166         try (OutputStream os = Files.newOutputStream(dir.resolve(name + ".dot"));
 167              PrintStream out = new PrintStream(os)) {
 168             printGraph(out, name, gengraph(cf),
 169                        mds.stream()
 170                           .collect(toMap(ModuleDescriptor::name, Function.identity()))
 171             );
 172         }
 173 
 174         if (name.equals("java.se") || name.equals("java.se.ee")) {
 175             // generate a dot file for Java SE module graph
 176             try (OutputStream os = Files.newOutputStream(dir.resolve(name + "-spec.dot"));


< prev index next >