Christofer -- that is good stuff. Like you, I use the generate goal
to create classes that work with BlazeDS. In my case, I felt the need
to avoid using any GraniteDS annotations in my code partially because
I didn't want the extra dependency and partially because I already
have Spring and JPA annotations that should have been enough. I've
written a tool I call gas3-helper which overrides some of the classes
in GAS3 via flexmojo configuration:
<extraOptions>
<!-- Customized remote destination factory class -->
<remoteDestinationFactory>com.mycorp.gas3helper.ServiceRemoteDestinationFactory</
remoteDestinationFactory>
<!-- Customized transformer class -->
<transformer>com.mycorp.gas3helper.EnhancedJavaAs3GroovyTransformer</
transformer>
<!-- Customized type mapper -->
<as3typefactory>com.mycorp.gas3helper.EnhancedAs3TypeFactory</
as3typefactory>
</extraOptions>
I have Maven compile my custom templates into this JAR and then I add
the JAR to flexmojos as a dependency. I then pull the templates out
of this JAR as follows:
<plugin>
<!-- Used to pull the Groovy templates for code
generation from the
Gas3-Helper JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-custom-groovy-templates</id>
<!-- Using the initialize phase because
it is before the generate
sources phase -->
<phase>initialize</phase>
<goals>
<!-- Using the unpack goal
because gas3-helper is not a
dependency of this module -->
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<!-- Artifact
Holds our custom templates -->
<groupId>com.mycorp</groupId>
<artifactId>gas3-helper</artifactId>
<version>${gas3helper.version}</version>
<type>jar</type>
</artifactItem>
</artifactItems>
<includes>**/*.gsp</includes>
<outputDirectory>${project.basedir}/target/templates</
outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Because my gas3-helper project is a tool, my company has no problem if
I open source it. I don't have time, but you've done such a good job
documenting all this, if you wish to create a gas3-blazeds open source
project, I'd be happy to send you my notes and the project. I'd also
be happy to be a contributor, I just don't have time (or knowledge) to
set it all up.
On Oct 27, 7:22 am, Christofer Dutz <[email protected]>
wrote:
> Hi,
>
> I just updated my documentation of how to configure Flexmojos Code
> generation in my wiki ... I extended it with the description of one of
> the new features of FM4-RC2 (custom templates in the classpath) ...
> perhaps it helps
> someone.https://dev.c-ware.de/confluence/display/PUBLIC/Generating+your+model
>
> Chris
--
You received this message because you are subscribed to the Google
Groups "Flex Mojos" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex-mojos
http://flexmojos.sonatype.org/