Flex 移动 Maven 构建

发布于 2024-11-24 05:22:01 字数 181 浏览 2 评论 0原文

我正在尝试找出是否有任何方法可以使用 Maven 构建我的 Flex 移动项目。

当我运行 Maven 构建时,我希望有一个 apk 文件和一个 ipa 文件作为构建过程的输出。如果有一种方法也可以运行单元测试,那就太酷了。

我想要的是一个解决方案、教程或一个如何处理这个问题的例子。

有什么建议吗?

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 really 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

ζ澈沫 2024-12-01 05:22:01

Flex Mojos 是使用 Maven 构建 Flex 应用程序的事实标准。据我所知,它目前不支持移动版本。

如果您有使用 Ant 的经验,则可以编写基于 Ant 的构建并使用 Maven AntRun 插件将目标的执行绑定到 Maven 阶段。下面是一个针对清理、编译、测试和打包执行此操作的示例:

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

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>
埋情葬爱 2024-12-01 05:22:01

我认识的大多数人都使用 Flex Mojos 项目。据我了解,这些是一组供 Flex 开发人员使用的 Maven 插件。

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.

洛阳烟雨空心柳 2024-12-01 05:22:01

我也需要它...

我做了一些谷歌搜索...这是我找到的纯 Maven 解决方案...,到目前为止,请参阅这篇博客文章,我尝试过,它有效
http://www.flexthinker.com/2011/07/how-to-build-a-flex-mobile-app-with-maven/" flexthinker.com/2011/07/how-to-build-a-flex-mobile-app-with-maven/

但是,它是付费版本,没有正式发布......

也许我会使用纯Ant,不花哨但更高效

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文