Announcement Announcement Module
Collapse
No announcement yet.
Spring Actionscript flex-config generation mojo for maven Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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

      Comment


      • #4
        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.

        Comment


        • #5
          Thanks,

          I'll try it tomorrow

          Olivier

          Comment


          • #6
            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

            Comment


            • #7
              that's a bug in flex-mojos

              the inclusion of it twice in the config is a bug in flex-mojos... although I did submit the patch to flex-mojos so it's technically my bug.

              In any case, having it include the file twice has no ill effects (it doesn't force it to add the files twice, they just get added once).

              Flex Mojos 3.6 has been released, so you can use it in a project without having to result in using snapshot dependencies.

              I'm willing to do maintenance on the mojo, but I'd rather not create my own project somewhere just to maintain a few hundred line of code wrapper - it would be nice if this could be included in the Spring-Actionscript project.

              Comment

              Working...
              X