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

feature: support saving dependencies' licenses #69

Merged
merged 1 commit into from
Sep 10, 2021

Conversation

kezhenxu94
Copy link
Member

This is a missing but important feature that helps to organize the distribution package especially in ASF projects, it resolves and saves all LICENSE files of the dependencies.

@kezhenxu94 kezhenxu94 added this to the 0.2.0 milestone Sep 10, 2021
@kezhenxu94 kezhenxu94 force-pushed the feature/save-licenses branch from 41155b3 to 0c72046 Compare September 10, 2021 16:00
Copy link
Member

@wu-sheng wu-sheng left a comment

Choose a reason for hiding this comment

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

This feature is good to me. From ASF perspective, not all license files should be copied.

@wu-sheng wu-sheng merged commit 8376811 into main Sep 10, 2021
@wu-sheng wu-sheng deleted the feature/save-licenses branch September 10, 2021 23:54
@zooltd
Copy link
Contributor

zooltd commented Sep 13, 2021

This feature attempts to write each pkg's license content to respective files. The license content is resolved by each resolver. However, the resolving behavior of each resolver is inconsistent. To be more specific, in GoModResolver, it always record a mod's complete license content, cuz it identifies the mod's license through this content. In NpmResolver, it may not record the license content because it identifies a pkg's license through the field in a pkg's package.json file in the first priority. In MavenPomResolver, it simply records the raw data of the license field in a pom.xml file as the license content. So here's the problem, the license content to be written may be an empty string or something irrelevant. Maybe we should standardize each resolver's behavior. If the LicenseContent field to be written is empty, then simply write a license template to the file according to the LicenseSpdxID field.

@kezhenxu94
Copy link
Member Author

This feature attempts to write each pkg's license content to respective files. The license content is resolved by each resolver. However, the resolving behavior of each resolver is inconsistent. To be more specific, in GoModResolver, it always record a mod's complete license content, cuz it identifies the mod's license through this content. In NpmResolver, it may not record the license content because it identifies a pkg's license through the field in a pkg's package.json file in the first priority. In MavenPomResolver, it simply records the raw data of the license field in a pom.xml file as the license content. So here's the problem, the license content to be written may be an empty string or something irrelevant. Maybe we should standardize each resolver's behavior. If the LicenseContent field to be written is empty, then simply write a license template to the file according to the LicenseSpdxID field.

Yes there are still some resolvers that don't record the content, some of them record a spdx id and some of them record the license URL, we should make sure the Content field really saves the content, we may add other Fields that can be empty, like URL...

@kezhenxu94
Copy link
Member Author

@zooltd will you be available to enhance this part?

@zooltd
Copy link
Contributor

zooltd commented Sep 13, 2021

@zooltd will you be available to enhance this part?

Yep, glad to help.😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants