view HACKING.md @ 133:6c3a51d65a6f

Fix typo in HACKING
author Omair Majid <omajid@redhat.com>
date Mon, 02 Jun 2014 10:11:24 -0400
parents 3ab70651ad96
children
line wrap: on
line source

HACKING
=======
This document describes the design, structure and conventions used in the
project.

Lots of places in the documentation will use `c.r.t.t.e` as a
package/module/directory name. This is just a short form of
`com.redhat.thermostat.tools.eclipse`.


Building from Source
--------------------
Use maven to build:

    mvn clean verify

There's no need to `mvn install` anything.


Maven vs Tycho
--------------
Under the hood, [tycho][1] is used to build. tycho uses a manifest-first
approach to build projects (instead of maven's pom-first), so if you are used
to the maven conventions, you may be a little confused. Information that is
normally found in a `pom.xml` is spread out across `pom.xml`,
`META-INF/MANIFEST.MF`, `plugin.xml` and `build.properties` files.


Editing Environment
-------------------
As an eclipse plugin, it's probably simples to work on this using eclipse.
Eclipse provides a graphical UI over `META-INF/MANIFEST.MF`, `plugin.xml` and
`build.properties` files.

It's a very good idea to install `m2e-core` plugin in ecipse so you can import
the maven project into eclipse directly.


Layout
------
The root source directory contains the following directories.

 - `c.r.t.t.e.plugin`
   This contains the main implementation of the plugin.

 - `c.r.t.t.e.plugin-feature`
   This directory contains an eclipse *feature* for the project. You probably
   dont want to modify this.

 - `c.r.t.t.e.plugin-p2-repo`
   This directory contains code to generate a repository which can be used to
   install the plugin when it's built. You probably dont want to modify
   anything in here.

 - `c.r.t.t.e.plugin.tests`
   This directory contains (unit) tests for the plugin. Code here is run on
   every build. This code is only used at build time and not used to populate
   the repository.


Tests
-----
It's a good idea to add a unit test for every new class introduced.

The convention is that every class in module/package `c.r.t.t.e.plugin` will
have a corresponding test in module/package `c.r.t.t.e.plugin.tests` with the
name `<ClassBeingTested>Test.java`. Subpackges of `c.r.t.t.e.plguin` will have
tests in the corresponding package under`c.r.t.t.e.plugin.tests` (eg:
`c.r.t.t.e.plugin.foobar` will have tests under
`c.r.t.t.e.plugin.tests.foobar`).

[1]: http://eclipse.org/tycho/