-
Notifications
You must be signed in to change notification settings - Fork 0
Home
In this wiki we only put information about development of Diversicon. For usage information please refer to the project website
As IDE we currently prefer Eclipse
We use JDK 7 and Maven 3.3.9
Eclipse seems to have less problems than Netbeans in handling Immutables annotations.
- install Eclipse Mars
- install
Checkstyle
plugin http://eclipse-cs.sourceforge.net - Assuming you have the downloaded source files with git on your computer, do
File->Import->Maven->Existing Maven project -> select directory where project is -> Click finish
- download tod-eclipse-format-style.xml file from <a href="../blob/master/tod-eclipse-format-style.xml" target=_"blank">tod-commons repository
- set the project format style:
right click on newly created project
-> Properties
-> Java Code Style
-> Check Enable project specific settings
Then as Active Profile, choose Import... and select the previously downloaded file.
If there are issues in compiling, try the following:
- update the project frequently with Project->Clean
- select the project in Project Explorer and hitting F5
- select the project in Project Explorer and select
Delete
(will not delete project from disk unless you explicitly say so in pop up). Then do File-Import -> from Maven
Setup
- Install Netbeans 8.0.2
- todo write about md plugin?
In theory you just need to open the project and that's it.
Diversicon should only be a thin wrapper over UBY 0.7.0, so we don't want to add many dependencies or do weird stuff. Diversicon class extends Uby. for LMF XML to import we use the format specified by the Uby DTD 0.7.0 .
We follow Google's naming coding style.
We try to keep Diversicon as self-contained as possible. When a feature is not satisfactorily covered by vanilla Java 7 we copy/paste from Guava library . Code must work in a Java 7 environment.
Null values are generally avoided and empty objects used instead. When no good empty object is found (for example for dates), we use null
, marking type with JSR-305 @Nullable
annotation (we considered using Guava's Optional<T> but is a bit verbose and might give issues with json serialization)
We don't use checked exceptions (the ones inheriting from Exception
) and prefer runtime exceptions (that inherit from RuntimeException
), so users can avoid try-catch boilerplate. Thrown exceptions MUST be properly documented.
We use SLF4J API. As implementation during testing, we use Logback.
In tests we provide logback as slf4j
implementation.
They are configured by default via XML files looked upon in this order :
- whatever is passed by command line:
mvn test -Dlogback.configurationFile=path-to-my-logback.xml
-
conf/logback-test.xml
as indicated in Maven surefire plugin configuration -
logback-test.xml
in test resources.
CAVEAT: stupid Eclipse doesn't pick those Surefire properties by design ,
nor allows to apply run settings to all tests (O_o) so I went to Windows->Preferences->Java->Installed JREs->Default one->Edit
and set default VM arguments to -Dlogback.configurationFile=conf/logback-test.xml
. It's silly but could somewhat
make sense for other projects too.
For documentation we use the program Josman and follow its guidelines.