Skip to content

SevNTU plugin for EclipseCS plugin compilation

romani edited this page Oct 5, 2012 · 22 revisions

OUTDATED!!!

1. I presume that all pages before this you already done.

2. Checkout checkstyle sources and build them.

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

Please take a look at at output what version is installed
[INFO] ………………. checkstyle-5.7-SNAPSHOT.jar
Where “5.7-SNAPSHOT” is a Checkstyle version.

Continue:

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_LOCAL_REPO>/sevntu-checks/src/test/resources/com/github/sevntu/checkstyle
-Dtestsrcs.dir=<PATH_TO_LOCAL_REPO>/sevntu-checks/src/test/java/com/github/sevntu/checkstyle/checks

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.