From 1d80a3f4d139e59d9b84b5a38ba8bcdb741236da Mon Sep 17 00:00:00 2001 From: NebelNidas Date: Wed, 17 May 2023 18:15:22 +0200 Subject: [PATCH] Use Spotless for license headers --- HEADER | 27 +++++++++++++++------------ build.gradle | 9 +++++---- gradle.properties | 2 +- settings.gradle | 2 +- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/HEADER b/HEADER index d5f99fa..5a30d7f 100644 --- a/HEADER +++ b/HEADER @@ -1,13 +1,16 @@ -Copyright (c) 2016, 2017, 2018, 2019 FabricMC +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/build.gradle b/build.gradle index 505dcbd..bda3727 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'maven-publish' - id 'org.cadixdev.licenser' + id 'com.diffplug.spotless' id 'com.github.johnrengelman.shadow' id 'checkstyle' } @@ -47,9 +47,10 @@ dependencies { testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" } -license { - header project.file('HEADER') - include '**/*.java' +spotless { + java { + licenseHeaderFile(rootProject.file('HEADER')) + } } jar { diff --git a/gradle.properties b/gradle.properties index 8e0ec9c..24bd236 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.parallel = true org.gradle.workers.max = 3 # Gradle Plugins -cadixdev_licenser_version = 0.6.1 +spotless_version = 6.13.0 shadow_version = 7.1.2 # Project Properties diff --git a/settings.gradle b/settings.gradle index 77375ed..8c6333a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,7 +4,7 @@ pluginManagement { mavenCentral(); } plugins { - id 'org.cadixdev.licenser' version "${cadixdev_licenser_version}" + id 'com.diffplug.spotless' version "${spotless_version}" id 'com.github.johnrengelman.shadow' version "${shadow_version}" } }