Version 1 (modified by 17 years ago) (diff) | ,
---|
Using Eclipse with SCDB
TracNav
Table of Contents
Eclipse is an open source IDE (Integrated Development Environment), written in Java and thus available on all platforms, that provides a file browser, an editor, a SVN client, access to compilers and lot of other tools. It is neither part of SCDB, nor a requirement to use SCDB.
With SCDB, it brings a graphical interface for administering SCDB and editing templates. With very few customization, Eclipse can be used both to edit templates, compile them and deploy them while taking advantage of all the advanced features you find in Eclipse like local history, file browsing and searching, ability to open a template directly at the line causing an error...
Instructions in this page explain how to customize Eclipse for SCDB. This is not an introduction to Eclipse usage itself. Refer to online documentation in Eclipse. Configuration described here has already been tested on Linux, MacOS and Windows but should work on any other platforms as all components used are pure Java.
Installation
Installating Eclipse
Eclipse can be downloaded from http://www.eclipse.org. Installing Eclipse mainly consists to unarchive the distribution. The archive format is dependant on the platform (zip, tar...).
Before being able to run Eclipse, you need to install Java JRE on your machine. SCDB requires Java 1.5 or later. You need to check on Eclipse site minimum Java version required by Eclipse. As of Eclipse 3.2, it was lower than SCDB.
If you have several Java JRE installed on your machine, run Eclipse, goto Preferences->Java (in Window
menu) and check the version used by Eclipse matches both Eclipse and SCDB requirements.
Installating Eclipse plugins
For Eclipse to work with SCDB, some additional software, called plugins, needs to be installed. To do this, run Eclipse and use Software Updates->Find and Install...
in Help
menu. Then add a new remote site
for each of the following plugins :
- Subclipse : used to interact with a SVN client. Download URL : http://subclipse.tigris.org/update.
- JavaSVN (SVNKit) : pure Java SVN client, providing both Java classes and a set of command line utilities compatible with SVN line mode client (command
jsvn
). Download URL : http://tmate.org/svn/. - Sunshade : used for parsing PAN compiler output. Download URL : http://sunshade.sourceforge.net/update.
- Colorer : used for syntax colouring in templates. Download URL : http://colorer.sf.net/eclipsecolorer/.
After adding each site, select them and click on Finish
button.
Configuration
Colorer
Colorer is used to do syntax colouring when editing PAN templates.
Syntax colouring rules are defined in a file pan.hrc
that can be downloaded from Quattor CVS (in elfms/Quattor/utils/eclipse). This file must be placed in
/path/to/eclipse/plugins/net.sf.colorer_VERSION/colorer/hrc/auto
.
Then an entry for these syntax colouring rules must be added to /path/to/eclipse/plugins/net.sf.colorer_VERSION/colorer/catalog.xml
. This is done by editing this file and adding the following line to the hrc-sets:
<location link="hrc/auto/pan.hrc"/>
Last, add an association between .tpl
file extension and Colorer Editor. To do this, go to Window->Preferences->General->Editors->File Associations, add .tpl
and associate the Colorer Editor with it.
For the new Colorer configuration to be taken into account, you need to restart Eclipse.
Sunshade
Sunshade is used to parse PAN compiler output. Regexps appropriate to PAN compiler output must be added, using Window->Preferences->Sunshade->Errorlink in Eclipse. The required regexps are :
\[pan-syntax\]\s*(.*\.tpl):(\d+): \[pan-compile\]\s*(.*\.tpl):(\d+) \[pan-syntax\].*[\s\(](.*\.tpl)
JavaSVN and certificates
When using JavaSVN in combination with certificates, you must add the password in the ~/.subversion/servers file. Make sure that this file has correct access rights (as it contains cleartext password, it must have mode 400).
A full example looks like :
[groups] somegroup = some.full.host, *.some.domain [somegroup] ssl-client-cert-file = /bla/bla/bla.p12 ssl-client-cert-password=hahahahaha [global] ssl-authority-files = /bla/bla/bla/ca_local.crt