Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #4830] Generate LICENSE and NOTICE with Gradle tasks #4831

Merged
merged 19 commits into from
Apr 25, 2024

Conversation

Pil0tXia
Copy link
Member

@Pil0tXia Pil0tXia commented Apr 12, 2024

Fixes #4830

Motivation

As is discussed in #4720, the LICENSE and NOTICE files of the EventMesh binary distribution release need to be maintained manually, and for a long time the contents of the files were incomplete and not updated in time when artifacts were introduced or updated.

Following the suggestion in #4720 (comment), I implemented generateDistLicense task that automatically generates the LICENSE file and licenses/ directory, and generateDistNotice task that automatically generates the NOTICE file.

They can be run manually, or automatically when the dist task is executed. After #4719 is merged, I'll specify the generateDistLicense task and the generateDistNotice task as dependencies of the dist task.

The licenses generated by the generateDistLicense task are named after the license name, e.g. Apache-2.0.txt, which conforms to ASF regulations. I can also modify it to be named after an artifact, e.g. log4j-core 2.22.1 Apache-2.0.txt. Please let me know if you want to do like that.

Modifications

Update:

Now executing the dist task automatically generates the LICENSE and NOTICE files and automatically packages them.

Incompatible artifacts will be printed on screen. Release Manager must remove these artifacts from classpath, remove their license files from licenses dir, and tell users to manually download them.

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (JavaDocs)

Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

I think other Apache projects might profit from it, if you transform it into a Gradle plugin.

build.gradle Show resolved Hide resolved
build.gradle Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
build.gradle Show resolved Hide resolved
@Pil0tXia Pil0tXia requested a review from ppkarwasz April 18, 2024 06:42
@Pil0tXia
Copy link
Member Author

@xwm1992

This PR has completed the #4719 (comment) follow-up and is ready to be merged.

Now executing the dist task automatically generates the LICENSE and NOTICE files and automatically packages them.

Incompatible artifacts will be printed on screen. Release Manager must remove these artifacts from classpath, remove their license files from licenses dir, and tell users to manually download them.

@Pil0tXia Pil0tXia added the ready for review PR is waiting for reviewer's approval or opinion (used as a strong reminder) label Apr 18, 2024
Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be best to have more control on the licenses that are included in the distribution.

There is also the problem of software available under multiple licenses: e.g. Logback is available under EPL 1.0 and LGPL 2.1. The first one is a category B license and Apache projects can include it in binary form. The second one is a category X license and can not be included in Apache distributions.

Does it mean we shouldn't even mention that Logback is available under LGPL 2.1? I have no idea, better ask LEGAL about that. You probably could generate a snapshot of your distribution and ask them to look at the LICENSE part.

tools/dist-license/licenses/java/AL 2.0.txt Show resolved Hide resolved
build.gradle Show resolved Hide resolved
@Pil0tXia Pil0tXia removed the ready for review PR is waiting for reviewer's approval or opinion (used as a strong reminder) label Apr 18, 2024
@Pil0tXia Pil0tXia added the ready for review PR is waiting for reviewer's approval or opinion (used as a strong reminder) label Apr 24, 2024
@Pil0tXia
Copy link
Member Author

image

image

checkDeniedLicense task done (c.f. #4827 (comment)).

@xwm1992 checkDeniedLicense task depends on generateDistLicense task of this PR. To enable it, please merge this PR first, then I will add it into CI in #4827.

Copy link
Contributor

@xwm1992 xwm1992 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mxsm mxsm merged commit 5451de0 into apache:master Apr 25, 2024
9 checks passed
@Pil0tXia Pil0tXia deleted the pil0txia/license_4830 branch April 25, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
license ready for review PR is waiting for reviewer's approval or opinion (used as a strong reminder)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Generate LICENSE and NOTICE automatically
4 participants