Skip to content

SevNTU plugin for EclipseCS plugin compilation

sevntu-checkstyle edited this page Apr 12, 2012 · 22 revisions

1. Prepare Development Environment in Ubuntu 10.04
2. Checkout checkstyle sources and build them.

hg clone http://checkstyle.hg.sourceforge.net:8000/hgroot/checkstyle/checkstyle
cd checkstyle
mvn install
mvn jar:test-jar install

generate Eclipse project file “.project” for checkstyle:
mvn eclipse:eclipse

3. Checkout eclipse-cs sources (https://sourceforge.net/projects/eclipse-cs/develop).

cvs -z3 -d:pserver:anonymous@eclipse-cs.cvs.sourceforge.net:/cvsroot/eclipse-cs co -r v5_5_0 .

4. Build
cd net.sf.eclipsecs.checkstyle
mvn install
cd ../net.sf.eclipsecs.core
mvn install
cd ../net.sf.eclipsecs.ui
mvn install

5. Comment out all modules in file and install net.sf.eclipsecs.parent
cd ../net.sf.eclipsecs.parent
Comment out all modules in pom.xml
mvn install

6. Compile SevNTU sources:
cd checkstyle-sevntu
mvn install
cd ../eclipsecs-sevntu-plugin
mvn install

7. That is all – now you are able to build Sevntu plugin for Eclipse checkstyle plugin
Import “as Maven projects” in Eclipse workspace following projects for convenient work
checkstyle
checkstyle-sevntu
eclipsecs-sevntu-plugin

8. Do changes and …

9. Run Tests

Open “Preferences/Java/Installed JREs”. Edit the used one and add to the default JVM arguments

-Dtestinputs.dir=<PATH_TO_CHECKSTYLE_PROJECT>/src/testinputs/com/puppycrawl/tools/checkstyle 
-Dtestsrcs.dir=<PATH_TO_CHECKSTYLE_PROJECT>/src/tests/com/puppycrawl/tools/checkstyle

Alternatively right click on the checkstyle project, choose “Run as/Run configurations”. Double-click on the Junit to create new run configuration. In tab “test” choose Junit4 runner. In tab “Arguments” add to the VM arguments.

10. To create Plugin jar

Select project “eclipsecs-sevntu-plugin”, in context menu “Export → Plug-in Deployment/Deployable plug-ins and fragments”. Press “Next” . Provide Destination Directory. Press “Finish”.

11. Add plugin to eclipse

Result jar – com.github.sevntu.checks_1.0.X.jar. Should be copied to /pligins. Launch Eclipse. Select menu – Window – Preferences → Checkstyle. Select Configuration and press “Configure”. In list of groups will be “SevNTU checks”. Enjoy.