Skip to content

Comments

Add Gradle plugin development ArchUnit rules for lazy task registration and Provider API usage with field-specific recommendations#25

Merged
rpalcolea merged 2 commits intomainfrom
more-gradle-plugin-archrules
Dec 15, 2025
Merged

Add Gradle plugin development ArchUnit rules for lazy task registration and Provider API usage with field-specific recommendations#25
rpalcolea merged 2 commits intomainfrom
more-gradle-plugin-archrules

Conversation

@rpalcolea
Copy link
Member

This PR adds two new ArchUnit rules to detect common Gradle plugin development anti-patterns.

The GradlePluginLazyTaskRegistrationRule flags plugins using eager task creation (project.task() or tasks.create()) instead of lazy registration (tasks.register())

The GradleTaskProviderApiRule detects task properties using plain types instead of the Provider API, providing field-specific recommendations (e.g., suggesting RegularFileProperty for File fields with @InputFile, or ListProperty<T> for List fields).

…on and Provider API usage with field-specific recommendations
@rpalcolea rpalcolea merged commit 513878e into main Dec 15, 2025
3 checks passed
@rpalcolea rpalcolea deleted the more-gradle-plugin-archrules branch December 15, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants