Skip to content

Commit

Permalink
Make it java 1.8 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
sindrets committed Mar 10, 2020
1 parent 515b7f8 commit ec624cc
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

def mainClass = "no.stide.fling.Main"
project.version = "1.0.0"
version = "1.0.1"

repositories {
flatDir {
Expand All @@ -16,7 +16,7 @@ repositories {

dependencies {
// implementation fileTree('libs') { include '*.jar' }
implementation ":jchalk-1.0.0"
implementation ":jchalk-1.0.1"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0'
}
Expand All @@ -40,7 +40,7 @@ sourceSets {
task runMockTests(type: Exec) {
dependsOn shadowJar
workingDir "$rootDir"
commandLine "java", "-jar", "build/libs/fling-${project.version}.jar", "build/classes/java/test"
commandLine "java", "-jar", "build/libs/fling-${version}.jar", "build/classes/java/test"
ignoreExitValue true
}

Expand Down
Binary file removed libs/jchalk-1.0.0-sources.jar
Binary file not shown.
Binary file removed libs/jchalk-1.0.0.jar
Binary file not shown.
Binary file added libs/jchalk-1.0.1-sources.jar
Binary file not shown.
Binary file added libs/jchalk-1.0.1.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions src/main/java/no/stide/fling/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

public static boolean debugMode = false;
static HashMap<String, String> flags;
static LinkedHashMap<String, String> flags;
static ArrayList<String> params;

public static boolean isFlag(String param) {
Expand All @@ -20,7 +20,7 @@ public static boolean isFlag(String param) {
}

public static void parseFlags(String[] args) {
final HashMap<String, String> flags = new HashMap<>();
final LinkedHashMap<String, String> flags = new LinkedHashMap<>();
final ArrayList<String> params = new ArrayList<>();
final Pattern letterFlag = Pattern.compile("(?<=^-)[a-zA-Z]+$");
final Pattern wordFlag = Pattern.compile("(?<=^--)[a-zA-Z][a-zA-Z\\d]+$");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/no/stide/fling/TestRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void run() throws TestFailedException {
}

private void processClass(String classpath, Path filePath) throws ClassNotFoundException, IOException {
String packagePath = Path.of(classpath).relativize(filePath).toString();
String packagePath = Paths.get(classpath).relativize(filePath).toString();
packagePath = packagePath.replaceAll("\\" + File.separator, ".").replaceAll("\\.class$", "");
// System.out.println("FOUND CLASS: " + packagePath);

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/no/stide/mock/Passing.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public void testSomeThings(TestInitiator suite) {

@TestGroup(description = "Class property tests")
public void testSomeClassProperties(TestInitiator suite) {
suite.it("getPackageName() returns correct package").expect(this.getClass().getPackageName())
.toBe("no.stide.mock");
suite.it("getCanonicalName() returns correct name").expect(this.getClass().getCanonicalName())
.toBe("no.stide.mock.Passing");
System.out.println("Foo bar baz");
suite.it("should have 1 declared constructor").expect(this.getClass().getDeclaredConstructors().length).toBe(1);
}
Expand Down

0 comments on commit ec624cc

Please sign in to comment.