Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.5.1Release
-
Fix Version/s: 2.5.2.Release
-
Component/s: DSL Support
-
Labels:None
-
Number of attachments :
Description
In 2.5.2, we will be making some changes to the syntax of DSLDs. As much as possible, this will be backwards compatible, but some will not be. Here are some proposed changes that are not already covered under jiras.
- Instead of using {{pointcut().accept
{ ... } }}, we will support {{contribution( pointcut() ) { ... }
}}. The idea here is to bring the syntax more inline with IntelliJ's GDSL. Also, there will be no way to forget the pesky extra parens that you need around the pointcut declaration. The old syntax style will still be supported.
- supportsVersion will no longer throw an exception to end processing of the script. Rather, it will return a boolean. This will allow you to selectively run different portions of the script under different circumstances. Eg-
if (supportsVersion(groovy:"1.8.0")) { // do something specific for groovy 1.8 } else if (supportsVersion(groovy:"1.7.0")) { // do something specific for groovy 1.7 }
- The old way of throwing a runtime exception to stop processing when a version requirement fails will still work with assertVersion
- The pointcut currentTypeIsEnclosingType will be replaced by isThisType. Old pointcut will still be available, but deprecated
- The pointcut annotatedBy will allow the accessing of its attributes. Eg-
contribution(currentType(annotatedBy(name('groovy.transform.TupleConstructor') & hasAttribute(name("includeSuperFields") & value(true)))) { // add a new constructor } - Ability to add constructors as DSL proposals.
Let me know what you think of these changes and if there is anything that you really want changed. There will probably be more changes. This is just an initial list.
Complete.