cd .\src\test\
*
make clean compile-raupenpiler
*
Start Raupenpiler using jar: - *
java.exe -jar .\target\JavaCompiler-1.0-SNAPSHOT-jar-with-dependencies.jar 'path_to_input_file.java' 'path_to_output_directory'
- *
Example: + *
java.exe -jar path_to_jar\JavaCompiler-1.0-SNAPSHOT-jar-with-dependencies.jar 'path_to_input_file.java' 'path_to_output_directory'
+ *
Example (jar needs to be in the target directory, compile with make or mvn package first):
* java.exe -jar .\target\JavaCompiler-1.0-SNAPSHOT-jar-with-dependencies.jar 'src/main/resources/input/CompilerInput.java' 'src/main/resources/output'
*/
public class Main {
public static void main(String[] args) throws Exception {
- if (args.length > 0) {
+ if (args.length == 2) {
// args[0] is the input file path
// args[1] is the output directory path
String inputFilePath = args[0];
@@ -41,7 +41,7 @@ public class Main {
System.err.println("Error reading the file: " + e.getMessage());
}
}
- /* !!! Else Branch ist nicht zur Verwendung vorgesehen, immer mit args starten !!!
+ /* !!! Else Branch (main ohne args starten) ist nicht zur Verwendung vorgesehen, immer mit args starten !!!
else {
try {
CharStream codeCharStream = CharStreams.fromPath(Paths.get("src/main/resources/input/CompilerInput.java"));