GWT DevMode is dead; set up SuperDevMode

The codeserver runs separately and cannot easily be embedded in Gerrit
because it depends on an outdated version of Jetty. We may change this
behavior when GWT is updated.

Prerequisite is to download gwt-codeserver.jar and dependencies:

  buck build codeserver

Start CodeServer with new launch configuration:

  tools/eclipse/gerrit_gwt_codeserver.launch

And follow the instructions: [1].

[1] http://stackoverflow.com/a/18333050/116472

Inspired-By: Thomas Broyer <t.broyer@gmail.com>
Change-Id: Ieff7190db6bc151eae1274105ccf828eaa652027
This commit is contained in:
David Ostrovsky 2014-06-03 11:14:57 +02:00 committed by Dave Borowitz
parent 925f1d9d29
commit 12968f26df
4 changed files with 112 additions and 0 deletions

View File

@ -12,6 +12,7 @@
release = //:release
safari = //:safari
withdocs = //:withdocs
codeserver = //lib/gwt:codeserver
[buildfile]
includes = //tools/default.defs

View File

@ -67,6 +67,53 @@ Duplicate the existing launch configuration:
* Close the Debug Configurations dialog and save the changes when prompted.
=== Running Super Dev Mode
Install dependencies:
----
buck build codeserver
----
Due to codeserver not correctly identifying user agent problem, that was
already fixed upstream but not released yet, the used user agent must be
explicitly set in `GerritGwtUI.gwt.xml` for SDM to work:
[source,xml]
----
<set-property name="user.agent" value="geko1_8" />
----
or
[source,xml]
----
<set-property name="user.agent" value="safari" />
----
* Select in Eclipse Run -> Debug Configurations `gerrit_gwt_codeserver.launch`
* Select in Eclipse Run -> Debug Configurations `gerrit_daemon.launch`
* Only once: add bookmarks for `Dev Mode On/Off` from codeserver URL:
`http://localhost:9876/` to your bookmark bar
* Make sure to activate source maps feature in your browser
* Load Gerrit page `http://localhost:8080`
* Open developer tools, source tab
* Click on `Dev Mode On` bookmark
* Select `gerrit_ui` module to compile (the `Compile` button can also be used
as a bookmarklet).
* Navigate on the left to: sourcemaps/gerrit_ui folder (`Ctrl+O` key shortcut
can be used)
* Select a file, for example com.google.gerrit.client.change.ChangeScreen2
and put a breakpoint
* Navigate in application in change screen and confirm hitting the breakpoint
* Select `Dev Mode Off` when the debugging session is finished
After changing the client side code:
* click `Dev Mode On` then `Compile` to reflect your changes in debug session
* Hitting `F5` in the browser will just load the last compile output, without
recompiling
[[known-problems]]
== Known problems

View File

@ -18,11 +18,32 @@ maven_jar(
deps = [
':javax-validation',
':javax-validation_src',
':json',
],
attach_source = False,
exclude = ['org/eclipse/jetty/*'],
)
maven_jar(
name = 'codeserver',
id = 'com.google.gwt:gwt-codeserver:' + VERSION,
sha1 = '940edc715cc31b1957e18f617f75a068f251346a',
license = 'Apache2.0',
deps = [
':dev',
':legacy-jetty-servlet-aggregate',
],
attach_source = False,
)
maven_jar(
name = 'json',
id = 'org.json:json:20140107',
sha1 = 'd1ffca6e2482b002702c6a576166fd685e3370e3',
license = 'DO_NOT_DISTRIBUTE',
attach_source = False,
)
maven_jar(
name = 'javax-validation',
id = 'javax.validation:validation-api:1.0.0.GA',
@ -52,3 +73,21 @@ maven_jar(
visibility = [],
)
maven_jar(
name = 'legacy-jetty-servlet-aggregate',
id = 'org.eclipse.jetty.aggregate:jetty-servlet:8.1.12.v20130726',
sha1 = '4d0f0cb6e5a54de01be46717a7ab48d0b45dcadd',
license = 'Apache2.0',
attach_source = False,
deps = [':legacy-jetty-servlets'],
visibility = [],
)
maven_jar(
name = 'legacy-jetty-servlets',
id = 'org.eclipse.jetty:jetty-servlets:8.1.12.v20130726',
sha1 = '4ebc6894b899fee0c3597697d11f255ce9214bbf',
license = 'Apache2.0',
attach_source = False,
visibility = [],
)

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/gerrit"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7&quot; javaProject=&quot;gerrit&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/gerrit/buck-out/gen/lib/gwt/legacy-jetty-servlet-aggregate/jetty-servlet-8.1.12.v20130726.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/gerrit/buck-out/gen/lib/gwt/codeserver/gwt-codeserver-2.6.1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/gerrit/buck-out/gen/lib/gwt/legacy-jetty-servlets/jetty-servlets-8.1.12.v20130726.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;gerrit&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.codeserver.CodeServer"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-noprecompile&#10;-src ${resource_loc:/gerrit}&#10;-workDir ${resource_loc:/gerrit}/buck-out/gen/gerrit-gwtui&#10;com.google.gerrit.GerritGwtUI"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="gerrit"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx1024M&#10;-XX:MaxPermSize=256M"/>
</launchConfiguration>