SuperDevMode 入门 [英] Getting started with the SuperDevMode

查看:19
本文介绍了SuperDevMode 入门的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想使用 superDevMode 运行一个简单的应用程序来了解它的好处.CodeServer 已成功启动,但它抱怨 UI 中没有要编译的 gwt 模块.我按照以下步骤操作.

I just want to run a simple app using superDevMode to know its benefits. The CodeServer is getting started successfully, but it is complaining there is no gwt modules to compile in the UI. I followed the following steps.

  1. 我从创建新项目时生成的 GWT 默认代码开始.然后我将其转换为 Maven 项目.
  2. 然后我修改了我的 gwt.xml 文件以添加链接器.这是我的 gwt.xml 的副本

  1. I started with GWT Default code which will be generated when we create the new project. I then converted it to Maven project.
  2. I then modified my gwt.xml file to add the linker. Here is the copy my gwt.xml

<module rename-to='superdevmode'>
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.user.theme.clean.Clean' />
<entry-point class='superDevMode.client.SuperDevMode' />
<add-linker name="xsiframe" />
<set-configuration-property name="devModeRedirectEnabled"
value="true" />
</module>

  • 我添加了代码服务器 jar 并设置了正确的类路径.

  • I added the codeserver jar and set the proper classpath.

    Codeserver 启动成功.

    Codeserver is getting started successfully.

       The code server is ready.
       Next, visit: http://localhost:9876/
    

    当我启动 UI 时得到以下信息

    When I launch the UI am getting the following

    但是当我点击 Dev Mode On 时,我得到以下内容

    But when I click on Dev Mode On, am getting the following

    我不知道我做错了什么.我的 POM 条目如下所示.

    I don't know what I am doing wrong. My POM entry looks like this.

                  <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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>superDevMode</groupId>
    <artifactId>superDevMode</artifactId>
    <version>0.0.1-SNAPSHOT</version>
                 </project>
    

    如果我错了,请纠正我.

    Correct me if i am wrong.

    推荐答案

    更新:v2.6 看起来将有一个更好的 superdevmode 示例启动器(参见 superdevmode 下的 http://www.gwtproject.org/release-notes.html#Release_Notes_2_6_0_RC1 ) 2.6 将发布现在任何一天.我正在使用 RC3,看起来不错.更多信息:

    Update: v2.6 looks like it will have a better example launcher for superdevmode (see under superdevmode at http://www.gwtproject.org/release-notes.html#Release_Notes_2_6_0_RC1 ) 2.6 will be released any day now. I am using RC3 and it seems fine. More here:

    虽然我很欣赏 Thomas 文章中 SuperDevMode 工作原理的详细信息,但真正需要的是包含一些故障排除的分步指南.

    While I appreciate the detail on how SuperDevMode works in Thomas' article, what is really needed is a step-by-step guide with some trouble shooting.

    这是一步一步的.出错的地方太多了,SuperDev 模式页面 不是很具体.希望这能说明一切:

    Here is a step-by-step. There are so many places to go wrong and the SuperDev mode page is not very specific. Hopefully this makes it clear:

    1. 使用附加行配置您的模块 .gwt.xml 文件(您应该将其放在模块定义的底部,即在 </module> 之前):

    <add-linker name="xsiframe"/>
    <set-configuration-property name="devModeRedirectEnabled" value="true"/>
    <!-- enable source maps -->
    <set-property name="compiler.useSourceMaps" value="true" />
    

    1. 运行标准的 GWT 编译过程 - 在 Eclipse 中,这是GWT 编译项目..." - 这是您在部署 GWT 代码时通常执行的操作.毫无疑问,您也有一个 maven 或 ant 命令可以执行此操作.

    1. Run the standard GWT compile process - in Eclipse this is "GWT Compile Project..." - this is what you typically do when you are deploying GWT code. No doubt you have a maven or ant command that does this as well.

    启动您在开发 GWT 代码时通常使用的常规网络服务器.例如,您使用普通 DevMode 的那个.我将其称为 localhost:8888 - 我假设您通常启动的页面是 index.html,因此 http://localhost:8888/index.html 显示您的 GWT应用程序.(您通常在该 URL 中可能有 ?gwt.codesvr=127.0.0.1:9997)

    Start a regular webserver that you'd normally use when developing your GWT code. For example, the one you used normal DevMode with. I'll call this one localhost:8888 - I'm going to presume the page you'd normally launch is index.html, so http://localhost:8888/index.html shows your GWT app. (you probably have ?gwt.codesvr=127.0.0.1:9997 in that URL normally)

    启动 SuperDevMode 服务器(有关两种方法,请参阅此答案的底部).您现在有两个网络服务器在不同的端口上运行.所以,假设 SuperDevMode 在 localhost:1234 上运行.在这个答案的底部,我发布了一些启动 SuperDevMode 的方法.

    Start the SuperDevMode server (see the bottom of this answer for two methods). You now have two webservers running - on different ports. So, lets say SuperDevMode is running on localhost:1234. At the bottom of this answer I posted some ways to start SuperDevMode.

    将浏览器指向 SuperDevMode 服务器,因此 http://localhost:1234 .按照说明将两个快捷方式复制到地址栏

    Point your browser to the SuperDevMode server, so http://localhost:1234 . Follow the instructions to and copy the two shortcuts to your addressbar

    现在,将浏览器指向常规网络服务器,http://localhost:8888/index.html - 不要添加 ?gwt.codesvr=127.0.0.1:9997 到 URL - 这仅适用于 NotSuper DevMode.(即常规 DevMode)

    Now, point your browser to the regular webserver, http://localhost:8888/index.html - do not add ?gwt.codesvr=127.0.0.1:9997 to the URL - that is only for NotSuper DevMode. (ie regular DevMode)

    点击您在步骤 5 中复制的快捷链接DevMode On".它应该要求您选择要编译的模块,点击 Compile 按钮.

    Click on the shortcut link "DevMode On" that you copied in Step 5. It should ask you to choose a module to compile, click the Compile button.

    如果您需要源地图(在 Chrome 脚本浏览器中查看您的 java 源代码),您必须在 Chrome 中打开它.在我的 Chrome (Ubuntu) 版本中,Chrome 控制台的右下角有一个小齿轮(检查元素,然后查看浏览器窗口的右下角).单击它并找到启用源映射".重新加载页面,它现在应该会显示源代码.

    If you want sourcemaps (see your java source code in the Chrome script browser) you must turn it on in Chrome. In my version of Chrome (Ubuntu) there is a little gear on the bottom right of the Chrome console (Inspect Element, then look on the bottom right of the browser window). Click that and find "Enable Source Maps". Reload the page and it should now show you the Source codes.

    <小时>

    启动超级开发模式的两种方式:


    Two ways to launch super dev mode:

    java -classpath $GWT_HOME/gwt-codeserver.jar:$GWT_HOME/gwt-dev.jar:$GWT_HOME/gwt-user.jar:app:./lib/*  com.google.gwt.dev.codeserver.CodeServer 
      -bindAddress 0.0.0.0 -port 1234 -src src -workDir work com.foo.MyModule
    

    来自 Eclipse Laucher

    在 Eclipse 中,使用以下配置创建一个新的 Java 应用程序启动器(不是 Web 应用程序启动器!):

    From an Eclipse Laucher

    In Eclipse, create a new Java Application Launcher (not a Web Application launcher!) with the following configuration:

    主类:

    com.google.gwt.dev.codeserver.CodeServer
    

    程序参数:

    -src src -workDir ${workspace_loc:MyProject}/codeserver -port 1234 com.foo.MyModule
    

    -workDir 是可选的

    VM 参数(根据项目的大小可能需要这些参数.如果单击后 superdevmode编译"按钮(在浏览器中)立即消失并且似乎没有任何反应,则可能因为内存不足而崩溃)

    VM arguments ( These may be needed depending on the size of your project. If the superdevmode "Compile" button (in the browser) disappears immediately after you click and nothing seems to happen, it may be crashing because of insufficient memory)

    -Xmx1024m -Xms512m
    

    类路径: 将 gwt-codeserver.jar、gwt-dev.jar 和 gwt-user.jar 添加到启动类路径(这些 jar 位于 GWT SDK 安装目录中).

    Classpath: add gwt-codeserver.jar, gwt-dev.jar and gwt-user.jar to the launch classpath (these jars are found in the GWT SDK installation directory).

    这篇关于SuperDevMode 入门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆