summaryrefslogtreecommitdiffstats
path: root/Documentation/dev-eclipse.txt
blob: e239a63edc7d5da24d0e72880b945dd927fd21d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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.


Maven Plugin
------------

Install the Maven Integration plugins:

http://www.eclipse.org/m2e/download/[m2eclipse]


[[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.


Import Projects
---------------

Import the projects into Eclipse by going to File -> Import... -> Maven ->
Existing Maven Projects and selecting the directory containing pom.xml.

Some of the source code is generated with ANTLR sources.  To build
these files, right click on the imported projects, Maven -> Update
Project Configuration.  This will resolve compile errors identified
after import.


Site Initialization
-------------------

link:dev-readme.html#build[Build] once on the command line 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 `pgm_daemon` launch configuration:

* Run -> Debug Configurations ...
* Java Application -> `pgm_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 ../test_site
  since that is what the documentation recommends.

* Switch to Common tab.
* Change Save as to be Local file.


Running Hosted Mode
~~~~~~~~~~~~~~~~~~~

Import the gerrit-gwtdebug project:

* Import gerrit-gwtdebug/pom.xml using General -> Maven Projects

Duplicate the existing `gwtui_dbg` launch configuration:

* Run -> Debug Configurations ...
* Java Application -> `gwtui_dbg`
* Right click, Duplicate

* Modify the name to be unique.

* Switch to Arguments tab.
* Edit the `-Dgerrit.site_path=` VM argument to match the path
  used during 'init'.  The template launch configuration resolves
  to ../test_site since that is what the documentation recommends.

* Switch to Common tab.
* Change Save as to be Local file.


GERRIT
------
Part of link:index.html[Gerrit Code Review]