Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19850

Mixing @Input and @OutputFile in one task field with Gradle 6+

$
0
0

In my pitest-gradle-plugin I have additionalClasspathFile file in a task:

@CompileStatic
class PitestTask extends JavaExec {

    @Input
    @OutputFile
    File additionalClasspathFile //RegularFileProperty after migration
...
}

It seems perfectly valid from the “business logic” point of view. additionalClasspathFile as @Input points out that name (location) is important as an input (not its content) and as @OutputFile is needed to tell others that my task - during execution - put there generated content (so it is output).

It generates deprecation warnings in Gradle 6:

Property 'additionalClasspathFile' has conflicting type annotations declared: @Input, @OutputFile; assuming @Input. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0.

As the last resort I could divide it into two files, but it just for technical reasons. Is that a known limitation of Gradle that I have to deal with or there is any better way to handle that with just one field?


Viewing all articles
Browse latest Browse all 19850

Trending Articles