Skip to content
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

Use consistent presentation for suggestions in task validation errors #24553

Open
reinsch82 opened this issue Mar 29, 2023 · 1 comment
Open
Labels
a:feature A new functionality in:ide Issues related to using Gradle with an IDE like IntelliJ, Eclipse or Android Studio in:problems problems api

Comments

@reinsch82
Copy link
Contributor

reinsch82 commented Mar 29, 2023

Current output

FAILURE: Build failed with an exception.                                                                                                                                           
                                                                                                                                                                                  
* What went wrong:                                                                                                                                                                 
A problem was found with the configuration of task ':myTask' (type 'MyTask').                                                                                                      
 - Type 'MyTask' property 'input' has @Input annotation used on property of type 'File'.                                                                                          
                                                                                                                                                                                  
   Reason: A property of type 'File' annotated with @Input cannot determine how to interpret the file.                                                                            
                                                                                                                                                                                  
   Possible solutions:                                                                                                                                                            
     1. Annotate with @InputFile for regular files.                                                                                                                               
     2. Annotate with @InputFiles for collections of files.                                                                                                                       
     3. If you want to track the path, return File.absolutePath as a String and keep @Input.                                                                                      
                                                                                                                                                                                  
   Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#incorrect_use_of_input_annotation for more details about this problem.                        
                                                                                                                                                                                  
* Try:                                                                                                                                                                             
> Run with --stacktrace option to get the stack trace.                                                                                                                             
> Run with --info or --debug option to get more log output.                                                                                                                        
> Run with --scan to get full insights.                                                                                                                                            
                                                                                                                                                                                  
* Get more help at https://help.gradle.org                                                                                                                                         
                                                                                                                                                                                  
BUILD FAILED in 333ms 

Proposed output

Configuration failed
Failed to configure :myTask (type MyTask).
 > Type 'MyTask' property 'input' has @Input annotation used on property of type File.  
  > A property of type File annotated with @Input cannot determine how to interpret the file.          


Try
> Annotate with @InputFile for regular files.
> Annotate with @InputFiles for collections of files.
> If you want to track the path, return File.absolutePath as a String and keep @Input.                                          
> Refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#incorrect_use_of_input_annotation for more details about this problem.
> Run with --scan to get full insights.


BUILD FAILED in 333ms

When multiple errors occur this is a weird way of representing it.

We'll deliver an adapted version of this with validation reports in the near future.

@reinsch82 reinsch82 self-assigned this Mar 29, 2023
reinsch82 added a commit that referenced this issue Mar 29, 2023
@ov7a ov7a added the in:ide Issues related to using Gradle with an IDE like IntelliJ, Eclipse or Android Studio label Mar 29, 2023
@donat donat changed the title Integrate task validation errors into standard error representation Use consistent presentation for suggestions in task validation errors Mar 29, 2023
reinsch82 added a commit that referenced this issue Mar 30, 2023
reinsch82 added a commit that referenced this issue Mar 30, 2023
@reinsch82
Copy link
Contributor Author

The PR will stay there till we can integrate validation reports

reinsch82 added a commit that referenced this issue Mar 31, 2023
reinsch82 added a commit that referenced this issue Apr 3, 2023
reinsch82 added a commit that referenced this issue Apr 19, 2023
reinsch82 added a commit that referenced this issue Apr 19, 2023
@ov7a ov7a added a:feature A new functionality in:problems problems api labels Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:ide Issues related to using Gradle with an IDE like IntelliJ, Eclipse or Android Studio in:problems problems api
Projects
None yet
Development

No branches or pull requests

2 participants