android - Flex 移动 Maven 构建

标签 android ios apache-flex maven flex-mobile

我想知道是否有任何方法可以使用 maven 构建我的 flex 移动项目。

当我运行我的 maven 构建时,我想要一个 apk 文件和一个 ipa 文件作为构建过程的输出。如果还有一种方法可以运行单元测试,那就太棒了。

我想要的是解决方案、教程或如何处理该问题的示例。

有什么建议吗?

最佳答案

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

如果您有使用 Ant 的经验,您可以编写基于 Ant 的构建并使用 Maven AntRun 插件将目标的执行绑定(bind)到 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>

关于android - Flex 移动 Maven 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6677766/

相关文章:

android - 在android中同时进行视频流和显示

java - 检查权限时应用程序无法转换为 android.app.Activity

java.lang.NullPointerException,尝试在 Android 应用程序上读取空对象引用上的字段

ios - 文字超出 iPhone 上的 View

java - Flex/Java Web 应用程序的外部化客户端 ChannelSet 配置

android - 我们可以使用 React Native 在 Android 系统中运行简单的 shell 脚本吗?

iphone - 将 UIView 添加到 ScrollView 时发生奇怪的事情

iphone - "<Error>: doClip: empty path"- 来自 WebView

flash - 如何查看 Flash 源代码?

ios - Flash Builder iOS 导出版本错误格式版本标签无效