-
Notifications
You must be signed in to change notification settings - Fork 5k
Open
Labels
a:featureA new functionalityA new functionalityin:work-validationtask validation, warnings, disable optimizationstask validation, warnings, disable optimizationsin:writing-taskstask optiontask optionre:comprehensibilityreasonable errors and warnings, clear dsl, mental overloadreasonable errors and warnings, clear dsl, mental overload
Description
Expected Behavior
Previously discussed with @big-guy & @lptr on Slack, 21/01/2025
When user forgets to annotate a field in the task, they will see warning message similar to this:
Type 'Build_gradle.MyTask' property 'myProperty' is missing an input or output annotation.
Reason: A property without annotation isn't considered during up-to-date checking.
Possible solutions:
1. Add an input or output annotation.
2. Mark it as @Internal.
It could be improved, based on the type of that field.
- For File-like properties (File, FileCollection, DirectoryProperty, etc), we suggest File-like annotations (
@InputFile
,@OutputFile
,@Classpath
, etc). - For primitive properties (String, Boolean, Provider where T is primitive), suggest
@Input
- For everything else suggest
@Nested
- Or
@Internal
to ignore.
Current Behavior (optional)
No response
Context
In AGP API we expose tools like: https://developer.android.com/reference/tools/gradle-api/8.3/com/android/build/api/variant/Aidl
where @Nested
is required. Should the user forget to add it – they will receive a message that doesn't mention this particular annotation as being the possible solution. This change could help users discover the right way quicker.
Metadata
Metadata
Assignees
Labels
a:featureA new functionalityA new functionalityin:work-validationtask validation, warnings, disable optimizationstask validation, warnings, disable optimizationsin:writing-taskstask optiontask optionre:comprehensibilityreasonable errors and warnings, clear dsl, mental overloadreasonable errors and warnings, clear dsl, mental overload