Compare commits

...

3 commits

Author SHA1 Message Date
Erik C. Thauvin f33108a3f0
Log missing main class or module when running. Closes #69 2025-11-14 20:52:59 -08:00
Erik C. Thauvin f4db05581b
Log missing source files when compiling. Closes #66 2025-11-14 20:49:00 -08:00
Erik C. Thauvin ba1dad4eb3
2.3.1-SNAPSHOT 2025-11-14 20:48:53 -08:00
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