gwtphonegapp工作流程:创建phonegap应用程序的首选方式是什么?

时间:2015-12-18 10:54:48

标签: eclipse cordova gwt mgwt

我正在编写一个应该适用于iOS和Windows手机的应用程序。我正在使用gwtphonegapp。

我的问题是:这是什么首选工作流程?现在,我在eclipse中编译gwt应用程序然后手动将文件复制到包含config.xml的phonegap文件夹中,然后我将此文件夹压缩并构建使用phonegap构建。

这是唯一的方法吗?或者我可以以某种方式将Eclipse中的文件直接编译到phonegap项目中吗?

1 个答案:

答案 0 :(得分:0)

我使用maven自动复制文件。

但是,您必须使用超级开发模式(http://www.gwtproject.org/articles/superdevmode.html),以便您可以立即在手机或模拟器中测试代码更改! (与每次复制,打包和安装新应用程序相比。)

如果您使用超级开发模式,Cordova / GWT开发可以非常强大和高效。

为方便起见,这是我用于将GWT代码复制到我的cordova应用程序目录的maven pom配置:

<!-- copy to cordova app www -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.5</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <!-- here the phase you need -->
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.basedir}/${app.dir.name}/www</outputDirectory>
                            <resources>
                                <!-- !!! note: filtering corrupts binary files (e.g. mp3) - exclude them if filters needed -->
                                <resource>
                                    <directory>${project.basedir}/src/main/app</directory>
                                    <filtering>true</filtering>
                                    <includes>
                                        <include>*/**</include>
                                    </includes>
                                </resource>

                                <resource>
                                    <directory>${project.build.directory}/${project.build.finalName}</directory>
                                    <filtering>false</filtering>
                                    <includes>
                                        <include>${app.gwt.module}/**</include>
                                    </includes>
                                </resource>

                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
相关问题