On 24/04/2012, at 10:17 PM, Peter Niederwieser wrote: > Using a deprecation warning for statement labels in build scripts (which is a > bug in 99.9% of the cases) seems overly dogmatic to me. But more > importantly, turning errors into deprecations brings along two technical > problems that I haven't been able to solve: > > 1. If we don't fail the build, the build script will be cached. Since the > detection is implemented as an org.gradle.groovy.scripts.Transformer, > detection will not run again until the build script is edited. To the user, > this looks like a sporadic deprecation warning that's coming and going > without apparent reason.
You could map the label to a call to DeprecationLogger. > > 2. I can't find a way to determine the name and path of the build script > from within the transformer. This information is necessary to produce a good > deprecation message. (If we failed the build, this information would be > provided automatically.) I wouldn't necessarily worry about that for this story. Instead, we can fix DeprecationLogger to use the same logic as the error reporting (as a separate story, but possibly immediately after this deprecation story). -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com
