Results 1 to 7 of 7

Thread: Spring Actionscript flex-config generation mojo for maven

Hybrid View

  1. #1
    Join Date
    Feb 2008
    Location
    Vermont
    Posts
    32

    Smile Spring Actionscript flex-config generation mojo for maven

    I wrote a simple maven mojo that will take a list of spring-actionscript context files and generate a flex-config file to a specified output location.

    It currently just uses XSL internally so it isn't that big of an improvement over the existing ant xslt task if you are using that, but if you are using flex-mojos to do the build it can help streamline things. (Plus, it can be rewritten pretty easily to not use xslt so it can handle multiple input flies more intelligently)

    Until flex-mojos provides a way to add in additional config files, this wont be very useful.

    I wrote a patch for flexmojos that I just submitted to them:

    https://issues.sonatype.org/browse/FLEXMOJOS-268

    If someone tells me where to send it, I can zip up the sources for the spring-actionscript prebuild mojo I wrote so it can be included somewhere in the spring-actionscript world and improved upon by the community.

  2. #2
    Join Date
    Feb 2008
    Location
    Vermont
    Posts
    32

    Default Here it is

    Oh, I see I can attach .zip files. Here's a .zip of it. The mojo is written to fall into the spring-actionscript groupID and such to make it easy to include if you want to.
    Attached Files Attached Files

  3. #3
    Join Date
    Feb 2010
    Posts
    3

    Default

    I Ryan,

    I'm interested by your mojo. Who it works ? What i have to do in order to use it in my project ?

    Thks

    Olivier

  4. #4
    Join Date
    Feb 2008
    Location
    Vermont
    Posts
    32

    Default

    Quote Originally Posted by wari View Post
    I Ryan,

    I'm interested by your mojo. Who it works ? What i have to do in order to use it in my project ?

    Thks

    Olivier
    Currently, you'll have to download the zip file and then open the directory it is contained in and run "mvn install" on the mojo to get it into your local repository (since nobody is hosting the mojo yet)

    Then, you use it like this:

    Code:
     ...
    <!-- set up properties to make it easy for both plugins (the prebuild and the maven-mojo) to use the same file locations -->
        <properties>
            <generatedCompilerConfigName>spring-as-includes.config</generatedCompilerConfigName>
            <generatedCompilerConfigDir>${project.build.sourceDirectory}</generatedCompilerConfigDir>
        </properties>
     <build>
           ...
            <plugins>
                <plugin>
                    <groupId>org.springextensions.actionscript</groupId>
                    <artifactId>prebuild-mojo</artifactId>
                    <version>0.1-SNAPSHOT</version>
                    <executions>
                        <execution>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>generate-compiler-config</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <springActionscriptContextFiles>
                            <param>${basedir}/src/main/flex/YOUR-CONTEXT-FILE.xml</param>
                        </springActionscriptContextFiles>                    
                        <outputDirectory>${generatedCompilerConfigDir}</outputDirectory>
                        <generatedConfigFileName>${generatedCompilerConfigName}</generatedConfigFileName>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.flexmojos</groupId>
                    <artifactId>flexmojos-maven-plugin</artifactId>
                    <version>3.6-SNAPSHOT</version>
                    <configuration>
                ...
                        <configFiles>
                           <file>${generatedCompilerConfigDir}/${generatedCompilerConfigName}</file>
                        </configFiles>
           ...
                    </configuration>
    
                </plugin>
            </plugins>
        </build>
    ...
    My hope is that the spring-actionscript group would take up the prebuild-mojo and put it in the spring-actionscript repository.

    You need to use the flex-mojos 3.6-snapshot version because that's the version with my patches in it to let it handle multiple config files properly.

    I'm using this setup in my build in a few apps and it works great.

  5. #5
    Join Date
    Feb 2010
    Posts
    3

    Default

    Thanks,

    I'll try it tomorrow

    Olivier

  6. #6
    Join Date
    Feb 2010
    Posts
    3

    Default

    I Ryan,

    It works great

    I just found something strange, in may generated config-report the spring-as-includes.config is included twice.

    Code:
    [...]
    <load-config>[...]\src\main\flex\spring-as-includes.config</load-config>
    <load-config>[...]\src\main\flex\spring-as-includes.config</load-config>
    [...]
    Thanks again

    Olivier

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •