One of the major features of upcoming GWT release 2.7 is incremental compilation in SDM session. Because Buck recompilation is integrated as HTTP filter on every request, this optimization is jeopardized: Buck is unaware that a SDM debug session is active. We cannot entirely skip the Buck integration in SDM debug session as the site must be initialized at least once. Pass a Java property from Eclipse launch configuration and maintain initialization map with initialized flag per user agent for the site. This improves the time by a factor of 10, ca. 2 sec. for incremental recompilation on my laptop: Compilation succeeded -- 1,822s Linking into <site>/gerrit-gwtui/com.google.gerrit.GerritGwtUI/compile-5/war/gerrit_ui; Writing extras to <site>/gerrit-gwtui/com.google.gerrit.GerritGwtUI/compile-5/extras/gerrit_ui Link succeeded Linking succeeded -- 0,190s 2,140s total -- Compile completed Change-Id: Id2cb19a675d500c04e6748216a77dbb4f26fa1ab
		
			
				
	
	
		
			82 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			82 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
= Gerrit Code Review - Eclipse Setup
 | 
						|
 | 
						|
This document is about configuring Gerrit Code Review into an
 | 
						|
Eclipse workspace for development and debugging with GWT.
 | 
						|
 | 
						|
Java 6 or later SDK is also required to run GWT's compiler and
 | 
						|
runtime debugging environment.
 | 
						|
 | 
						|
 | 
						|
[[Formatting]]
 | 
						|
== Code Formatter Settings
 | 
						|
 | 
						|
Import `tools/GoogleFormat.xml` using Window -> Preferences ->
 | 
						|
Java -> Code Style -> Formatter -> Import...
 | 
						|
 | 
						|
This will define the 'Google Format' profile, which the project
 | 
						|
settings prefer when formatting source code.
 | 
						|
 | 
						|
 | 
						|
== Site Initialization
 | 
						|
 | 
						|
Build once on the command line with
 | 
						|
link:dev-buck.html#build[Buck] and then follow
 | 
						|
link:dev-readme.html#init[Site Initialization] in the
 | 
						|
Developer Setup guide to configure a local site for testing.
 | 
						|
 | 
						|
 | 
						|
== Testing
 | 
						|
 | 
						|
=== Running the Daemon
 | 
						|
 | 
						|
Duplicate the existing launch configuration:
 | 
						|
 | 
						|
* Run -> Debug Configurations ...
 | 
						|
* Java Application -> `gerrit_daemon`
 | 
						|
* Right click, Duplicate
 | 
						|
 | 
						|
* Modify the name to be unique.
 | 
						|
 | 
						|
* Switch to Arguments tab.
 | 
						|
* Edit the `-d` program argument flag to match the path used during
 | 
						|
  'init'.  The template launch configuration resolves to ../gerrit_testsite
 | 
						|
  since that is what the documentation recommends.
 | 
						|
 | 
						|
* Switch to Common tab.
 | 
						|
* Change Save as to be Local file.
 | 
						|
* Close the Debug Configurations dialog and save the changes when prompted.
 | 
						|
 | 
						|
 | 
						|
=== Running GWT Debug Mode
 | 
						|
 | 
						|
The gerrit_gwt_debug launch configuration uses GWT's
 | 
						|
link:http://www.gwtproject.org/articles/superdevmode.html[Super Dev Mode].
 | 
						|
 | 
						|
* Select in Eclipse Run -> Debug Configurations `gerrit_gwt_debug.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 to incrementally recompile changed files
 | 
						|
* 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
 | 
						|
 | 
						|
GERRIT
 | 
						|
------
 | 
						|
Part of link:index.html[Gerrit Code Review]
 | 
						|
 | 
						|
SEARCHBOX
 | 
						|
---------
 |