Skip to content

Commit

Permalink
api jars as list not set
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Jul 21, 2024
1 parent b823fbc commit b77dab9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ interface DowngradeFlags : TransformParameters {

fun DowngradeFlags.toFlags(): Flags {
val flags = Flags()
flags.api = apiJar.orNull?.toSet()
flags.api = apiJar.orNull
flags.quiet = quiet.getOrElse(false)
flags.logAnsiColors = logAnsiColors.getOrElse(true)
flags.logLevel = Logger.Level.valueOf(logLevel.getOrElse("INFO").uppercase())
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/xyz/wagyourtail/jvmdg/cli/Flags.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.security.MessageDigest;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
Expand All @@ -36,7 +37,7 @@ public class Flags {
/**
* sets the api jar to use, if null will attempt to automatically find it
*/
public Set<File> api = null;
public List<File> api = null;

/**
* sets the log level to {@link Logger.Level#FATAL}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/xyz/wagyourtail/jvmdg/cli/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio
}
break;
case "--api":
Set<File> api = new HashSet<>();
List<File> api = new ArrayList<>();
for (String[] s : entry.getValue()) {
for (String string : s) {
String[] split = string.split(File.pathSeparator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static <T, U> Stream<Map.Entry<T, U>> zip(Stream<T> a, Stream<U> b) {
private static Stream<FlagsAndRunner> flags() {
Flags flags = ClassRunner.flags.copy();
flags.quiet = true;
flags.api = Set.of(javaApi.toFile());
flags.api = List.of(javaApi.toFile());

return Stream.of(
new FlagsAndRunner(flags.copy(e -> e.classVersion = JavaRunner.JavaVersion.V1_8.toOpcode()), JavaRunner.JavaVersion.V1_8)
Expand Down

0 comments on commit b77dab9

Please sign in to comment.