Flex build support -- any success?

I'm trying to get idea (either 8.1 released or 9757 to build an swf for me.  I've checked the "IDE builder" box in the flex facet.  But IDEA keeps forgetting the path to my flex SDK, replacing it with the IDEA bin directory.  I can get idea to recognize/highlight .as files but it won't build them.

It's also clear that maven support is not yet present, as swc/swf files are simply ignored when pom's are parsed.

Are my troubles with building because I'm using maven, even though I've manually configured the flex facet?

Has anyone had any luck with this?

Thanks,

c

0
3 comments

Hi, Christopher,

Maven Plugin supports flex-mojos:2 and should recognize dependencies correctly should you configured your pom file correctly.
If you have some problems with this, please attach the pom files and describe the problems in detailt.

Thanks,
Anton Makeev

0
Avatar
Permanently deleted user

Yes!  I seem to have it working.  For future reference, here's what I did.  I had a lot of trouble finding the right repos for flex-mojos.  Once I got this set up correctly, idea seems to correctly recognize the swc dependencies!  I only had to add a flex SDK: Project Structure -> JDKs -> [+] -> Flex SDK.   This is confusing, because the flex facet seems to want a directory, but it really wants you to select the already configured SDK from the popup based on it's directory.  (It looks like this will be fixed soon).  I ignored the message about missing the Flex SDK llibrary, because the dependencies are already set up automatically via maven plugin.  I select the Main.mxml and say run and it builds correctly and runs in flash.  Thanks for this!  It's very slick!



<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>example-flex</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>swf</packaging>
    <name>example-flex</name>
    <parent>
        <groupId>com.example</groupId>  <!-- I can't use flex-super-pom because I'm in multi-module project -->
        <artifactId>example</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <repositories>
        <repository>
            <id>flex-mojos-repository</id>
            <url>http://svn.sonatype.org/flexmojos/repository</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
    </repositories>
   
    <pluginRepositories>
        <pluginRepository>
            <id>flex-mojos-repository</id>
            <url>http://svn.sonatype.org/flexmojos/repository</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>com.adobe.flex.framework</groupId>
            <artifactId>flex-framework</artifactId>
            <version>${flex.sdk.version}</version>
            <type>pom</type>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>
        <testSourceDirectory>src/test/flex</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>info.flex-mojos</groupId>
                <artifactId>flex-compiler-mojo</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <includeSources>
                        <param>${project.build.sourceDirectory}</param>
                    </includeSources>
                    <locales>
                        <param>en_US</param>
                    </locales>
                </configuration>
            </plugin>
            <plugin>
                <groupId>info.flex-mojos</groupId>
                <artifactId>asdoc</artifactId>
            </plugin>
        </plugins>

    </build>


    <properties>
        <!-- <flex.sdk.version>3.0.0.3.0.0.477</flex.sdk.version> -->
        <flex.sdk.version>3.2.0.3958</flex.sdk.version>
    </properties>

</project>

0
Avatar
Permanently deleted user

Christopher,

Thanks for posting this information. We have a flex project coming up. The entire team will be new to flex and we only have one small project worth of experience with Maven. So I know this information will be useful.

It's always great when people take the time like you did to post the solution they found to their issues. It serves as a great future reference for people and makes this Internet thing rather useful, and kind of cool.

Regards,
Lance

0

Please sign in to leave a comment.