f57f787409082821f3c986f151963a8b7c587ec6
[javainspect.git] / src / main / java / eu / svjatoslav / inspector / java / Main.java
1 package eu.svjatoslav.inspector.java;
2
3 import eu.svjatoslav.inspector.java.structure.ClassGraph;
4
5 import static java.io.File.separator;
6 import static java.lang.System.getProperty;
7
8 public class Main {
9         public static void main(String[] args) {
10                 if (args.length == 0) {
11                         System.err.println("usage: javainspect [PROJECT_DIR] [PACKAGE_GLOB] [GRAPH_NAME]");
12                         System.exit(1);
13                 }
14
15                 String projectDir  = args[0];
16                 String packageGlob = args[1];
17                 String graphName   = args[2];
18
19                 ClassGraph cg = new ClassGraph();
20                 cg.setTargetDirectoryPath(getProperty("user.dir") + separator);
21
22                 cg.addProject(projectDir);
23                 cg.whitelistClassPattern(packageGlob);
24                 cg.setKeepDotFile(true);
25                 cg.generateGraph(graphName);
26
27                 System.exit(0);
28         }
29 }