Permalink
Browse files

Adding custom checkstyle

  • Loading branch information...
1 parent 71cc7cd commit b083137e9b8dcd4262e5e0d47b524c515bcb5d9d @blundell blundell committed Mar 17, 2013
Binary file not shown.
@@ -0,0 +1,41 @@
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>TestProject</groupId>
+ <artifactId>TestProject</artifactId>
+ <version>0.0.1</version>
+
+ <properties>
+ <checkstyle.config.location>properties/checkstyle-configuration.xml</checkstyle.config.location>
+ </properties>
+
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.9.1</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.novoda</groupId>
+ <artifactId>novoda-checkstyle-checks</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
@@ -0,0 +1,4 @@
+#NOTE: This is an internal implementation file, its format can be changed without prior notice.
+#Sun Mar 17 15:04:14 GMT 2013
+TestProject-0.0.1.jar>=
+TestProject-0.0.1.pom>=
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>TestProject</groupId>
+ <artifactId>TestProject</artifactId>
+ <versioning>
+ <release>0.0.1</release>
+ <versions>
+ <version>0.0.1</version>
+ </versions>
+ <lastUpdated>20130317150414</lastUpdated>
+ </versioning>
+</metadata>
@@ -0,0 +1,4 @@
+#NOTE: This is an internal implementation file, its format can be changed without prior notice.
+#Sun Mar 17 14:59:42 GMT 2013
+novoda-checkstyle-checks-1.0.pom>=
+novoda-checkstyle-checks-1.0.jar>=
@@ -0,0 +1,47 @@
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.novoda</groupId>
+ <artifactId>novoda-checkstyle-checks</artifactId>
+ <name>Novoda Checkstyle Checks</name>
+ <version>1.0</version>
+
+ <parent>
+ <groupId>com.novoda</groupId>
+ <artifactId>novoda-checkstyle-parent</artifactId>
+ <version>1.0</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.puppycrawl.tools</groupId>
ouchadam
ouchadam May 11, 2013 Collaborator

This dependency adds a whooping 35,944+ methods to all of our projects!!!! When you consider android only has 65536 method references available, this is a serious issue! (unless you constantly proguard)

blundell
blundell May 11, 2013 Owner

give it the scope of test. <scope>test</scope> test: This dependency is needed for compiling and running tests. It is not needed for compiling the main source or running the final artifact.

ouchadam
ouchadam May 11, 2013 Collaborator

does it need to be released or can I just edit the file?

blundell
blundell May 11, 2013 Owner

it would need to be released. You would add the scope here https://github.com/novoda/public-mvn-repo/blob/master/poms/reporting/pom.xml in the reporting pom?

ouchadam
ouchadam May 11, 2013 Collaborator

this dependency isn't used in any tests though?

blundell
blundell May 11, 2013 Owner

Unless you count the code reporting as part of the tests. I was reading scopes here: http://docs.codehaus.org/display/MAVENUSER/Dependency+Scopes , test seems the most appropriate, depends how it plays with Jenkins. The dependency is needed for checkstyle but not for the final runnable, checkstyle is ran as part of our testing phase. Testing code quality is part of tests.

ouchadam
ouchadam May 11, 2013 Collaborator

I can't see why this dependency is brought in or how It's actually being used, I can see that the novoda checkstyle is used here.

ouchadam
ouchadam May 11, 2013 Collaborator

yeah but what is using it and in which maven phase

blundell
blundell May 11, 2013 Owner

the line you linked is using it https://github.com/novoda/public-mvn-repo/blob/master/poms/reporting/pom.xml#L98 . Although I am not sure if the line 30 declaration is needed. Then referenced like this: https://github.com/novoda/tesco/blob/develop/team-props/checkstyle.xml#L121

So it is just used by the plugin when the CI says run checkstyle (a maven profile I guess?)

ouchadam
ouchadam May 11, 2013 Collaborator

if that's the case we should remove the main dependency for it and only have the plugin declare its need for it.

blundell
blundell May 11, 2013 Owner

well yeah but you have to prove it :-)

+ <artifactId>checkstyle</artifactId>
+ <version>5.6</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ <forkMode>always</forkMode>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+</project>
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>com.novoda</groupId>
+ <artifactId>novoda-checkstyle-checks</artifactId>
+ <versioning>
+ <release>1.0</release>
+ <versions>
+ <version>1.0</version>
+ </versions>
+ <lastUpdated>20130317145942</lastUpdated>
+ </versioning>
+</metadata>
@@ -0,0 +1,3 @@
+#NOTE: This is an internal implementation file, its format can be changed without prior notice.
+#Wed Jan 02 12:32:28 GMT 2013
+novoda-checkstyle-parent-1.0.pom>=
@@ -0,0 +1,22 @@
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.novoda</groupId>
+ <artifactId>novoda-checkstyle-parent</artifactId>
+ <version>1.0</version>
+ <packaging>pom</packaging>
+
+ <parent>
+ <groupId>com.novoda</groupId>
+ <artifactId>team</artifactId>
+ <version>1.4</version>
+ </parent>
+
+ <modules>
+ <module>NovodaCheckstyle</module>
+ <module>TestProject</module>
+ </modules>
+
+</project>
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>com.novoda</groupId>
+ <artifactId>novoda-checkstyle-parent</artifactId>
+ <versioning>
+ <release>1.0</release>
+ <versions>
+ <version>1.0</version>
+ </versions>
+ <lastUpdated>20130102123228</lastUpdated>
+ </versioning>
+</metadata>

0 comments on commit b083137

Please sign in to comment.