开发者

Flex Mobile Maven Build

I'm trying to find out if there is any way to build my flex mobile project using maven.

When I run my maven build I want to have an apk-file and an ipa-file as output of the build process. It would be re开发者_开发技巧ally cool if there would be a way to run the unit tests too.

What I wanna have is a solution, tutorial or an example of how to handle that.

Any suggestions?


Flex Mojos is the defacto standard for building Flex applications with Maven. To my knowledge it does not currently support mobile builds.

If you have experience with Ant, you can write an Ant-based build and use the Maven AntRun plugin to bind the execution of targets to Maven phases. Below is an example which does this for clean, compile, test and package:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <id>clean-project</id>
                    <phase>clean</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks>
                            <ant antfile="${basedir}/build/build.xml">
                                <target name="clean"/>
                            </ant>
                        </tasks>
                    </configuration>
                </execution>
                <execution>
                    <id>create-swf</id>
                    <phase>compile</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks unless="flex.skip">
                            <ant antfile="${basedir}/build/build.xml">
                                <target name="compile"/>
                            </ant>
                        </tasks>
                    </configuration>
                </execution>
                <execution>
                    <id>flexunit-tests</id>
                    <phase>test</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks unless="maven.test.skip">
                            <ant antfile="${basedir}/build/build.xml">
                                <target name="test"/>
                            </ant>
                        </tasks>
                    </configuration>
                </execution>
                <execution>
                    <id>generate-asdoc</id>
                    <phase>package</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks unless="asdoc.skip">
                            <ant antfile="${basedir}/build/build.xml">
                                <target name="asdoc"/>
                            </ant>
                        </tasks>
                    </configuration>
                </execution>
                <execution>
                    <id>dist</id>
                    <phase>package</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks>
                            <ant antfile="${basedir}/build/build.xml">
                                <target name="dist"/>
                            </ant>
                        </tasks>
                    </configuration>
                </execution>
            </executions>
            <dependencies>
                <!--
                    since we are using maven-antrun 1.6 which depends on ant 1.8.1
                    make sure the version number on ant-junit matches
                -->
                <dependency>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-junit</artifactId>
                    <version>1.8.1</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>


Most people I'm aware of make use of the Flex Mojos project. As I understand it, these are a set of Maven plugins for Flex Developers.


I need it too...

I did some googleing around...Here is what I ve found for pure maven solution.., so far, see this blog post, I tried, it works http://www.flexthinker.com/2011/07/how-to-build-a-flex-mobile-app-with-maven/

However, it is paid version and no official release...

Maybe I will use pure Ant, not fancy but more efficient

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜