Skip to content

Commit

Permalink
Find and run junit tool
Browse files Browse the repository at this point in the history
  • Loading branch information
sormuras committed May 23, 2024
1 parent ee7456e commit b245b86
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .bach/src/run.bach/run/demo/JResolveDemo.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
package run.demo;

import run.bach.*;
import java.io.File;
import java.lang.module.ModuleFinder;
import java.nio.file.Path;
import java.util.stream.Stream;
import run.bach.Tool;
import run.bach.ToolFinder;
import run.bach.ToolSpace;

public class JResolveDemo {
public static void main(String... args) {
var runner = new ToolSpace(ToolSpace.Flag.SILENT);
var jresolve = Tool.of("https://github.com/bowbahdoe/jresolve-cli/releases/download/v2024.05.10/jresolve.jar#SIZE=754432");
var jresolve =
Tool.of(
"https://github.com/bowbahdoe/jresolve-cli/releases/download/v2024.05.10/jresolve.jar#SIZE=754432");
var run =
runner.run(
jresolve,
"pkg:maven/org.junit.jupiter/junit-jupiter-engine@5.10.2",
"pkg:maven/org.junit.platform/junit-platform-console@1.10.2");
System.out.println(run.out());

var paths = Stream.of(run.out().split(File.pathSeparator)).map(Path::of).toArray(Path[]::new);
var junit = ToolFinder.of(ModuleFinder.of(paths)).get("junit");
junit.run("--help");
}
}

0 comments on commit b245b86

Please sign in to comment.