Skip to content

Commit

Permalink
By-pass failing removeUnusedImports step at Java 9 builds
Browse files Browse the repository at this point in the history
See diffplug/spotless#83 for details.
  • Loading branch information
sormuras committed Mar 15, 2017
1 parent d299aa0 commit 6dc0369
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,10 @@ subprojects { subproj ->
licenseHeaderFile headerFile, '(package|import) '
importOrderFile rootProject.file('src/eclipse/junit-eclipse.importorder')
eclipseFormatFile rootProject.file('src/eclipse/junit-eclipse-formatter-settings.xml')
removeUnusedImports()

if (org.gradle.internal.jvm.Jvm.current().getJavaVersion().isJava8Compatible()) {
removeUnusedImports()
}

trimTrailingWhitespace()
endWithNewline()
Expand Down

5 comments on commit 6dc0369

@sbrannen
Copy link
Member

Choose a reason for hiding this comment

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

Is this working?

If so, are you going to commit this to master?

@sormuras
Copy link
Member Author

Choose a reason for hiding this comment

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

Two times no. That try 6610883 was almost successful, but then I hit the same wall as @marcphilipp and others did: gradle/gradle#1549 gradle/gradle#1461 gradle/gradle#1095

@sbrannen
Copy link
Member

Choose a reason for hiding this comment

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

Well, the Jigsaw module issue is unrelated.

I was only asking if you got it working -- in the sense of not removing unused imports on JDK 9. 😉

In other words, if the Jigsaw issues get sorted out with an upcoming release of Gradle, we will still need your proposed workaround until Google's Java formatter works on JDK 9.

Right?

@sormuras
Copy link
Member Author

Choose a reason for hiding this comment

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

True. Will commit the Java 9 guard to master.

@sbrannen
Copy link
Member

Choose a reason for hiding this comment

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

Thanks! 👍

Please sign in to comment.