Skip to content

Commit

Permalink
added two print functions to PathConfig for reuse purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Sep 25, 2024
1 parent 4b6dcb9 commit 6637721
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/org/rascalmpl/library/util/PathConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -781,6 +782,32 @@ private static String computeMavenCommandName() {
}
}

/**
* Prints what users need to know about how the interpreter is configured with this PathConfig
*/
public void printInterpreterConfigurationStatus(PrintWriter out) {
out.println("Module paths:");
getSrcs().forEach((f) -> out.println(" ".repeat(4) + f));
out.println("JVM library classpath:");
getLibsAndTarget().forEach((l) -> out.println(" ".repeat(4) + l));
out.flush();
}

/**
* Prints what users need to know about how the compiler is configured with this PathConfig
*/
public void printCompilerConfigurationStatus(PrintWriter out) {
out.println("Source paths:");
getSrcs().forEach((f) -> out.println(" ".repeat(4) + f));
out.println("Compiler target folder:");
out.println(" ".repeat(4) + getBin());
out.println("Compiler generated sources folder:");
out.println(" ".repeat(4) + getGeneratedSources());
out.println("Rascal and Java library classpath:");
getLibsAndTarget().forEach((l) -> out.println(" ".repeat(4) + l));
out.flush();
}

private static void installNecessaryMavenPlugins(String mvnCommand) throws IOException {
try {
ProcessBuilder processBuilder = new ProcessBuilder(mvnCommand,
Expand Down

0 comments on commit 6637721

Please sign in to comment.