Skip to content

Commit d367672

Browse files
committed
summary now reports build time only
1 parent bb07436 commit d367672

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

src/main/java/airhacks/App.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ static String readVersion() {
3636
}
3737

3838

39-
static void build(AppArguments arguments) throws IOException {
39+
static boolean build(AppArguments arguments) throws IOException {
4040
var sourceDirectory = arguments.sourcesDirectory();
4141
var classesDirectory = arguments.classesDirectory();
42-
42+
4343
var javaFiles = JavaFiles.findFrom(sourceDirectory);
4444
var configuredMainClass = Optional.ofNullable(Configuration.MAIN_CLASS.get(null));
4545
var mainClass = JavaFiles.findMainClass(javaFiles, configuredMainClass);
46-
46+
4747
UserHint.showHint(sourceDirectory, javaFiles, mainClass);
4848
Directories.createIfNotExists(classesDirectory);
4949
var compilationSuccess = Compiler.compile(javaFiles, classesDirectory);
5050
if (!compilationSuccess) {
5151
Log.warning("⚠️ compilation failed");
52-
return;
52+
return false;
5353
}
5454
Log.user("🔍 compiled %d files".formatted(javaFiles.size()));
5555

@@ -62,15 +62,18 @@ static void build(AppArguments arguments) throws IOException {
6262
if (arguments.isClassesDirTemporary()) {
6363
Cleaner.cleanClasses(classesDirectory);
6464
}
65-
PostBuildHook.runIfConfigured(sourceDirectory, jarDirectory, jarFileName);
65+
return true;
6666
}
6767

6868
static void main(String... args) throws IOException {
6969
Log.user("🚀 " + VERSION + " - fast and pure Java 🛠️");
7070
var arguments = AppArguments.from(args);
7171
arguments.userInfo();
7272
var stopWatch = StopWatch.start();
73-
build(arguments);
73+
var success = build(arguments);
7474
stopWatch.stop();
75+
if (success) {
76+
PostBuildHook.runIfConfigured(arguments.sourcesDirectory(), arguments.jarDirectory(), arguments.jarFileName());
77+
}
7578
}
7679
}

src/main/java/airhacks/zb/hook/control/PostBuildHook.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public interface PostBuildHook {
1414
String NONE = "<none>";
1515

1616
/// Suppresses the hook to break recursion. A hook like `zunit` runs the test
17-
/// suite, whose integration tests call `App.build`, which would fire the hook
18-
/// again — unbounded recursion. Set as an env var on every hook-spawned child
17+
/// suite; a test that invokes `zb` (`App.main`) would fire the hook again —
18+
/// unbounded recursion. Set as an env var on every hook-spawned child
1919
/// (inherited by all descendants), or as a system property by in-process
2020
/// callers (tests) that must build without re-triggering the hook.
2121
String SKIP_MARKER = "ZB_IN_POST_BUILD_HOOK";

src/main/resources/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2026.06.26.02
1+
2026.06.26.03

0 commit comments

Comments
 (0)