Skip to content
New issue

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

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

Already on GitHub? # to your account

Update to Java 11 #932

Merged
merged 30 commits into from
Apr 17, 2019
Merged

Conversation

SamCarlberg
Copy link
Member

@SamCarlberg SamCarlberg commented Apr 2, 2019

Since the native packager tool was removed in Java 11, building native installers requires JDK 13 with a jpackage tool to be installed. Builds can be downloaded here for 64-bit Windows, Mac, and Linux. No win32 build is yet available.

Updates PMD, since older versions cannot run on Java 11. Most of the changes from this PR are due to new PMD rules.

Errorprone and spotbugs are disabled due to problems with Java 11

Grgit has been removed and replaced with a manual call to git describe --tags to get the version number.

UI tests are disabled due to TestFX not working on Java 11 when headless, and is bugged even when not headless (some tests require manual input).

Native installers can be created with ./gradlew :ui:jpackage. Generates a .exe for Windows, .dmg for Mac, and .deb for Linux in ui/build/installer/. The location of the JDK install can be specified with the property jdk13, eg ./gradlew :ui:jpackage -Pjdk13=/path/to/jdk13/home

File associations are available on Windows (so opening a .grip file will launch GRIP), but are not yet working for Mac or Linux. Updates to the jpackage tool will hopefully let us add that functionality further down the line.

Closes #890

*/
open class JpackageExec : DefaultTask() {

private val objectFactory = project.objects
Copy link
Member

Choose a reason for hiding this comment

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

Annotate as @Internal

Copy link
Member Author

Choose a reason for hiding this comment

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

Since the property is private, shouldn't that be unnecessary? There's no public accessor method like there are on no-modifier (public) properties.

fileAssociations.ifPresent { propsFile ->
args.addAll("--file-associations", propsFile.asFile.absolutePath)
}
args.addAll("--installer-type", installerType.get())
Copy link
Member

Choose a reason for hiding this comment

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

Consider extracting all of this to a private function?

Copy link
Member Author

Choose a reason for hiding this comment

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

All of what?

Copy link
Member

Choose a reason for hiding this comment

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

The arg creation.

@JLLeitschuh
Copy link
Member

Is there any way to preserve running the UI tests with Travis on JDK 8 if we make it so the build can compile on both platforms?

@SamCarlberg
Copy link
Member Author

Running UI tests on Java 8 would probably be possible - just don't add the JavaFX deps and use the appropriate versions of controlsfx and testfx. I'll have to do some digging

Several new false positives have popped up, though
@JLLeitschuh
Copy link
Member

Running UI tests on Java 8 would probably be possible - just don't add the JavaFX deps and use the appropriate versions of controlsfx and testfx. I'll have to do some digging

I believe that preserving UI tests is worth the extra overhead.

Without them, we lose a significant percentage of our test coverage.

Update travis and appveyor to only run checks, not do native builds
@codecov-io
Copy link

codecov-io commented Apr 4, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@34afc3d). Click here to learn what that means.
The diff coverage is 44.56%.

@@            Coverage Diff            @@
##             master     #932   +/-   ##
=========================================
  Coverage          ?   52.75%           
  Complexity        ?        1           
=========================================
  Files             ?      327           
  Lines             ?     8853           
  Branches          ?      564           
=========================================
  Hits              ?     4670           
  Misses            ?     3980           
  Partials          ?      203

@@ -75,6 +77,7 @@ private SocketHints() { /* no op */ }

/* PRIVATE PARTIALLY CONSTRUCTED BUILDERS BELOW */

@SuppressFBWarnings(value = "UPM", justification = "False positive")
Copy link
Member

Choose a reason for hiding this comment

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

"UMP"?

Copy link
Member Author

@SamCarlberg SamCarlberg Apr 4, 2019

Choose a reason for hiding this comment

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

Unused Private Method. This method is clearly used elsewhere in this file, so it's a false positive. Seems that spotbugs doesn't notice usages from inner classes

Copy link
Member

Choose a reason for hiding this comment

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

Huh. Okay then. Thanks!

@JLLeitschuh
Copy link
Member

Why the 14% code coverage drop? Also, it's good to see the @codecov-io bot back on this PR.

@SamCarlberg
Copy link
Member Author

Codecov is currently running on Azure, so UI tests aren't included in the reports

@JLLeitschuh
Copy link
Member

Codecov is currently running on Azure, so UI tests aren't included in the reports

😢 Ah well.

@JLLeitschuh
Copy link
Member

Status on this?

@SamCarlberg
Copy link
Member Author

SamCarlberg commented Apr 15, 2019

Currently getting UI tests and JaCoCo running on its own VM with Java 8. I think this PR should be good to merge once that's done

@JLLeitschuh
Copy link
Member

Ping me when you want me to take a final look. Thanks for investing the time to keep the UI tests running. They are really valuable to have!

@SamCarlberg SamCarlberg merged commit f789fb2 into WPIRoboticsProjects:master Apr 17, 2019
@SamCarlberg SamCarlberg deleted the java-13 branch April 17, 2019 22:56
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to support JDK 10
3 participants