Skip to content

Remove legacy Android task support in Gradle Plugin, improve support for new variant API#1288

Merged
mikepenz merged 5 commits intodevelopfrom
feature/remove_legacy_apis
Dec 29, 2025
Merged

Remove legacy Android task support in Gradle Plugin, improve support for new variant API#1288
mikepenz merged 5 commits intodevelopfrom
feature/remove_legacy_apis

Conversation

@mikepenz
Copy link
Owner

This pull request introduces significant breaking changes to the AboutLibraries Gradle plugin, primarily removing deprecated APIs and enforcing compatibility with Android Gradle Plugin (AGP) 7.0.0 or newer. The changes simplify the plugin's codebase by eliminating legacy support and tasks, and update documentation and build scripts to reflect these requirements.

Plugin API and Compatibility Updates:

  • The plugin now requires AGP 7.0.0 or newer, enforced via a runtime check for AndroidComponentsExtension. Attempting to use the plugin with an older AGP version will log an error and abort plugin application. (AboutLibrariesPluginAndroid.kt, AboutLibrariesPluginAndroidExtension.kt) [1] [2]
  • All legacy APIs and support for pre-AGP 7 variants (AppExtension, LibraryExtension, and related code paths) have been removed. The plugin now exclusively uses the new AGP variants API. (AboutLibrariesPluginAndroidExtension.kt)

Task Cleanup and Deprecation Removal:

  • The deprecated generateLibraryDefinitions* tasks and all related code (including the deprecated property and warnings) have been removed. Only the exportLibraryDefinitions* tasks remain. (AboutLibrariesPluginAndroidExtension.kt, AboutLibrariesTask.kt) [1] [2] [3]

Documentation and Build Script Updates:

  • The migration guide (MIGRATION.md) is updated to document the removal of deprecated tasks and the new AGP 7+ requirement.
  • The sample shared module build script enables Android resources for KMP and removes the unused androidKmpLibrary plugin alias. (sample/shared/build.gradle.kts) [1] [2]

CI Workflow Adjustment:

  • The CI workflow no longer attempts to build the staging variant, aligning with the updated plugin and build configuration. (.github/workflows/ci.yml)

Copilot AI review requested due to automatic review settings December 29, 2025 17:22
Copy link
Contributor

Copilot AI left a 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 pull request introduces breaking changes to modernize the AboutLibraries Gradle plugin by removing all legacy API support and enforcing compatibility with Android Gradle Plugin (AGP) 7.0.0 or newer. The plugin now exclusively uses the new AGP variants API (AndroidComponentsExtension) and eliminates all deprecated tasks and code paths.

Key Changes:

  • Enforces AGP 7.0.0+ requirement through runtime check using Class.forName()
  • Removes all deprecated generateLibraryDefinitions* tasks and related code
  • Eliminates legacy variant API support (AppExtension, LibraryExtension) and associated task configuration

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesPluginAndroid.kt Adds AGP 7.0.0+ version check and removes legacy resource task configuration method
plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesPluginAndroidExtension.kt Removes support for pre-AGP 7 variant APIs and eliminates deprecated task registration code
plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesTask.kt Removes deprecated property and warning logic from task action
MIGRATION.md Documents breaking changes for v14.0.0 regarding deprecated task removal and AGP 7+ requirement
sample/shared/build.gradle.kts Removes unused plugin alias and enables experimental Android resources for KMP
.github/workflows/ci.yml Removes staging variant from release build command

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mikepenz mikepenz merged commit 612bc68 into develop Dec 29, 2025
9 checks passed
@mikepenz mikepenz deleted the feature/remove_legacy_apis branch December 29, 2025 17:58
@mikepenz mikepenz changed the title Remove legacy APIs, improve support for new variant API Remove legacy Android task support in Gradle Plugin, improve support for new variant API Dec 29, 2025
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.

2 participants