Skip to content

Commit

Permalink
[groovy#282] print warnings for unsupported options
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarwell committed Oct 16, 2023
1 parent c612b1e commit 4868d37
Showing 1 changed file with 29 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<File> sources, final List classpath, final File compileOutputDirectory)
Expand Down Expand Up @@ -386,22 +387,42 @@ private void doCompileProcess(Set<File> 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",
Expand Down

0 comments on commit 4868d37

Please sign in to comment.