Skip to content

Commit

Permalink
[MCHECKSTYLE-418] Deprecate RSS feature and disable by default
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Aug 18, 2022
1 parent 549bf3d commit cbf3751
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 15 deletions.
3 changes: 3 additions & 0 deletions src/it/MCHECKSTYLE-357-with-header-override/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<enableRSS>true</enableRSS>
</configuration>
<reportSets>
<reportSet>
<reports>
Expand Down
3 changes: 3 additions & 0 deletions src/it/MCHECKSTYLE-357/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<enableRSS>true</enableRSS>
</configuration>
<reportSets>
<reportSet>
<reports>
Expand Down
3 changes: 3 additions & 0 deletions src/it/checkstyle-goal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>@pom.version@</version>
<configuration>
<enableRSS>true</enableRSS>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
5 changes: 4 additions & 1 deletion src/it/checkstyle-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>@sitePluginVersion@</version>
</plugin>
</plugin>
</plugins>
</build>
<reporting>
Expand All @@ -56,6 +56,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>@pom.version@</version>
<configuration>
<enableRSS>true</enableRSS>
</configuration>
<reportSets>
<reportSet>
<reports>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public abstract class AbstractCheckstyleReport

/**
* Specifies the location of the source directory to be used for Checkstyle.
*
*
* @deprecated instead use {@link #sourceDirectories}. For version 3.0.0, this parameter is only defined to break
* the build if you use it!
*/
Expand All @@ -267,7 +267,7 @@ public abstract class AbstractCheckstyleReport
// Compatibility with all Maven 3: default of 'project.compileSourceRoots' is done manually because of MNG-5440
@Parameter
private List<String> sourceDirectories;

/**
* Specifies the location of the test source directory to be used for Checkstyle.
*
Expand All @@ -278,7 +278,7 @@ public abstract class AbstractCheckstyleReport
@Parameter
@Deprecated
private File testSourceDirectory;

/**
* Specifies the location of the test source directories to be used for Checkstyle.
* Default value is <code>${project.testCompileSourceRoots}</code>.
Expand Down Expand Up @@ -355,8 +355,11 @@ public abstract class AbstractCheckstyleReport

/**
* Specifies if the RSS should be enabled or not.
*
* @deprecated This feature will be removed in a future version.
*/
@Parameter( property = "checkstyle.enable.rss", defaultValue = "true" )
@Parameter( property = "checkstyle.enable.rss", defaultValue = "false" )
@Deprecated
private boolean enableRSS;

/**
Expand Down Expand Up @@ -397,7 +400,7 @@ public abstract class AbstractCheckstyleReport
/**
* When using custom treeWalkers, specify their names here so the checks
* inside the treeWalker end up the the rule-summary.
*
*
* @since 2.11
*/
@Parameter
Expand All @@ -406,7 +409,7 @@ public abstract class AbstractCheckstyleReport
/**
* Specifies whether modules with a configured severity of <code>ignore</code> should be omitted during Checkstyle
* invocation.
*
*
* @since 3.0.0
*/
@Parameter( defaultValue = "false" )
Expand Down Expand Up @@ -466,6 +469,7 @@ public abstract class AbstractCheckstyleReport
* @since 2.4
*/
@Component( role = CheckstyleRssGenerator.class, hint = "default" )
@Deprecated
protected CheckstyleRssGenerator checkstyleRssGenerator;

/**
Expand Down Expand Up @@ -602,7 +606,7 @@ private List<Artifact> collectArtifacts( String hint )
private List<Artifact> getCheckstylePluginDependenciesAsArtifacts( Map<String, Plugin> plugins, String hint )
{
List<Artifact> artifacts = new ArrayList<>();

Plugin checkstylePlugin = plugins.get( plugin.getGroupId() + ":" + plugin.getArtifactId() );
if ( checkstylePlugin != null )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public class CheckstyleReportGenerator

private boolean enableFilesSummary;

@Deprecated
private boolean enableRSS;

private final SiteTool siteTool;
Expand Down Expand Up @@ -97,7 +98,7 @@ public CheckstyleReportGenerator( Sink sink, ResourceBundle bundle, File basedir
this.enableRulesSummary = true;
this.enableSeveritySummary = true;
this.enableFilesSummary = true;
this.enableRSS = true;
this.enableRSS = false;
this.iconTool = new IconTool( sink, bundle );
}

Expand Down Expand Up @@ -717,7 +718,7 @@ private boolean isTestSource( final String absoluteFilename )
return true;
}
}

return false;
}

Expand Down Expand Up @@ -761,11 +762,13 @@ public void setEnableFilesSummary( boolean enableFilesSummary )
this.enableFilesSummary = enableFilesSummary;
}

@Deprecated
public boolean isEnableRSS()
{
return enableRSS;
}

@Deprecated
public void setEnableRSS( boolean enableRSS )
{
this.enableRSS = enableRSS;
Expand All @@ -791,12 +794,12 @@ public void setXrefTestLocation( String xrefTestLocation )
this.xrefTestLocation = xrefTestLocation;
}

public List<File> getTestSourceDirectories()
public List<File> getTestSourceDirectories()
{
return testSourceDirectories;
}

public void setTestSourceDirectories( List<File> testSourceDirectories )
public void setTestSourceDirectories( List<File> testSourceDirectories )
{
this.testSourceDirectories = testSourceDirectories;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @author Olivier Lamy
* @since 2.4
*/
@Deprecated
public interface CheckstyleRssGenerator
{
void generateRSS( CheckstyleResults results, CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
* @author Olivier Lamy
* @since 2.4
*/
@Deprecated
public class CheckstyleRssGeneratorRequest
{
private MavenProject mavenProject;

private String copyright;

private File outputDirectory;

private Log log;

public CheckstyleRssGeneratorRequest( MavenProject mavenProject, String copyright, File outputDirectory, Log log )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* @since 2.4
*/
@Component( role = CheckstyleRssGenerator.class, hint = "default" )
@Deprecated
public class DefaultCheckstyleRssGenerator
implements CheckstyleRssGenerator
{
Expand Down Expand Up @@ -78,5 +79,5 @@ public void generateRSS( CheckstyleResults results, CheckstyleRssGeneratorReques
throw new MavenReportException( "Unable to generate checkstyle.rss.", e );
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
* @author <a href="mailto:joakim@erdfelt.net">Joakim Erdfelt</a>
*
*/
@Deprecated
public class VelocityTemplate
{
private String templateDirectory;
Expand Down Expand Up @@ -94,7 +95,7 @@ public void generate( String outputFilename, String template, Context context )
{
outputFile.getParentFile().mkdirs();
}

try ( Writer writer = new OutputStreamWriter( new FileOutputStream( outputFile ), StandardCharsets.UTF_8 ) )
{
getVelocity().getEngine().mergeTemplate( templateDirectory + "/" + template, context, writer );
Expand Down

0 comments on commit cbf3751

Please sign in to comment.