Skip to content

Commit 08705ed

Browse files
committed
convention: Update licenser disable property handling
1 parent 09301e3 commit 08705ed

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

convention/src/main/groovy/org/spongepowered/gradle/convention/SpongeConventionPlugin.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
public abstract class SpongeConventionPlugin implements Plugin<Project> {
7777
private static final Logger LOGGER = Logging.getLogger(SpongeConventionPlugin.class);
7878

79-
private static final String DISABLE_CADIX_LICENSER = "sponge.disableLicenser";
79+
private static final String DISABLE_SPOTLESS_LICENSER = "sponge.disableSpotlessLicenser";
8080

8181
private @UnknownNullability Project project;
8282

@@ -102,7 +102,7 @@ public void apply(final Project target) {
102102

103103
this.configurePublicationMetadata(indra);
104104
this.configureStandardTasks();
105-
if (!"true".equals(this.project.findProperty(SpongeConventionPlugin.DISABLE_CADIX_LICENSER))) {
105+
if (SpongeConventionPlugin.shouldApplyLicenser(this.project)) {
106106
this.configureLicenseHeaders(target.getExtensions().getByType(IndraSpotlessLicenserExtension.class));
107107
}
108108
this.configureJarSigning();
@@ -147,7 +147,7 @@ private void configureStandardTasks() {
147147

148148
private void applyPlugins(final PluginContainer plugins) {
149149
plugins.apply(IndraPlugin.class);
150-
if (!"true".equals(this.project.findProperty(SpongeConventionPlugin.DISABLE_CADIX_LICENSER))) {
150+
if (SpongeConventionPlugin.shouldApplyLicenser(this.project)) {
151151
plugins.apply(IndraSpotlessLicenserPlugin.class);
152152
}
153153
plugins.apply(GitPlugin.class);
@@ -270,4 +270,8 @@ private void configureJarSigning() {
270270
}
271271
});
272272
}
273+
274+
private static boolean shouldApplyLicenser(final Project project) {
275+
return !"true".equals(project.findProperty(SpongeConventionPlugin.DISABLE_SPOTLESS_LICENSER));
276+
}
273277
}

0 commit comments

Comments
 (0)