...
A word of warning, though: although we have an automated formatter, this never trumps common sense. Don't blindly reformat a file before checking in, but rather apply it to the section of file your currently working on. Use it as a serventservant, not a master.
We currently provide IDE Integration support for Eclipse as it provides adequate OSGi development support when using bndtools.
IDE support for Eclipse
Formatting
Once you have checked out the sources from https://subversion.amdatu.org/svn/amdatu/, you will find a file named etc/eclipse settings/Amdatu eclipse formatter settings.xml
. In Settings -> Java -> Code Syle -> Formatter
, you When working on Amdatu projects in Eclipse, the following formatter can be used: amdatu-code-formatting.xml. You can import this file, and apply it to the code you write to make sure you stick close to the guidelines.
m_
prefix
Furthermore, in Settings -> Java -> Code Syle
, set As a convention fields are prefixed using 'm_' throughout Amdatu. This can be done automatically when using autocomplete by setting 'm_
' as a prefix for Fields.
Java compliance level
Eclipse doesn't automatically pick up the Java 1.5 compliance level in our POM, so we need to make some settings for that.
In Java -> Compiler
, set the 'Compiler compliance level' to 1.5
.
Spaces only
The coding guideline states we want no tabs in our codebase. To make sure Eclipse doesn't 'help' you by inserting them, select
General -> Editors -> Text Editors
'Insert spaces for tabs'XML -> XML Files -> Editor
'Indent using spaces', and 'Indentation size = 2'
Setting proper author for Javadoc generation
If you add Javadoc to a class, an @author
tag will be created automatically for you. By default, the author tag equals your login name. But according to the conventions, the @author
tag must be set to a generic Amdatu author (see ). To change the author in Eclipse, append the following to your eclipse.ini
:
-Duser.name=<a href="mailto:amdatu-developers@amdatu.org">Amdatu Project Team</a>
IDE support for IntelliJ
Once you have checked out the sources from https://subversion.amdatu.org/svn/amdatu/ you will find a file named etc/intellij settings/projectCodeStyle.xml
. Copy this file to your .idea
directory (or symlink it), and you can start formatting code. in 'Settings -> Java -> Code Syle'.