Skip to content

Commit

Permalink
Default skip existing license headers back to true
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider committed Dec 15, 2024
1 parent f771865 commit 7873894
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/java/org/openrewrite/gradle/RewriteLicensePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void apply(Project project) {
project.getPlugins().apply(LicenseReportPlugin.class);

project.getExtensions().configure(LicenseReportExtension.class, ext -> {
ext.renderers = new ReportRenderer[] { new com.github.jk1.license.render.CsvReportRenderer() };
ext.renderers = new ReportRenderer[]{new com.github.jk1.license.render.CsvReportRenderer()};
});

project.getTasks().withType(LicenseFormat.class, task -> {
Expand All @@ -46,8 +46,10 @@ public void apply(Project project) {
});

project.getExtensions().configure(LicenseExtension.class, ext -> {
ext.setSkipExistingHeaders(Optional.ofNullable((Boolean) project
.findProperty("licenseSkipExistingHeaders")).orElse(false));
ext.setSkipExistingHeaders(Optional
.ofNullable((String) project.findProperty("licenseSkipExistingHeaders"))
.map(Boolean::parseBoolean)
.orElse(true));
ext.getExcludePatterns().addAll(Arrays.asList("**/*.tokens", "**/*.config", "**/*.interp", "**/*.txt", "**/*.bat",
"**/*.zip", "**/*.csv", "**/gradlew", "**/*.dontunpack", "**/*.css",
"**/*.editorconfig", "**/*.md", "**/*.jar"));
Expand All @@ -57,8 +59,10 @@ public void apply(Project project) {
put("java", "SLASHSTAR_STYLE");
put("ts", "SLASHSTAR_STYLE");
}});
ext.setStrictCheck(Optional.ofNullable((Boolean) project
.findProperty("licenseStrictCheck")).orElse(true));
ext.setStrictCheck(Optional
.ofNullable((String) project.findProperty("licenseStrictCheck"))
.map(Boolean::parseBoolean)
.orElse(true));
});
}
}

0 comments on commit 7873894

Please sign in to comment.