Skip to content

Using dependsOn causes error #450

@sergeykad

Description

@sergeykad

I want to migrate from the official plugin and apart from replacing source with source.setFrom in configuration, everything went fine. That is until I replaced task dependency with the new task. I need to execute another task before generateJsonSchema2DataClass but all my attempts resulted in an error.

I tried the following approaches:

  1. generateJsonSchema2DataClass.dependsOn(myTask)
  2. tasks.generateJsonSchema2DataClass.dependsOn(myTask)
  3. project.tasks.generateJsonSchema2DataClass.dependsOn(myTask)
  4. generateJsonSchema2DataClass.configure { dependsOn myTask }
  5. tasks.withType(generateJsonSchema2DataClass).configureEach { dependsOn(myTask) }

I am always getting the following error: Could not get unknown property 'generateJsonSchema2DataClass' for task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.
except for the last two options which return:
Could not get unknown property 'generateJsonSchema2DataClass' for project ':objects' of type org.gradle.api.Project.

I am using Gradle v7.5

The issue can be related to #13

Metadata

Metadata

Assignees

Labels

need-more-infoFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions