Merge remote-tracking branch 'origin/bigRefactoring' into patternMatching

This commit is contained in:
luca9913 2023-01-20 06:16:25 +01:00
commit 3bdc3b764d
25 changed files with 53 additions and 9 deletions

Binary file not shown.

34
pom.xml
View File

@ -71,7 +71,39 @@ http://maven.apache.org/maven-v4_0_0.xsd">
</execution>
</executions>
</plugin>
</plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>de.dhbwstuttgart.core.ConsoleInterface</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<mainClass>de.dhbwstuttgart.core.ConsoleInterface</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>

View File

@ -5,6 +5,7 @@ import java.lang.Integer;
public class VectorAdd {
vectorAdd(v1, v2) {
var i = 0;
v1 = new Vector<Integer>();
var erg = new Vector<>();
while (i < v1.size()) {
erg.addElement(v1.elementAt(i) + v2.elementAt(i));

10
src/main/java/Main.java Normal file
View File

@ -0,0 +1,10 @@
import de.dhbwstuttgart.core.ConsoleInterface;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException, ClassNotFoundException {
ConsoleInterface.main(args);
}
}

View File

@ -2,10 +2,7 @@ package de.dhbwstuttgart.core;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.*;
import java.util.stream.Collectors;
public class ConsoleInterface {
private static final String directory = System.getProperty("user.dir");
@ -14,6 +11,15 @@ public class ConsoleInterface {
List<File> classpath = new ArrayList<>();
String outputPath = null;
Iterator<String> it = Arrays.asList(args).iterator();
if(args.length == 0){
System.out.println("No input files given. Get help with --help");
System.exit(1);
}else if(args.length == 1 && args[0].equals("--help")){
System.out.println("Usage: javatx [OPTION]... [FILE]...\n" +
"\t-cp\tSet Classpath\n" +
"\t-d\tSet destination directory");
System.exit(1);
}
while(it.hasNext()){
String arg = it.next();
if(arg.equals("-d")){

View File

@ -1,5 +0,0 @@
package targetast;
public interface Fun1$$<R, T> {
public R apply(T t);
}