Skip to content

Add support for failOnWarning in eclipse compiler. #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plexus-compilers/plexus-compiler-eclipse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>3.15.1</version>
<version>3.19.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,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"
});
}
}