Yes, we are using a mechanism that uses ProjectBuilder itself with some additional general methods we have added. But internal we use the following API:
Yes, I can reproduce the issue with 2.0. This still worked in 1.12. I’d have to have a deeper look at the code to find out what has changed between both versions. I am going to open an issue if it happens to be a bug.
A reasonable alternative is to write integration tests with the help of the tooling API. However, it requires some setup on your end. For a quick start have a look nebula-test.
Is it correct that you already had these tests written using ‘ProjectBuilder’ that used to work with 1.12? Now that you are trying to upgrade to 2.0, your tests are broken as ‘afterEvaluate’ is not called under certain circumstances?
We had these tests written using ProjectBuilder with 1.9, and we started to migrate to 1.12 - as I remember they worked with 1.12, too. So now we decided to migrate to 2.0 and skip the step to 1.12.
And now the all tests which wait for extensions to be filled don’t work anymore. Even other things are done in afterEvaluate().
I had a chance to have a look at the code in 2.0. The method ‘getTasksByName’ explicitly calls ‘evaluate’. Please have a look at AbstractProject. This means that evaluation happens before your ‘afterEvaluate’ is declared.
Depending on what you are trying to assert in your test case, you might just want look up the task(s) needed without using the method ‘getTasksByName’.