-
Notifications
You must be signed in to change notification settings - Fork 13
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
license-gather: add a task for verifying license compatibility #49
Conversation
Alternative option: enum class CompatibilityType {
ALLOW, UNKNOWN, REJECT;
}
data class LicenseCompatibility(
val type: CompatibilityType,
val reason: String
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for implementing that suggestion @vlsi!
tasks.register("verifyLicenses", VerifyLicenseCompatibilityTask.class) { | ||
metadata.from(generateLicense) | ||
allow(SpdxLicense.EPL_2_0) { | ||
because("JUnit is OK") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it ❤️
...ns/license-gather-plugin/src/main/kotlin/com/github/vlsi/gradle/license/GatherLicenseTask.kt
Outdated
Show resolved
Hide resolved
...-plugin/src/test/kotlin/com/github/vlsi/gradle/license/VerifyLicenseCompatibilityTaskTest.kt
Outdated
Show resolved
Hide resolved
...-plugin/src/test/kotlin/com/github/vlsi/gradle/license/VerifyLicenseCompatibilityTaskTest.kt
Show resolved
Hide resolved
c09f0a9
to
c4a7601
Compare
@vlsi Do you have any timeline for when you plan to release this? |
Oh, thanks for the ping. I somehow forgot about all this. |
@vlsi The functionality LGTM as it is. I also have a working version running against a bigger project. |
@vlsi Is there anything missing from your point of view? |
2d38a61
to
590320b
Compare
… from Groovy and Java
…ncremental in case overides are present Ideally the task should be incremental in all the cases, however, override tracking is not implemented yet.
@DreierF , I've released 1.78, so please let me know if it works for you. |
First of all thanks for your work on this! All in all it works as expected and I'm glad that I can start using it :) allow(AsfLicenseCategory.A) {
because("The ASF category A is allowed")
} does not seem to work.
Another minor issue is the usage of the import static com.github.vlsi.gradle.license.api.LicenseExpressionExtensions.and
import static com.github.vlsi.gradle.license.api.LicenseExpressionExtensions.or
...
overrideLicense("...") {
expectedLicense = and(and(Apache_2_0, LGPL_2_1), MPL_1_1)
effectiveLicense = or(or(Apache_2_0, LGPL_2_1_only), MPL_1_1)
} When the methods would be actual instance methods instead of extension methods this could be written as overrideLicense("...") {
expectedLicense = Apache_2_0 & LGPL_2_1 & MPL_1_1
effectiveLicense = Apache_2_0 | LGPL_2_1_only | MPL_1_1
} but I'm not sure if I might be missing some implementation details that would make this very hard to achieve. |
Does it happen with 1.78?
The methods should be instance in 1.78. |
🙈 I used 1.78, but completely forgot that I still had an intermediate version in mavenLocal that was picked up instead of the final 1.78 from Maven Central. That resolved all mentioned issues. |
No worries 😉 . I added the mentioned changes just a couple of days ago. My initial intention was to keep |
Fixes #46