Skip to content

BuildResult#task(<taskPath>) should have good error message when task path is not absolute #91

Open
@lacasseio

Description

@lacasseio

As a developer using Gradle Runner Kit, I want an accurate error message when the task path is not absolute so I can find the API usage issue easily.

An even better solution would be to make it a compiler error; however, I don't think that would be possible. We could use something like BuildResult#task(String firstTaskPathSegment, String... otherTaskPathSegment), ex: result.task('UpToDateCheck', 'AppDebug'). However, I prefer something else to this. We could model the TaskPath to something like TaskPath.absolute(String path) where the path specified implicitly starts with :. Or at least something that signals to the user the path is absolute (not relative). We should probably start with an internal model and simply convert the specified taskPath into the model, which should take care of the exception handling.

Acceptance Criteria

  • Given a relative task path MyProject:myTask, when calling BuildResult#task an exception should be thrown explaining the specified path is relative (in Gradle terms), and it needs to be absolute.

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