Quellcode durchsuchen

Remove overridden config for maven-compiler-plugin

boono vor 6 Monaten
Ursprung
Commit
af81f7c6ed
3 geänderte Dateien mit 21 neuen und 36 gelöschten Zeilen
  1. 14 14
      hw.bf
  2. 0 16
      pom.xml
  3. 7 6
      src/main/java/xyz/kwiecien/jfuck/BFCompiler.java

+ 14 - 14
hw.bf

@@ -1,17 +1,17 @@
 ++++++++++
 [
 >+++++++>++++++++++>+++>+<<<<-
-] Na początek ustawiamy kilka przydatnych później wartości
->++.               drukuje 'H'
->+.                drukuje 'e'
-+++++++.           drukuje 'l'
-.                  drukuje 'l'
-+++.               drukuje 'o'
->++.               spacja
-<<+++++++++++++++. drukuje 'W'
->.                 drukuje 'o'
-+++.               drukuje 'r'
-------.            drukuje 'l'
---------.          drukuje 'd'
->+.                drukuje '!'
->.                 nowa linia
+] helpful values for later
+>++.               'H'
+>+.                'e'
++++++++.           'l'
+.                  'l'
++++.               'o'
+>++.               ' '
+<<+++++++++++++++. 'W'
+>.                 'o'
++++.               'r'
+------.            'l'
+--------.          'd'
+>+.                '!'
+>.                 '\n'

+ 0 - 16
pom.xml

@@ -22,21 +22,5 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.13.0</version>
-                <configuration>
-                    <source>${maven.compiler.source}</source>
-                    <target>${maven.compiler.target}</target>
-                    <compilerArgs>
-                        <arg>--enable-preview</arg>
-                    </compilerArgs>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 
 </project>

+ 7 - 6
src/main/java/xyz/kwiecien/jfuck/BFCompiler.java

@@ -15,16 +15,16 @@ import static java.lang.constant.ConstantDescs.*;
 
 public class BFCompiler {
     public static void main(String[] args) throws IOException {
-        if (args.length < 1) {
-            System.err.println("Usage: GenMain <filename>");
+        if (args.length < 2) {
+            System.err.println("Usage: BFCompiler <input filename> <output filename>");
             System.exit(1);
         }
-        var path = Paths.get(args[0]);
-        if (!path.toFile().exists()) {
+        var inputPath = Paths.get(args[0]);
+        if (!inputPath.toFile().exists()) {
             System.err.println("Unable to find file: " + args[0]);
             System.exit(1);
         }
-        var code = Files.readString(path);
+        var code = Files.readString(inputPath);
         var operations = new OperationExtractor().extract(code);
 
         Consumer<CodeBuilder> mainCode = cb -> {
@@ -42,6 +42,7 @@ public class BFCompiler {
                             ACC_PUBLIC + ACC_STATIC,
                             mb -> mb.withCode(mainCode));
         });
-        Files.write(Path.of("/tmp/GenClass.class"), bytes);
+        var outputPath = Paths.get(args[1]);
+        Files.write(outputPath, bytes);
     }
 }