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