Merge pull request #71 from ethauvin/main

Log missing files when compiling or running
This commit is contained in:
Geert Bevin 2025-11-16 11:16:54 -05:00 committed by GitHub
commit 82fe6a3aa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 11 deletions

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.

View file

@ -49,6 +49,9 @@ public class RunOperation extends AbstractProcessOperation<RunOperation> {
else if (mainClass() != null && !mainClass().isEmpty()){ else if (mainClass() != null && !mainClass().isEmpty()){
args.add(mainClass()); args.add(mainClass());
} }
else if (!silent()) {
System.err.println("No main class or module specified.");
}
args.addAll(runOptions()); args.addAll(runOptions());

View file

@ -1 +1 @@
2.3.0 2.3.1-SNAPSHOT