-
Notifications
You must be signed in to change notification settings - Fork 10
[CI][ANDR] Add Gradle plugin to check against non-permitted licenses #5
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
Conversation
| allowedLicensesFile = project.rootProject.file("allowed-licenses.json") | ||
| renderers = arrayOf(JsonReportRenderer()) | ||
| filters = arrayOf(SpdxLicenseBundleNormalizer()) | ||
| } |
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.
^ here we centralize the plugin logic using gradle's precompiled convention plugins https://docs.gradle.org/current/userguide/custom_plugins.html
| implementation(libs.androidx.startup.runtime) | ||
| implementation(libs.jsr305) | ||
| implementation(libs.gson) | ||
| implementation("androidx.tracing:tracing-ktx:1.2.0") |
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.
unrelated clean-up
| "moduleName": "capture-sdk:replay" | ||
| } | ||
| ] | ||
| } No newline at end of file |
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.
^ this is the list of allowed licenses
.github/workflows/android.yaml
Outdated
| run: ./gradlew capture-timber:testReleaseUnitTest --info | ||
| - name: Check Licenses for all Modules | ||
| working-directory: ./platform/jvm | ||
| run: ./gradlew checkLicense --info |
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.
^ run the check in CI
mattklein123
left a comment
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.
Nice, LGTM modulo CI issues.
Using https://github.com/jk1/Gradle-License-Report to guard using non-allowed licenses. Applies common configuration to modules ':capture', ':capture-apollo3', ':capture-timber', ':common', ':replay'
Usage:
(needs to be in
cd platform/jvm)./gradlew checkLicense(checks all modules againstallowed-licenses.json)./gradlew capture:generateLicenseReport(generates reports inloop-sdk/platform/jvm/{$projectDir}/build/reports/dependency-license/)To get the full dependency tree for a module you can run:
./gradlew capture:dependencies --configuration releaseRuntimeClasspath