Skip to content

Commit

Permalink
Add default bach-info repository as a submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
sormuras committed May 26, 2024
1 parent 9ccb514 commit 321f783
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .bach/src/run.bach/module-info.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Defines Bach's API. */
module run.bach {
requires jdk.compiler;
requires jdk.jfr;
requires transitive jdk.jfr;

exports run.bach;
exports run.bach.workflow;
Expand Down
58 changes: 0 additions & 58 deletions .bach/src/run.bach/run/demo/Ant.java

This file was deleted.

58 changes: 0 additions & 58 deletions .bach/src/run.bach/run/demo/Maven.java

This file was deleted.

43 changes: 0 additions & 43 deletions .bach/src/run.bach/run/demo/MavenRepositoryModuleFinder.java

This file was deleted.

18 changes: 11 additions & 7 deletions .bach/src/run.bach/run/demo/ModuleResolverDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.lang.module.ModuleFinder;
import java.nio.file.Path;

import jdk.jfr.consumer.RecordingStream;
import run.bach.ModuleFinders;
import run.bach.ModuleResolver;
import run.bach.ToolFinder;
Expand All @@ -16,10 +18,15 @@ public static void main(String... args) throws Exception {
}

var lib = Path.of("lib");
var resolver = ModuleResolver.ofSingleDirectory(lib, libraries);
resolver.resolveModule("org.junit.jupiter"); // to write and discover tests
resolver.resolveModule("org.junit.platform.console"); // to run tests
resolver.resolveMissingModules();
try (var recording = new RecordingStream()) {
recording.onEvent("run.bach.ModuleResolverResolvedModule", System.out::println);
recording.startAsync();
var resolver = ModuleResolver.ofSingleDirectory(lib, libraries);
resolver.resolveModule("org.junit.jupiter"); // to write and discover tests
resolver.resolveModule("org.junit.platform.console"); // to run tests
resolver.resolveMissingModules();
recording.stop();
}

// // "jreleaser" via the tool provider SPI
// var jreleaserHome =
Expand All @@ -41,7 +48,6 @@ public static void main(String... args) throws Exception {
// .withJavaApplication(
// "demo/release@all", JReleaser.APPLICATION,
// JReleaser.APPLICATION_ASSETS)
.with(new Ant()) // provides "ant" tool
);

var junit = tools.get("junit");
Expand All @@ -51,7 +57,5 @@ public static void main(String... args) throws Exception {
// tools.get("jreleaser").run("--version");
// tools.get("releaser1").run("--version");
// tools.get("releaser2").run("--version");

tools.get("ant").run("-version");
}
}
3 changes: 2 additions & 1 deletion .bach/src/run.bach/run/demo/ToolFinderDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.function.Consumer;
import java.util.spi.*;
import run.bach.*;
import run.info.bach.*;

class ToolFinderDemo {
public static void main(String... args) {
Expand All @@ -27,7 +28,7 @@ public static void main(String... args) {
// dedicated installer
.with(new Ant("1.10.14"))
.with(new GoogleJavaFormat("1.22.0"))
.with(new Maven("3.9.6"))
.with(new Maven("3.9.7"))
// convenient installer
.withJavaApplication(
"rife2/bld@1.9.0",
Expand Down
3 changes: 2 additions & 1 deletion .bach/src/run.bach/run/demo/ToolSpaceDemo.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package run.demo;

import run.bach.*;
import run.info.bach.*;

class ToolSpaceDemo extends ToolSpace {
public static void main(String... args) {
var finder = ToolFinder.ofInstaller().with(new Maven("3.9.6"));
var finder = ToolFinder.ofInstaller().with(new Maven());
var space = new ToolSpaceDemo(finder);

var run = space.run("maven", "--version");
Expand Down
1 change: 1 addition & 0 deletions .bach/src/run.bach/run/demo/ToolVersionsDemo.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package run.demo;

import run.bach.*;
import run.info.bach.*;

class ToolVersionsDemo {
public static void main(String... args) {
Expand Down
1 change: 1 addition & 0 deletions .bach/src/run.bach/run/info/bach
Submodule bach added at 2f5ed4
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "junit"]
path = .bach/src/run.bach/run/info/org/junit
url = https://github.com/junit-team/bach-info
[submodule "run.info.bach"]
path = .bach/src/run.bach/run/info/bach
url = https://github.com/sormuras/bach-info
1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 321f783

Please sign in to comment.