For the Eclipse users out there, these are the instruction on how to configure a Checkstyle plugin inside your IDE. Similar instructions apply for Intellij (a Checkstyle plugin is available in the plugin manager)
Please note that for now you have to create different configurations for CE, EE and STK because of the different header files:
- Install the Checkstyle plugin (use Version 5.x) from http://eclipse-cs.sourceforge.net/update
- After restarting Eclipse go to Window->Preferences->Checkstyle. Click on NEW and select "Remote configuration file" from the dropdown and name the configuration "Magnolia CE". Click on location and use the "checkstyle.xml" file from our Subversion server:
- Click "Additional properties", then "Find unresolved properties" to let the plugin discover it needs a property checkstyle.header.file to be defined. Paste the path to your local file-system where you stored the header file (e.g.
/Users/daniellipp/Documents/mgnl/ws/license-header-dual.regex. Close the preference window with lots of "ok" clicking.
Note: pointing to to svn does not yet work here. If it did, the files are at:
http://svn.magnolia-cms.com/svn/build/maven-plugins/magnolia-build-tools/trunk/src/main/resources/magnolia-build-tools/license-header-dual.regexfor dual-licensed (GPL and MNA) projects (Core, community modules, ...)
http://svn.magnolia-cms.com/svn/build/maven-plugins/magnolia-build-tools/trunk/src/main/resources/magnolia-build-tools/license-header-cpal.regexfor CPAL-licensed projects (STK, ...)
http://svn.magnolia-cms.com/svn/build/maven-plugins/magnolia-build-tools/trunk/src/main/resources/magnolia-build-tools/license-header-mna.regexfor MNA-only-licensed projects (EE, ...)
- Now right click on your Magnolia CE project and select properties. In the Checkstyle tab select "Checkstyle active...", "use simple configuration", and choose "Magnolia CE" from the check configuration
- Now rebuild your project: you should see a few thousands of new warnings in the "problems" view (I recommend to set up the problem view to only show problems "on selected resources and their children, or you will get lost)