Skip to content

Commit

Permalink
Merge pull request #32 from moosetechnology/fix-bat
Browse files Browse the repository at this point in the history
Fix bat + add pretty printer
  • Loading branch information
badetitou authored Sep 9, 2021
2 parents a073f7c + 8341181 commit 0060eb5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
Binary file modified lib/fame.jar
Binary file not shown.
Binary file modified lib/verveine.extractor.java.jar
Binary file not shown.
16 changes: 11 additions & 5 deletions src/fr/inria/verveine/extractor/java/VerveineJOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ public static AnchorOptions getValue(String option) {
*/
protected boolean incrementalParsing;

/**
* If possible, should I use a prettyPrinter
*/
protected boolean prettyPrint = false;

public VerveineJOptions() {
this.classSummary = false;
this.allLocals = false;
Expand Down Expand Up @@ -185,12 +190,12 @@ else if (arg.matches("-1\\.[1-7]") || arg.matches("-[1-7]")) {
else if (arg.equals("-summary")) {
classSummary = true;
allLocals = false;
}
else if (arg.equals("-alllocals")) {
} else if (arg.equals("-alllocals")) {
classSummary = false;
allLocals = true;
}
else if ( (arg.charAt(0) == '-') && (arg.endsWith("cp")) ) {
} else if (arg.equals("-prettyPrint")) {
prettyPrint = true;
} else if ((arg.charAt(0) == '-') && (arg.endsWith("cp"))) {
classPathOptions = setOptionClassPath(classPathOptions, args, i);
argumentsTreated++;
} else if (arg.equals("-anchor")) {
Expand Down Expand Up @@ -330,11 +335,12 @@ protected void usage() {
* some new relation: classdep
*/

System.err.println("Usage: VerveineJ [-h] [-i] [-o <output-file-name>] [-summary] [-alllocals] [-anchor (none|default|assoc)] [-cp CLASSPATH | -autocp DIR] [-1.1 | -1 | -1.2 | -2 | ... | -1.7 | -7] <files-to-parse> | <dirs-to-parse>");
System.err.println("Usage: VerveineJ [-h] [-i] [-o <output-file-name>] [-prettyPrint] [-summary] [-alllocals] [-anchor (none|default|assoc)] [-cp CLASSPATH | -autocp DIR] [-1.1 | -1 | -1.2 | -2 | ... | -1.7 | -7] <files-to-parse> | <dirs-to-parse>");
System.err.println(" [-h] prints this message");
System.err.println(" [-i] toggles incremental parsing on (can parse a project in parts that are added to the output file)");
System.err.println(" [-o <output-file-name>] specifies the name of the output file (default:" + OUTPUT_FILE + ")");
System.err.println(" [-format (mse|json)] specifies the output format (default:" + MSE_OUTPUT_FORMAT + ")");
System.err.println(" [-prettyPrint] toggles the usage of the json pretty printer");
System.err.println(" [-summary] toggles summarization of information at the level of classes.");
System.err.println(" Summarizing at the level of classes does not produce Methods, Attributes, Accesses, and Invocations");
System.err.println(" Everything is represented as references between classes: e.g. \"A.m1() invokes B.m2()\" is uplifted to \"A references B\"");
Expand Down
6 changes: 5 additions & 1 deletion src/fr/inria/verveine/extractor/java/VerveineJParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ public void exportmodel(OutputStream output) {
if (this.options.outputFormat.equalsIgnoreCase(VerveineJOptions.MSE_OUTPUT_FORMAT)) {
famixRepo.exportMSE(writer);
} else if (this.options.outputFormat.equalsIgnoreCase(VerveineJOptions.JSON_OUTPUT_FORMAT)) {
famixRepo.exportJSON(writer);
if (this.options.prettyPrint) {
famixRepo.exportPrettyJSON(writer);
} else {
famixRepo.exportJSON(writer);
}
}
writer.close();
} catch (IOException e) {
Expand Down
3 changes: 2 additions & 1 deletion verveinej.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ rem set VOPT="."
FOR /R %BASELIB% %%G IN (*.jar) DO set LOCALCLASSPATH=%%G;!LOCALCLASSPATH!
set CLASSPATH=%CLASSPATH%;%LOCALCLASSPATH%

java %JOPT% fr.inria.verveine.extractor.java.VerveineJMain %*

java -Dfile.encoding=UTF-8 %JOPT% fr.inria.verveine.extractor.java.VerveineJMain %*

0 comments on commit 0060eb5

Please sign in to comment.