Skip to content

Commit

Permalink
Update to Java 11 (#932)
Browse files Browse the repository at this point in the history
* Update to Java 11 and use jpackage for building installers

jpackage requires a version of JDK13 installed with jpackage from https://jdk.java.net/jpackage/ and passed with -Pjdk13=/path/to/jdk-13

Remove Grgit
Update PMD to 6.7.0 for Java 11 support
Disable errorprone
Disable UI tests, since they no longer work when headless and are flaky otherwise. Can still be run with Java 8

* Remove dependency on Guava in annotation processor

* Support running on JDK 8 to run UI tests

* Roll shadow plugin back to 4.0.1 to avoid issues with :core:shadowjar

* Add mac agent dedicated for UI tests and JaCoCo reports
  • Loading branch information
SamCarlberg authored Apr 17, 2019
1 parent 34afc3d commit f789fb2
Show file tree
Hide file tree
Showing 193 changed files with 1,524 additions and 583 deletions.
21 changes: 0 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ addons:
packages:
# - gcc-4.8
# - g++-4.8
- oracle-java8-installer
# - python3
before_install:
- .travis-scripts/install.sh
Expand All @@ -29,13 +28,8 @@ before_install:
then .travis-scripts/osx-opencv-install.sh;
else .travis-scripts/linux-opencv-install.sh;
fi
# Only do an assemble when we aren't building a pull request
install:
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ./gradlew jfxNative --no-daemon --stacktrace -Dscan || ./gradlew --stacktrace -Dscan '
script:
# Only run code generation tests on OSX -- linux requires sudo to install OpenCV dependencies, and that environment
# will not be able to run MainWindowTest.testDragOperationFromPaletteToPipeline
- ./gradlew check --stacktrace -Pheadless=true -PlogTests;

after_success:
Expand All @@ -52,21 +46,6 @@ notifications:
on_start: never # options: [always|never|change] default: always


env:
global:
secure: f90qqcA5inkHmYUK6WNITkSPbalpw+r+6nzykPdN30ahB8OUupYxoJxFknxw74raPQ69IgsDF+f8RihEBNIjH8TiMihkcwbkUGGfYaON+sVdvV/GgRQcUk0tm/wrWxRiB1qOYfsvU4sdyvFWBtAbeuhBH1JMLlQGaFjHTJOUwCjm3iEW0CKC9btsgcZIvIrHkP2K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90BeXg2XfMichmKfQYQFEmZntCZcoHHDG5jbCTyAvFuOv6tdPjpr69QjiEJhEbohw8CEwoGhy1kxxQcCDCfABrOTivJ39Ui8MC6k=
file_glob: true
file: "ui/build/jfx/native/*.{deb,pkg,dmg}"
skip_cleanup: true
on:
repo: WPIRoboticsProjects/GRIP
tags: true

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import edu.wpi.grip.annotation.operation.PublishableObject;

import com.google.auto.service.AutoService;
import com.google.common.collect.ImmutableMap;

import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -43,11 +43,16 @@ public class ClassListProcessor extends AbstractProcessor {
public static final String PUBLISHABLES_FILE_NAME = "publishables";
public static final String XSTREAM_ALIASES_FILE_NAME = "xstream-aliases";

private final Map<String, String> fileNames = ImmutableMap.of(
Description.class.getName(), OPERATIONS_FILE_NAME,
PublishableObject.class.getName(), PUBLISHABLES_FILE_NAME,
"com.thoughtworks.xstream.annotations.XStreamAlias", XSTREAM_ALIASES_FILE_NAME
);
private final Map<String, String> fileNames = makeFileNamesMap();

private Map<String, String> makeFileNamesMap() {
Map<String, String> map = new HashMap<>();
map.put(Description.class.getName(), ClassListProcessor.OPERATIONS_FILE_NAME);
map.put(PublishableObject.class.getName(), ClassListProcessor.PUBLISHABLES_FILE_NAME);
map.put("com.thoughtworks.xstream.annotations.XStreamAlias",
ClassListProcessor.XSTREAM_ALIASES_FILE_NAME);
return map;
}

@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
Expand Down Expand Up @@ -90,7 +95,7 @@ private void createFile(String fileName, Iterable<String> classNames) {

private static final class TypeNameExtractor extends SimpleTypeVisitor8<String, Void> {

static final TypeNameExtractor INSTANCE = new TypeNameExtractor();
public static final TypeNameExtractor INSTANCE = new TypeNameExtractor();

@Override
public String visitDeclared(DeclaredType t, Void o) {
Expand Down
23 changes: 0 additions & 23 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
install:
- choco install -y InnoSetup

build_script:
- gradlew.bat jfxNative --no-daemon --stacktrace

# to run your custom scripts instead of automatic tests
test_script:
- gradlew.bat check --stacktrace -Pheadless=true -PlogTests -Dscan

platform:
- x64

artifacts:
- path: ui\build\jfx\native\*.exe


deploy:
provider: GitHub
description: ''
auth_token:
secure: k0uhlsYxGoZkHVNNm4E+WnOiBfzsv4yLS+htlplR7JwzARqiAC2RU0cVnsIg1UF0
artifact: /.*\.exe/ # upload all exe packages to release assets
draft: true
prerelease: true
on:
branch: master # release from master branch only
appveyor_repo_tag: true # deploy on tag push only

cache:
- C:\Users\appveyor\.gradle
113 changes: 84 additions & 29 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,33 @@ jobs:

steps:
- script: |
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo apt-get install -y oracle-java8-installer
sudo apt-get install -y oracle-java8-set-default
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$JAVA_HOME/bin:$PATH
displayName: 'Install Oracle JDK'
mkdir build
$ProgressPreference = 'SilentlyContinue'
wget "https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz" -O "build/jdk.tar.gz"
displayName: 'Download JDK'
- script: |
$ProgressPreference = 'SilentlyContinue'
wget "https://download.java.net/java/early_access/jpackage/30/openjdk-13-jpackage+30_linux-x64_bin.tar.gz" -O "build/jdk-13.tar.gz"
sudo mkdir /opt/java
sudo tar -xzvf build/jdk-13.tar.gz -C /opt/java
displayName: 'Download JDK 13'
- task: JavaToolInstaller@0
inputs:
jdkSourceOption: localDirectory
jdkFile: 'build/jdk.tar.gz'
jdkDestinationDirectory: 'build/jdkinst'
jdkArchitectureOption: x64
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m -Dorg.gradle.java.home=/usr/lib/jvm/java-8-oracle'
jdkUserInputPath: '/usr/lib/jvm/java-8-oracle'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
tasks: 'check jacocoTestReport jacocoRootReport jfxNative -Pgeneration -PjniLocation=build/OpenCVJNI -Pheadless=true -PlogTests --stacktrace'

- script: |
curl -s https://codecov.io/bash > .codecov
chmod +x .codecov
./.codecov -t $(CODECOV_TOKEN)
displayName: 'Upload jacoco reports to codecov'
tasks: 'check :ui:jpackage -Pgeneration -PjniLocation=build/OpenCVJNI -Pheadless=true -PlogTests -Pjdk13=/opt/java/jdk-13 --stacktrace'

- task: CopyFiles@2
inputs:
contents: 'ui/build/jfx/native/GRIP-*.deb'
contents: 'ui/build/installer/GRIP-*.deb'
targetFolder: $(Build.ArtifactStagingDirectory)

- task: PublishBuildArtifacts@1
Expand All @@ -54,19 +54,35 @@ jobs:
- script: |
choco install innosetup -y
displayName: 'Install Inno Setup'
- powershell: |
mkdir build
$ProgressPreference = 'SilentlyContinue'
wget "https://download.java.net/java/ga/jdk11/openjdk-11_windows-x64_bin.zip" -O "build\jdk.zip"
displayName: 'Download JDK'
- powershell: |
$ProgressPreference = 'SilentlyContinue'
wget "https://download.java.net/java/early_access/jpackage/30/openjdk-13-jpackage+30_windows-x64_bin.zip" -O "build\jdk-13.zip"
Expand-Archive build\jdk-13.zip -DestinationPath build
displayName: 'Download JDK 13'
- task: JavaToolInstaller@0
inputs:
jdkSourceOption: localDirectory
jdkFile: 'build/jdk.zip'
jdkDestinationDirectory: 'build/jdkinst'
jdkArchitectureOption: x64
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
jdkVersionOption: '1.8'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
tasks: 'check jacocoTestReport jacocoRootReport jfxNative -Pheadless=true -Pgeneration -PlogTests --stacktrace'
tasks: 'check :ui:jpackage -Pheadless=true -Pgeneration -PlogTests -Pjdk13=..\build\jdk-13 --stacktrace'

- task: CopyFiles@2
inputs:
contents: 'ui\build\jfx\native\GRIP-*.exe'
contents: 'ui\build\installer\GRIP-*.exe'
targetFolder: $(Build.ArtifactStagingDirectory)

- task: PublishBuildArtifacts@1
Expand All @@ -81,19 +97,29 @@ jobs:
- script: |
choco install innosetup -y
displayName: 'Install Inno Setup'
- powershell: |
mkdir build
$ProgressPreference = 'SilentlyContinue'
wget "https://github.com/wpilibsuite/frc-openjdk-windows/releases/download/v11.0.0u28-1/jdk-x86-11.0.0u28-1.zip" -O "build\jdk.zip"
displayName: 'Download JDK'
- task: JavaToolInstaller@0
inputs:
jdkSourceOption: localDirectory
jdkFile: 'build/jdk.zip'
jdkDestinationDirectory: 'build/jdkinst'
jdkArchitectureOption: x86
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx1024m'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x86'
publishJUnitResults: false
tasks: 'check jacocoTestReport jacocoRootReport jfxNative -Pheadless=true -Pgeneration -PlogTests --stacktrace'
# TODO: run :ui:jpackage once we have a JDK 13 build for 32-bit Windows
tasks: 'check -Pheadless=true -Pgeneration -PlogTests --stacktrace'

- task: CopyFiles@2
inputs:
contents: 'ui\build\jfx\native\GRIP-*.exe'
contents: 'ui\build\installer\GRIP-*.exe'
targetFolder: $(Build.ArtifactStagingDirectory)

- task: PublishBuildArtifacts@1
Expand All @@ -105,21 +131,50 @@ jobs:
vmImage: 'xcode9-macos10.13'

steps:
- script: |
mkdir build
wget "https://download.java.net/java/ga/jdk11/openjdk-11_osx-x64_bin.tar.gz" -O "build/jdk.tar.gz"
wget "https://download.java.net/java/early_access/jpackage/30/openjdk-13-jpackage+30_osx-x64_bin.tar.gz" -O "build/jdk-13.tar.gz"
sudo tar xzvf build/jdk-13.tar.gz -C /Library/Java/JavaVirtualMachines/
sudo tar xvzf build/jdk.tar.gz -C /Library/Java/JavaVirtualMachines/
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/
displayName: 'Setup JDK'
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
jdkVersionOption: '1.8'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
tasks: 'check jacocoTestReport jacocoRootReport jfxNative -Pheadless=true -Pgeneration -PlogTests --stacktrace'
tasks: 'check :ui:jpackage -Pheadless=true -Pgeneration -PlogTests -Pjdk13=/Library/Java/JavaVirtualMachines/jdk-13.jdk/Contents/Home/ --stacktrace'

- task: CopyFiles@2
inputs:
contents: 'ui/build/jfx/native/*'
contents: 'ui/build/installer/*'
targetFolder: $(Build.ArtifactStagingDirectory)

- task: PublishBuildArtifacts@1
inputs:
artifactName: 'MacInstaller'

# JDK 8 agent for UI tests
- job: Mac_UI_Testing
pool:
vmImage: 'xcode9-macos10.13'

steps:
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
tasks: 'check jacocoTestReport jacocoRootReport -Pheadless=true -Pgeneration -PlogTests --stacktrace'
- script: |
curl -s https://codecov.io/bash > .codecov
chmod +x .codecov
./.codecov -t $(CODECOV_TOKEN)
displayName: 'Upload jacoco reports to codecov'
Loading

0 comments on commit f789fb2

Please sign in to comment.