GradleRunner fails for custom plugin with @InputFile


I am developing a Gradle plugin using Gradle 5.2.1. In my DefaultTask implementation (Kotlin), I have a property as follows:

@get:InputFile val inputSpec =<String>()

When running a Test with GradleRunner, it fails with:

* What went wrong:
Could not determine the dependencies of task ':openApiGenerate'.
> Cannot resolve object of unknown type String to a Task.

The plugin works if used in a standard Gradle project. When removing the @InputFile annotation, GradleRunner works.

GradleRunner is called with the following gradle file:

    plugins {
      id 'my.plugin'
    generator {
        inputSpec = file("./spec.yaml").absolutePath

GradleRunner is invoked like this:

        val result = GradleRunner.create()

Any idea why the @InputFile annotation wrecks havok with GradleRunner?


Turns out this issue is resolved when updating my gradle runtime to 5.6.4. Issue solved.