From 4868d37511806056ebfc39786597de6e54cae300 Mon Sep 17 00:00:00 2001 From: Benjamin Marwell Date: Mon, 16 Oct 2023 22:18:29 +0200 Subject: [PATCH] [#282] print warnings for unsupported options --- .../gmavenplus/mojo/AbstractCompileMojo.java | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java b/src/main/java/org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java index 77e04280..2a624601 100644 --- a/src/main/java/org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java +++ b/src/main/java/org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java @@ -344,6 +344,7 @@ public abstract class AbstractCompileMojo extends AbstractGroovySourcesMojo { * @throws IllegalAccessException when a method needed for compilation cannot be accessed * @throws InvocationTargetException when a reflection invocation needed for compilation cannot be completed * @throws MalformedURLException when a classpath element provides a malformed URL + * @throws MojoExecutionException in case the mojo execution breaks with another reason. */ @SuppressWarnings({"rawtypes"}) protected synchronized void doCompile(final Set sources, final List classpath, final File compileOutputDirectory) @@ -386,22 +387,42 @@ private void doCompileProcess(Set sources, List classpath, File compile args.add("-Jtarget=" + this.targetBytecode); } + if (this.debug) { + getLog().warn("Option 'debug' is requested but not supported yet with fork=true."); + } + + if (!this.invokeDynamic) { + getLog().warn("Option 'invokeDynamic=false' is requested but not supported yet with fork=true."); + } + + if (!this.skipBytecodeCheck) { + getLog().warn("Option 'skipBytecodeCheck' is requested but not supported yet with fork=true."); + } + + if (this.warningLevel != 1) { + getLog().warn("Option 'warningLevel' is requested but not supported yet with fork=true."); + } + + if (this.tolerance != 0) { + getLog().warn("Option 'tolerance' is requested but not supported yet with fork=true."); + } + + if (this.parallelParsing) { + getLog().warn("Option 'parallelParsing' is requested but not supported yet with fork=true."); + } + + if (this.includeClasspath != IncludeClasspath.PROJECT_ONLY) { + getLog().warn("Option 'includeClasspath' is requested but not supported yet with fork=true."); + } + // missing: - // this.debug - // this.includeClasspath // this.configScript (available as --configscript=) - // this.parallelParsing - // this.invokeDynamic - // this.tolerance - // this.warningLevel // this.verbose - // this.skipBytecodeCheck // as well as: // --compile-static // --type-checked // --temp= - final String compileMessage = String.format( Locale.ROOT, "Compiling %d source files with groovyc %s to %s",