The Responding to the lifecycle in the build script example need modifications to work

Hello

Example 2. Adding of test task to each project which has certain property set in this link Build Lifecycle

the if statement need to be modified to the following code to make it work

if (project.hasProperty("hasTests") && project.hasTests) 

also it would be better to notifiy the reader that he/she would need to create subproject called project-a

and also the property in the build file in the project a should be changed to
ext.hasTests = true

cause there no hasTests property in the Project so we need to create one in the ext part

or maybe i miss something

so hope that help and have a nice day :slight_smile:

Hi there.
The “Meta” category, like its description says, is about topics regarding the forum here, not about Gradle.
And I’d suggest you open this documentation issue as issue on GitHub, so that the Gradle guys get aware of it and can fix the documentation.

done thanks @Vampire

1 Like