Skip to content

Using dependsOn causes error #451

Answered by eirnym
sergeykad asked this question in Q&A
Discussion options

You must be logged in to vote

Correct, you can't hook on the generator task itself. Currently, all tasks are created on afterEvaluate stage. This could be changed later on if more precision is required.

Generator task depends on ProcessingResources and lombok and compile tasks (java and kotlin) depend on generator task.

Thus you may hook either before ProcessingResources or after build.

To pack schemas and sources I use following scripts for a project where many models built at once:

// part of jsongen.groovy
task copySchemas(type: Copy) {
   from jsonDirBase            // original schema placement
   into targetJSONBaseDir // some random directory under build folder
}
project.tasks.build.dependsOn(copySchemas) // it'…

Replies: 11 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by eirnym
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #450 on October 12, 2022 10:19.