Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Add depreciation notice.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed Apr 29, 2024
1 parent d0d48ba commit 2b63d60
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 8 deletions.
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,62 @@ A license header manager for Gradle.

Its goal is to ensure that the source files contains a predefined license header determined by some rules, and optionally generate them automatically with a Gradle task.

## Depreciation Notice

Since October 2023, the Quilt Licenser Gradle plugin is deprecated.
This plugin suffers from critical design flaws which leads to some OS-specific
bugs and to a low ability to expand the plugin further in the future.

To remedy those issues a rewrite was needed and the original author of this plugin
has done such rewrite under a separate organization.
The replacement plugin is the [Yumi Gradle Licenser Plugin].

### Migration

For those who wish to continue to use this kind of license header management plugin,
the [Yumi Gradle Licenser Plugin] can be used as the replacement.

That replacement plugin fixes some issues with this one:
- Windows-specific license header detection issues are fixed.
- Date-detection issues are fixed.
- Kotlin is properly supported.

For most cases the migration is a matter of a few line changes.

In buildscripts the plugin identifier needs to be changed:
```diff
- id 'org.quiltmc.gradle.licenser' version '2.+'
+ id 'dev.yumi.gradle.licenser' version '1.1.+'
```

The `license` block in buildscripts does not require any change.

The format for license header files change significantly,
the full documentation can be found [here](https://github.com/YumiProject/yumi-gradle-licenser/blob/main/README.md#license-header-rule).

Changes include:
- Replace the `${YEAR}` variable with `${CREATION_YEAR}`.
- Addition of the `${FILE_NAME}` variable.
- Metadata statements prefixed with `;;` are replaced with pre-processor statements prefixed with `#`:
- the `year_selection` statement is the same;
- the `year_display` statement no longer exists,
but similar behavior can be achieved through the use of `type` statements:
```diff
- ;;year_display: list
+ #type YEAR YEAR_LIST
```
Please note that the `type` statement defines a new variable.
- the `match_from` statement does not currently have an equivalent,
but should not be an issue in most cases and only influenced initial runs of the `applyLicenses` task;
- a new kind of statement is available: `optional`, this allows to add optional parts to license headers.

## Usage

For a project you need to apply the plugin to your project:

```groovy
plugins {
id 'org.quiltmc.gradle.licenser' version '1.+'
id 'org.quiltmc.gradle.licenser' version '2.+'
}
```

Expand Down Expand Up @@ -87,3 +136,5 @@ Currently, only the `${YEAR}` variable is available.
Available values are:
- `project` for which the project is used as reference,
- `file` for which each file can have its own last modification year

[Yumi Gradle Licenser Plugin]: https://github.com/YumiProject/yumi-gradle-licenser "The Git repository of the Yumi Gradle Licenser Plugin"
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
plugins {
id 'com.gradle.plugin-publish' version '1.2.0'
id 'maven-publish'
id 'org.quiltmc.gradle.licenser' version '1.1.+'
id 'org.quiltmc.gradle.licenser' version '2.0.+'
}

group = "org.quiltmc"
version = "2.0.1"
version = "2.0.2"
def javaVersion = 17

repositories {
Expand All @@ -28,7 +28,7 @@ gradlePlugin {
quilt_gradle_licenser {
id = 'org.quiltmc.gradle.licenser'
displayName = "Quilt Gradle Licenser"
description = "A plugin to automatically manage license headers, designed to easily support different headers for different files."
description = "A plugin to automatically manage license headers, designed to easily support different headers for different files. This plugin is deprecated, please use dev.yumi.gradle.licenser instead."
tags.addAll('licenser', 'licensing', 'licenses', 'license-header')
implementationClass = 'org.quiltmc.gradle.licenser.QuiltLicenserGradlePlugin'
}
Expand Down
4 changes: 0 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
name 'Quilt'
url 'https://maven.quiltmc.org/repository/release'
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public class QuiltLicenserGradlePlugin implements Plugin<Project> {
public void apply(Project project) {
var ext = project.getExtensions().create("license", QuiltLicenserGradleExtension.class, project);

project.getLogger()
.warn("The Quilt Gradle Licenser Plugin is deprecated. Please migrate to the Yumi Gradle Licenser plugin: https://github.com/QuiltMC/quilt-gradle-licenser#migration");

// Register tasks
project.getPlugins().withType(JavaBasePlugin.class).configureEach(plugin -> {
var sourceSets = (SourceSetContainer) project.getExtensions().getByName("sourceSets");
Expand Down

0 comments on commit 2b63d60

Please sign in to comment.