Skip to content

Commit

Permalink
#65 Add support for failOnWarning in eclipse compiler.
Browse files Browse the repository at this point in the history
Signed-off-by: rfscholte <rfscholte@apache.org>
  • Loading branch information
akurtakov authored and rfscholte committed Sep 12, 2021
1 parent 7476614 commit 671ba68
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ public CompilerResult performCompile( CompilerConfiguration config )
{
args.add( "-parameters" );
}

if(config.isFailOnWarning())
{
args.add("-failOnWarning");
}

// Set Eclipse-specific options
// compiler-specific extra options override anything else in the config object...
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.codehaus.plexus.compiler.eclipse;

import org.codehaus.plexus.compiler.AbstractCompilerTest;
import org.codehaus.plexus.compiler.CompilerConfiguration;

import java.util.Arrays;
import java.util.Collection;

public class EclipseCompilerFailOnWarningsTest extends AbstractCompilerTest
{

protected void configureCompilerConfig( CompilerConfiguration compilerConfig )
{
compilerConfig.setFailOnWarning(true);
}

protected String getRoleHint()
{
return "eclipse";
}

protected int expectedErrors()
{
return 6;
}

protected int expectedWarnings()
{
return 1;
}

protected Collection<String> expectedOutputFiles()
{
return Arrays.asList( new String[] {
"org/codehaus/foo/Deprecation.class",
"org/codehaus/foo/ExternalDeps.class",
"org/codehaus/foo/Person.class",
"org/codehaus/foo/ReservedWord.class"
});
}
}

0 comments on commit 671ba68

Please sign in to comment.