-
-
Notifications
You must be signed in to change notification settings - Fork 463
Fail if no allowed licenses are specified with StrictMode.FAIL #1208
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
mikepenz
commented
Jul 1, 2025
- fail if no allowed licenses are specified with strict mode set to FAIL
- FIX strict mode set to FAIL doesn't fail if no licenses are allowed #1204
…out `afterEvaluate` we have to split the plugin into the main part, and the android auto generation code - NOTE: Breaking change
- FIX #1190 # Conflicts: # plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesTask.kt # plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/BaseAboutLibrariesTask.kt
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.
Pull Request Overview
This PR adds functionality to fail the build when StrictMode.FAIL is used without any allowed licenses and introduces an option to require license information on all libraries. It also splits the Android support into a separate plugin and updates task registration accordingly.
- Introduce
requireLicense
flag and wire it into task inputs - Enhance
AboutLibrariesTask
to throw or warn on missing licenses and license-less libraries - Split Android-specific task registration into a dedicated Gradle plugin
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
BaseAboutLibrariesTask.kt | Added requireLicense property as a task input |
AboutLibrariesTask.kt | Updated license validation flow and logging for missing license info |
AboutLibrariesPluginAndroidExtension.kt | Refactored configureAndroidTasks to accept a custom block parameter |
AboutLibrariesPluginAndroid.kt | New Android-specific plugin implementation |
AboutLibrariesPlugin.kt | Always invoke Android task registration, removed deprecated guard |
AboutLibrariesExtension.kt | Added requireLicense to LibraryConfig and deprecated old Android config |
build.gradle.kts | Registered new Android plugin in the Gradle plugin block |
app/build.gradle.kts & app-test/build.gradle.kts | Switched to the new Android plugin ID and removed deprecated android {} block |
MIGRATION.md | Added notes for v13.0.0 Android plugin split |
Comments suppressed due to low confidence (3)
plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesTask.kt:129
- Consider adding tests to verify behavior when
requireLicense
is true: ensure libraries with no license trigger the correct warning or failure under differentstrictMode
settings.
val librariesWithoutLicense = if (requireLicense.get()) libraries.filter { it.licenses.isEmpty() } else emptyList()
MIGRATION.md:3
- [nitpick] Add a note about the new
requireLicense
flag underlibrary {}
so users know how to enforce license presence when upgrading.
#### v13.0.0
plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesPluginAndroidExtension.kt:8
- The default
block
parameter is set to::configureAndroidTasks
(itself), causing infinite recursion when registering variants. Consider defaulting to the Android-specific handler (::configureAndroidResourceTasks
) or removing the default.
internal fun configureAndroidTasks(
@@ -37,6 +37,9 @@ abstract class BaseAboutLibrariesTask : DefaultTask() { | |||
@get:Input | |||
abstract val variant: Property<String?> | |||
|
|||
@Input |
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.
Gradle task input properties in Kotlin need the annotation on the getter (@get:Input
), otherwise this property won’t be recognized as an input.
@Input | |
@get:Input |
Copilot uses AI. Check for mistakes.