Skip to content

Commit

Permalink
Use Bach's file and folder support
Browse files Browse the repository at this point in the history
  • Loading branch information
sormuras committed Mar 25, 2024
1 parent 90f451d commit ce60d7d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .bach/src/run.bach/run/Build.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package run;

import java.nio.file.Path;
import run.bach.Bach;
import run.bach.ToolCall;

class Build {
private static final Bach.Folders folders = Bach.Folders.ofCurrentWorkingDirectory();

public static void main(String... args) {
var sources = Path.of(".bach/src");
var classes = Path.of(".bach/out/classes");
var modules = Path.of(".bach/out/modules");
var classes = folders.out("classes");
var modules = folders.out("modules");
var moduleSourcePath = folders.computeModuleSourcePath("run.bach", ".bach/src/run.bach");

ToolCall.of("javac")
.add("--module", "run.bach")
.add("--module-source-path", sources)
.add("-Xlint:all")
.add("-Werror")
.add("--module-source-path", moduleSourcePath)
.add("-X" + "lint:all")
.add("-W" + "error")
.add("-d", classes)
.run();

Expand Down

0 comments on commit ce60d7d

Please sign in to comment.