Skip to content

Constraints on the "WorkParameters" interface #295

@lacasseio

Description

@lacasseio

@nedtwigg commented on Tue Aug 20 2019

What the guide says:

  • Use Property objects to represent the source and MD5 hash files.

What I found to be true after some trial and error:

  • Every method in the interface needs to start with get
  • Every method in the interface needs to return an org.gradle.api.provider.Property

If you don't do all of the above, then you will get errors like:

> Could not create an instance of type com.diffplug.gradle.imagegrinder.ImageGrinderTask$Params.
  > Could not generate a decorated class for interface com.diffplug.gradle.imagegrinder.ImageGrinderTask$Params.
    > Cannot have abstract method Params.taskRef().

It would help if:

  • the documentation clearly stated that every method should be a getXXX()
  • the error message suggested "maybe the interface should be getXXX() instead of `XXX()".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions