From 8cc67080ecd2f22608ce4650538314d6159a6560 Mon Sep 17 00:00:00 2001 From: Lucas <89882946+notbad3500@users.noreply.github.com> Date: Wed, 19 Jun 2024 17:09:38 +0200 Subject: [PATCH] Small changes --- .gitignore | 4 ++++ pom.xml | 5 ++--- src/main/java/main/Main.java | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8f74459..8c5079b 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,7 @@ fabric.properties /target src/main/resources/logs/RaupenLog.log src/main/resources/output/CompilerInput.class +src/test/resources/output/javac/CompilerInput$Test.class +src/test/resources/output/javac/CompilerInput.class +src/test/resources/output/raupenpiler/CompilerInput.class +src/test/resources/output/raupenpiler/CompilerInput$Test.class diff --git a/pom.xml b/pom.xml index 27cbd7f..0baf035 100644 --- a/pom.xml +++ b/pom.xml @@ -4,9 +4,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.example + de.dhbw-stuttgart JavaCompiler - 1.0-SNAPSHOT + 1.0 22 @@ -69,5 +69,4 @@ - \ No newline at end of file diff --git a/src/main/java/main/Main.java b/src/main/java/main/Main.java index 5384677..8b858b4 100644 --- a/src/main/java/main/Main.java +++ b/src/main/java/main/Main.java @@ -20,15 +20,15 @@ import java.nio.file.Paths; *

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"));