--
You received this message because you are subscribed to the Google Groups "gradle-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gradle-dev+...@googlegroups.com.
To post to this group, send email to gradl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/1421243559824.27b5c11a%40Nodemailer.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/etPan.54b720a3.3a95f874.37d%40Trajan.local.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/CAPRP4ruyeoeMsCEGvsgKVn3uOxsyyp0yyMU2X9wqsfrhRTEkEA%40mail.gmail.com.
On 19 January 2015 at 4:14:52 am, Daz DeBoer (darrell...@gradleware.com) wrote:
An alternative would be to prevent the adding of 'afterEvaluate' actions to an already-evaluated project.
We do assume in the codebase that once a project has been evaluated we know all we are going to know about it. If we can get away with this, then this feels to be the better option to reduce the spaghetti-ness.
However, I think (based on what I’ve seen) that the kinds of things that users would do in afterEvaluate() that would clash with our assumptions is kinda small. It would probably work for the most part.
Options as I see them:
1. Do nothing (keep current no-op behaviour)
2. Error when adding afterEvaluate() to evaluated project
3. Run afterEvaluate() immediately
Strictly speaking I guess only #1 is backwards compatible. #2 feels the least backwards compatible. I’m in favour of #3, but think #2 is also a decent option.
How are you accessing the project that is already evaluated?What's the use case for modifying the project after it has been evaluated?
This can happen unintentionally quite easily. A common one is to call evaluationDependsOnChildren() and then do more configuration injection into the children.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/CAPRP4ruyeoeMsCEGvsgKVn3uOxsyyp0yyMU2X9wqsfrhRTEkEA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/etPan.54c5a393.741226bb.d1da%40Trajan.local.
On 27 January 2015 at 12:55:22 am, Lóránt Pintér (lorant...@gmail.com) wrote:
I think strict checking (#2) would be great, but it doesn’t sound realistic with the current options for configuration. Maybe with the new configuration model things would be different.
Very much so. Configuration dependencies are taken on individual elements, rather than using the imprecise concept of project evaluation in order to configuration.
Furthermore, constructs analogous to project.afterEvaluate() are declarative in that we know about them very early in the process and they can’t be declared by anything at anytime.
So how about a warning + executing the code immediately?
+1
—
Lóránt
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/1422280518577.56affdc1%40Nodemailer.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/etPan.54c6ddfa.238e1f29.15904%40Trajan.local.