简体   繁体   English

如何让GWT Super Dev Mode与IntelliJ配合使用

[英]How to get GWT Super Dev Mode to work with IntelliJ

I had a lot of issues getting Super Dev mode to work with IntelliJ. 我有很多问题让Super Dev模式与IntelliJ一起工作。 This question, and my answer below, are to document how to do this, for anyone else who might come across this in future (and for my own reference): 这个问题,以及我在下面的回答,是为了记录如何做到这一点,对于将来可能会遇到这个问题的任何人(以供我自己参考):

1) Put the following lines in the module's .gwt.xml code: 1)将以下行放在模块的.gwt.xml代码中:

<!-- Super Dev Mode Config: -->
  <add-linker name="xsiframe" />
  <set-configuration-property name="devModeRedirectEnabled" value="true" />
  <set-configuration-property name="gwt.superdevmode" value="on" />
  <set-property name="compiler.useSourceMaps" value="true"/>

2) Make two GWT run configurations in IntelliJ, one with Super Dev mode turned on, and the other with super dev mode off. 2)在IntelliJ中进行两个GWT运行配置,一个打开Super Dev模式,另一个打开super dev模式。

First config (Code Server): 第一个配置(代码服务器): 在此输入图像描述

Second config (Dev mode): 第二个配置(开发模式):

在此输入图像描述

3) Run the CodeServer run config. 3)运行CodeServer运行配置。 It will give an output such as: 它会给出如下输出:

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

Visit that URL. 访问该网址。 There will be a 'Dev mode on' button. 将有一个'开发模式'按钮。 Drag it to bookmarks bar. 将其拖动到书签栏。 Then, click the name of the module on this page, browse its source code to locate the .nocache.js file. 然后,单击此页面上模块的名称,浏览其源代码以找到.nocache.js文件。

4) Within the host page html, change the path to the existing nocache.js file to point to the nocache.js file whose link was copied in step 3. Eg: 4)在主机页面html中,将现有nocache.js文件的路径更改为指向在步骤3中复制了链接的nocache.js文件。例如:

<script type="text/javascript" language="javascript" src="http://localhost:9876/Touch/Touch.nocache.js"></script>

5) Now run the 2nd run config. 5)现在运行第二次运行配置。 It will go to the gwt dev mode url, with ?gwt= etc url arguments. 它将转到gwt dev模式url,带有?gwt= etc url参数。 Remove those url arguments, and refresh the page. 删除这些url参数,然后刷新页面。 You should now be able to see the host page. 您现在应该能够看到主页。 If the code server run config is already running, then GWT code might automatically run. 如果代码服务器运行配置已在运行,则GWT代码可能会自动运行。

6) When any changes are made to the project, simply click the 'Dev mode on' bookmarklet that was added earlier. 6)当对项目进行任何更改时,只需单击之前添加的“开发模式”书签。 It will give the name of the module, and a compile button. 它将给出模块的名称和编译按钮。 Click the Compile button, and it will recompile the module (happens fairly quickly), and refresh the page. 单击Compile按钮,它将重新编译模块(发生得相当快),并刷新页面。

7) The compile button can also be dragged to the bookmark bar, to skip the step of clicking the 'Dev mode on' bookmark. 7)编译按钮也可以拖动到书签栏,跳过单击“开发模式”书签的步骤。

EDIT: This answer is not complete and has some issues. 编辑:这个答案不完整,有一些问题。 If someone would like to correct it, please edit it. 如果有人想要更正它,请编辑它。 If anyone reviewers see edits on this answer, please approve them. 如果有任何评论者看到对此答案的修改,请批准他们。

@Click Upvote 's answer is not right. @Click Upvote的回答是不对的。 You don't have to replace the host html page is script tag's src attribute. 您不必替换主机html页面是脚本标记的src属性。 Or you'll find out every GWT RPC request will send to port 9876(on which the code server runs) instead of the web server port(8080 for example). 或者你会发现每个GWT RPC请求都将发送到端口9876(运行代码服务器)而不是Web服务器端口(例如8080)。

there is a post talking about this problem here . 有一个帖子在谈论这个问题在这里

by the way i'm using gwt 2.6.1 and Intellij 13.0.1 顺便说一句,我使用的是gwt 2.6.1和Intellij 13.0.1

IntelliJ IDEA 14 EAP now offers improved support for GWT Super Dev Mode. IntelliJ IDEA 14 EAP现在为GWT Super Dev Mode提供了更好的支持。 You will need to use the JetBrains IDE Plugin for JavaScript debugging on Chrome, and install GWT 2.6.1 . 您需要在Chrome上使用JetBrains IDE插件进行JavaScript调试,并安装GWT 2.6.1 You can then enable Super Dev Mode support directly under "Run configurations" - for more information, check out our blog post and this webinar for a quick demonstration. 然后,您可以直接在“运行配置”下启用超级开发模式支持 - 有关更多信息,请查看我们的博客文章此网络研讨会以进行快速演示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM