Log missing source files when compiling. Closes #66

This commit is contained in:
Erik C. Thauvin 2025-11-14 11:45:13 -08:00
parent ba1dad4eb3
commit f4db05581b
No known key found for this signature in database
GPG key ID: 776702A6A2DA330E

View file

@ -87,12 +87,19 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
for (var directory : mainSourceDirectories()) {
sources.addAll(FileUtils.getJavaFileList(directory));
}
if (sources.isEmpty()) {
if (!silent()) {
System.err.println("No main source files found.");
}
} else {
executeBuildSources(
compileMainClasspath(),
compileMainModulePath(),
sources,
buildMainDirectory());
}
}
/**
* Part of the {@link #execute} operation, builds the test sources.
@ -105,12 +112,19 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
for (var directory : testSourceDirectories()) {
sources.addAll(FileUtils.getJavaFileList(directory));
}
if (sources.isEmpty()) {
if (!silent()) {
System.err.println("No test source files found.");
}
} else {
executeBuildSources(
compileTestClasspath(),
compileTestModulePath(),
sources,
buildTestDirectory());
}
}
/**
* Part of the {@link #execute} operation, build sources to a destination.