gradle-docker icon indicating copy to clipboard operation
gradle-docker copied to clipboard

dockerTag tasks shouldn't be created in afterEvaluate closure

Open iamdanfox opened this issue 8 years ago • 3 comments

This means that I can't set up dependencies in the body of my gradle files, like this benign example:

integTest.dependsOn dockerTagLatest

Complains with:


* Where:
Build file '/Users/dfox/my-project/my-project/my-project.gradle' line: 16

* What went wrong:
A problem occurred evaluating project ':my-project'.
> Could not get unknown property 'dockerTagLatest' for project ':my-project' of type org.gradle.api.Project.

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

iamdanfox avatar Jul 14 '17 13:07 iamdanfox

Want to make a PR?

uschi2000 avatar Jul 14 '17 13:07 uschi2000

Actually I think you can if you use a closure:

integTest.dependsOn { dockerTagLatest }

That being said, it would be more comfortable to have the tasks defined before afterEvaluate.

joffrey-bion avatar May 07 '18 09:05 joffrey-bion

You can do dependsOn 'dockerTagLatest' ;)

dansanduleac avatar Jun 23 '18 23:06 dansanduleac