Issue Details (XML | Word | Printable)

Key: GDS-469
Type: New Feature New Feature
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Franck Wolff
Reporter: Steven Rasschaert
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
GraniteDS

Ant task: support for annotation scanning (to select classes for generation + extra enum properties copying)

Created: 17/Jul/09 10:35 AM   Updated: 07/Apr/10 07:05 PM   Resolved: 07/Apr/10 07:05 PM
Component/s: AS3 code generation
Affects Version/s: 2.0.0_B1
Fix Version/s: None

File Attachments: 1. File org.granite.builder_2.0.0.B1-annotations.rar (10 kB) 17/Jul/09 10:35 AM - Steven Rasschaert



 Description  « Hide
For now I added the functionality myself, but can this feature be added in the next release? Otherwise we can't follow the next releases of this great tool and we're stuck with our version.

What I did myself:

I added support for 2 kinds of annotations to the generator:
- "annotationClassname": classes with this annotation are selected for generation of an AS3 equivalent
- "enumPropertyClassname": property getters of an enum with this annotation are taken along in the generation. That is, in the enum template you will have access to a "properties" variable like in beanBase template.

I attached the files that I've changed from the generator/builder project. I started from the 2.0.0_B1 version.

Brief Summary:
- AntJavaAs3Task.java
Added support for 2 extra attributes:
- annotationClassname: will be used to scan the given fileset for this annotation's presence. If present, AS3 equivalent will be generated
- enumPropertyAnnotationClassname: will be used by the JavaEnum class (read further on) to take extra defined properties of an enum along in the generation

- JavaEnum.java
Support for enum properties, together with a custom enum.gsp (Groovy Template, see project where build.xml uses the AntJavaAs3Task Ant task)
That is: if properties are marked with the "enumPropertyAnnotationClassname", defined as attribute of the Ant task, they will be taken also in the generation as extra properties in the AS3 enum equivalent.
That way, we don't loose these settings we created in Java Enums..

- JavaAs3GroovyTransformer.java
Support for "enumPropertyAnnotationClassname" property that will be passed to a JavaEnum class instance (see higher)

Thanks in advance!!

William Draï added a comment - 26/Aug/09 11:05 AM
Thanks for the patch, we'll try to include it in gas3.
There is however some overlap with GDS-494 concerning enums and we are not sure what option to choose (having a enum.gsp/enumBase.gsp would allow you to have

Franck Wolff added a comment - 07/Apr/10 07:05 PM
Too old...