Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some effort to comply with style guide #1379

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 31 additions & 0 deletions pom.xml
Expand Up @@ -107,6 +107,7 @@
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
<arguments />
<gpg.keyname>67893CC4</gpg.keyname>
<checkstyle.config.location>google_checks.xml</checkstyle.config.location>
</properties>

<dependencies>
Expand Down Expand Up @@ -379,6 +380,31 @@
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the builds on Travis CI for jdk6 is failing. As far as I can see, this version of Checkstyle requires Java 7. If you could go on a lower version of Checkstyle, that might fix this build.
The actual problem is, if it should be possible to build Junit 4 on JDK 6? And if we don't build on JDK 6, does this imply that JUnit can no longer be used on JRE 6? And is this really still necessary, @kcooney and @marcphilipp ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should be possible to build it on JDK6. But to make sure we don't use any JDK > 5 APIs we should build using JDK 5.

Why shouldn't it be possible to use JUnit on JDK 6 if it wasn't build on JDK 6?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it was possible to disable Checkstyle in the JDK 6 build, would that be okay? It's not as if the source code is any different between the JDK 6 and JDK 7/8 builds. Using a JDK 6-compatible version of something in 2016 seems a bit ludicrous.

In fact, i would argue that what you really want to do is build all the classes under whatever JDK you are going to use to build the releases, and then run the tests on the various target JDKs, to more accurately simulate what happens to users. I have no idea how to get Maven and Travis to do that, though!

<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<violationSeverity>error</violationSeverity> <!-- change to 'warning' to enforce strictly -->
<violationIgnore>indentation</violationIgnore>
</configuration>
</plugin>
<plugin>
<!--
To apply: mvn googleformatter:format
To repair indentation (BSD/Mac sed): git status -s | sed -En 's/^ M (src.*\.java)$/\1/p' | xargs sed -Ei '' 's/^( *)/\1\1/'
-->
<groupId>com.theoryinpractise</groupId>
<artifactId>googleformatter-maven-plugin</artifactId>
<version>1.0.6</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plugin allows one to configure AOSP style, which uses four spaces.

</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -452,6 +478,11 @@
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
</plugin>
</plugins>
</reporting>

Expand Down