@Test public void dumpGraph() throws Exception { List<Module> modules = new ArrayList<>(); modules.add(new GraphvizModule()); modules.add(new RuneLiteModule()); runelite.setClient(client); PluginManager pluginManager = new PluginManager(); pluginManager.loadCorePlugins(); for (Plugin p : pluginManager.getPlugins()) { modules.add(p); } File file = folder.newFile(); try (PrintWriter out = new PrintWriter(file, "UTF-8")) { Injector injector = Guice.createInjector(modules); GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class); grapher.setOut(out); grapher.setRankdir("TB"); grapher.graph(injector); } }
private static void maybeGraphGuiceDependencies(final Injector injector, final Class<? extends TextGroupEntryPoint> entryPointClass, final Parameters params) throws IOException { final Optional<File> dotFile = params.getOptionalCreatableFile(GRAPH_DEPENDENCIES_PARAM); if (dotFile.isPresent()) { final Injector grapherInjector = Guice.createInjector(new GraphvizModule()); final GraphvizGrapher grapher = grapherInjector.getInstance(GraphvizGrapher.class); // orient graph vertically grapher.setRankdir("TB"); log.info("Writing Guice configuration graph to {}. To compile it, do dot -T png {}", dotFile.get(), dotFile.get()); try (PrintWriter out = new PrintWriter(Files.asCharSink(dotFile.get(), Charsets.UTF_8) .openBufferedStream())) { grapher.setOut(out); grapher.graph(injector, ImmutableSet.<Key<?>>of(Key.get(entryPointClass))); } } }
public static void main(String[] args) throws Exception { // TODO(phopkins): Switch to Stage.TOOL when issue 297 is fixed. Injector demoInjector = Guice.createInjector( Stage.DEVELOPMENT, new BackToTheFutureModule(), new MultibinderModule(), new PrivateTestModule()); PrintWriter out = new PrintWriter(new File(args[0]), "UTF-8"); Injector injector = Guice.createInjector(new GraphvizModule()); GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class); grapher.setOut(out); grapher.setRankdir("TB"); grapher.graph(demoInjector); }
public void writeGraph(File file, Injector injector) throws IOException { final PrintWriter out = new PrintWriter(file, Charsets.UTF_8.name()); final GraphvizGrapher grapher = Guice.createInjector(new GraphvizModule()).getInstance(GraphvizGrapher.class); grapher.setOut(out); grapher.setRankdir("TB"); grapher.graph(injector); }
private static void writeDotFile(String filename, Injector demoInjector) throws IOException { PrintWriter out = new PrintWriter(new File(filename), "UTF-8"); com.google.inject.Injector injector = Guice.createInjector(new GraphvizModule()); GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class); grapher.setOut(out); grapher.setRankdir("TB"); grapher.graph(demoInjector); }
public void graph(String filename, Injector demoInjector) throws IOException { PrintWriter out = new PrintWriter(new File(filename), Charsets.UTF_8.name()); Injector injector = Guice.createInjector(new GraphvizModule()); GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class); grapher.setOut(out); grapher.setRankdir("TB"); grapher.graph(demoInjector); }
public void graph(String filename, Injector demoInjector) throws IOException { PrintWriter out = new PrintWriter(new File(filename), Charsets.UTF_8_NAME); Injector injector = Guice.createInjector(new GraphvizModule()); GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class); grapher.setOut(out); grapher.setRankdir("TB"); grapher.graph(demoInjector); }
public static void main(String[] args) throws Exception { // TODO(phopkins): Switch to Stage.TOOL when issue 297 is fixed. Injector demoInjector = Guice.createInjector(Stage.DEVELOPMENT, new BackToTheFutureModule(), new MultibinderModule(), new PrivateTestModule()); PrintWriter out = new PrintWriter(new File(args[0]), "UTF-8"); Injector injector = Guice.createInjector(new GraphvizModule()); GraphvizGrapher grapher = injector.getInstance(GraphvizGrapher.class); grapher.setOut(out); grapher.setRankdir("TB"); grapher.graph(demoInjector); }