Gradle-License-Report icon indicating copy to clipboard operation
Gradle-License-Report copied to clipboard

Unify api for license results: License, LicenseFileDetails, ImportedModuleData

Open vlsi opened this issue 6 years ago • 6 comments

There are three classes meaning holding pretty much the same information. It would be nice if those could be unified somehow.

vlsi avatar May 22 '19 13:05 vlsi

@Sortable(includes = "name")
@Canonical
class License {
    String name
    String url
    String distribution
    String comments
}

@Sortable
@Canonical
class LicenseFileDetails {
    String file
    String license
    String licenseUrl
}

@Sortable
@Canonical
class ImportedModuleData {
    String name
    String version
    String projectUrl
    String license
    String licenseUrl
}

guenhter avatar Jun 11 '19 07:06 guenhter

Hm, you think it's worth to unify those classes?

guenhter avatar Jun 11 '19 07:06 guenhter

@guenhter , frankly speaking, I have no idea. I started using G-L-R for apache/jmeter, and my immediate thought was "those pom licenses, imported licenses, manifest licenses are overlapping".

However, it looks like implementing the API is challenging.

For instance: there's SPDX license database, so things like License.Apache_2_0 would be nice to have. Which means License should be interface or something behind those lines.

Then: even in case software declares "license is BSD-3-Clause", then the actual file will likely be different (year and copyright owner would be replaced with actual values), so it should be like "license flavour==BSD-3-Clause, actualFile=...". Note: single artifact might include multiple license/notice files (e.g. in case jar file bundles other jar files with their own licenses). It looks like LicenseFileDetails represents actual license file, however it is not clear where is the relation between LicenseFileDetails and License. It is not clear why LicenseFileDetails#license is of type String.

vlsi avatar Jun 11 '19 07:06 vlsi