This file contains instructions on how to set up your Eclipse environment to work with the source code for the Google Plugin for Eclipse:
Configuring your Eclipse workspace to develop on the Google Eclipse plugin is very much like getting set up to develop for GWT. The same style rules apply, and Eclipse projects are provided for you to import. The "settings" directory mentioned below is under "eclipse", in your checkout of plugin.
Macintosh users: Note that on the Macintosh version of Eclipse, "Preferences" is under the "Eclipse" menu, not under "Window".
------------- Dependent Plugins -----------
In Eclipse 3.3/3.4:
Copy the plugin JARs from tools/swtbot/3.3 into your Eclipse's /dropins directory (on 3.4) or /plugins directory (on 3.3). You'll need to restart Eclipse to detect the new plugins.
In Eclipse 3.5/3.6/3.7:
Copy the plugin JARs from tools/swtbot/3.5 into your Eclipse's /dropins directory.
You'll need to restart Eclipse to detect the new plugins.
The com.google.gdt.eclipse.maven plugin requires M2Eclipse (Maven support) to be installed. You can either close the project, or follow the instructions here: https://sites.google.com/a/google.com/google-plugin-for-eclipse/working-with-maven
The com.google.gdt.eclipse.gph.hge project requires MercurialEclipse to be installed. You can either close the project, or install MercurialEclipse: http://cbes.javaforge.com/update.
The com.google.gdt.eclipse.gph.subclipse project requires Subclipse to be installed. You can either close the project, or install Subclipse: http://subclipse.tigris.org/update_1.6.x.
The com.google.gdt.eclipse.gph.subversive project requires Subversive to be installed. You can either close the project, or install Subversive: http://download.eclipse.org/releases/helios (under Collaboration).
------------- Text Editors ----------------
Window->Preferences->General->Editors->Text Editors Make sure that "Displayed Tab Width" is set to 2 Enable "Insert Spaces for Tabs" Enable "Show Print Margin" and set "Print Margin Column" to 80
------------- XML Files -------------------
Window->Preferences->Web and XML->XML Files->Source (or Window->Preferences->XML->XML Files->Editor, if you can't find it there) Set "Line Width" 80 Enable "Split Multiple Attributes Each of a New Line" Enable "Indent Using Spaces" with an Indentation Size of 4
------------- Ant Build Files -------------
Window->Preferences->Ant->Editor->Formatter Set "Tab Size" to 4 Disable "Use Tabs Instead of Spaces" Set "Maximum Line Width" to 80 Enable "Wrap Long Element Tags"
---------------- Spelling -----------------
Window->Preferences->General->Editors->Text Editors->Spelling Enable spell checking Use "settings/english.dictionary".
-------------Classpath Variables -----------
For GPE 2.3 and after, this step is no longer necessary. See CL/20212038
Window->Preferences->Java->Build Path->Classpath Variables
Define the classpath variable "GAE_TOOLS_JAR" which points to the appengine-api-tools.jar file that is part of an App Engine SDK.
------------ Output Filtering --------------
Window->Preferences->Java->Compiler->Building Make sure "Filtered Resources" includes ".svn/"
----------- Code Templates ----------------
Window->Preferences->Java->Code Style->Code Templates
Comments->Files template should look like this:
/*
Comments->Types template should look like this:
/*
---------- Save Actions -------------------
Window->Preferences->Java->Editor->Save Actions
Enable "Perform the Selected Actions on Save" Enable "Format Source Code" Enable "Organize Imports" Enable "Additional Actions" Click "Configure", and make sure that all actions are disabled except "Sort Members Excluding fields, enum constants, and initializers"
---------- Code style/formatting ----------
Window->Preferences->Java->Code Style->Formatter->Import... settings/code-style/gwt-format.xml
----------- Import organization -----------
Window->Preferences->Java->Code Style->Organize Imports->Import... settings/code-style/gwt.importorder
------------ Member sort order ------------
Window->Preferences->Java->Appearance->Members Sort Order There is no import here, so make your settings match: settings/code-style/gwt-sort-order.png
First, members should be sorted by category. 1) Types 2) Static Fields 3) Static Initializers 4) Static Methods 5) Fields 6) Initializers 7) Constructors 8) Methods
Second, members in the same category should be sorted by visibility. 1) Public 2) Protected 3) Default 4) Private
Third, within a category/visibility combination, members should be sorted alphabetically.
----------- Mylyn -----------
Only required for Eclipse 3.7 Go to Help->Install New Software From the drop down list, select Google Internal for Eclipe 3.7 Uncheck Group Items by Category Install Mylyn Commons If you are not using the internal version of Eclipse, please install Mylyn Commons from the Indigo Update site.
== Checkstyle == Checkstyle is used to enforce good programming style.
Install Checkstyle plugin v4.x:
Download this from http://sourceforge.net/projects/eclipse-cs/files/Eclipse%20Checkstyle%20Plug-in/v4.4.2/com.atlassw.tools.eclipse.checkstyle_4.4.2-bin.zip/download
Copy plugins/com.atlassw.tools.eclipse.checkstyle_4.4.2 from the extraction
of the above downloaded zip file into the dropins directory of your eclipse
installation.
Enable Custom GWT Checkstyle checks:
Copy "settings/code-style/gwt-customchecks.jar" into: