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

Fixes Issue 33 - 'RegularFileProperty' annotated with @Input cannot determine how to interpret the file #46

Merged
1 commit merged into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction

@CacheableTask
public abstract class ClearFocusTask : DefaultTask() {

@get:Input
@get:PathSensitive(PathSensitivity.RELATIVE)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addresses:

* What went wrong:
Some problems were found with the configuration of task ':clearFocus' (type 'ClearFocusTask').
  - Type 'com.dropbox.focus.ClearFocusTask' property 'focusFile' is annotated with @InputFile but missing a normalization strategy.
    
    Reason: If you don't declare the normalization, outputs can't be re-used between machines or locations on the same machine, therefore caching efficiency drops significantly.
    
    Possible solution: Declare the normalization strategy by annotating the property with either @PathSensitive, @Classpath or @CompileClasspath.
    
    For more information, please refer to https://docs.gradle.org/8.5/userguide/validation_problems.html#missing_normalization_annotation in the Gradle documentation.

https://github.com/gradle/gradle/blob/master/subprojects/core-api/src/main/java/org/gradle/api/tasks/PathSensitivity.java#L50

@get:InputFile
Copy link
Contributor Author

@ivanalvarado ivanalvarado May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addresses:

* What went wrong:
A problem was found with the configuration of task ':clearFocus' (type 'ClearFocusTask').
  - Type 'com.dropbox.focus.ClearFocusTask' property 'focusFile' has @Input annotation used on property of type 'RegularFileProperty'.
    
    Reason: A property of type 'RegularFileProperty' 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.
    
    For more information, please refer to https://docs.gradle.org/8.5/userguide/validation_problems.html#incorrect_use_of_input_annotation in the Gradle documentation.

public abstract val focusFile: RegularFileProperty

@TaskAction
Expand Down