Skip to content

Commit

Permalink
Use CS Core Raw Streams for HTTPCamera Input (#952)
Browse files Browse the repository at this point in the history
* Use CS Core Raw Streams for HTTPCamera Input

The images are grabbed in native code, so they are much more efficient.
Also, the code is shared with all WPILib tools, so likely tested a bit more

* Add missing osx deps

* Add release openjdk 13

* Fix checkstyle

* Fix private things

* More PMD Fixes

* Suppress spotbugs warnings

* Fix opencv built version

* Revert to opencv 3.1

Needed repo grouping, which needed gradle 5.1 at minimum.

* Revert back to 5.1

* JDK 13 things

* Java 14 prerelease

* Fix jpackage

* Fix jpackage again

* More changes

* More things

* More args

* Package type

* More jpck

* Finally fix jpkg

* Jpackage 32 bit

* Fix ran usage win32

* A few more good men

* Incorperate j11 tests

* Fix checkstyle issues

* Fix wrapper

* Fix automatically generated tests

* Skip failing tests

* Skip UI tests on windows builds

* Replace references to Java 13 with Java 14

* Fix comments

* Revert change to check master tests

* Revert "Revert change to check master tests"

This reverts commit 05ad8bb.
  • Loading branch information
ThadHouse authored and JLLeitschuh committed Oct 29, 2019
1 parent d5ec3a4 commit 8923d10
Show file tree
Hide file tree
Showing 21 changed files with 447 additions and 269 deletions.
4 changes: 2 additions & 2 deletions annotation/annotation.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ repositories {
}

dependencies {
compileOnly(group = "com.google.auto.service", name = "auto-service", version = "1.0-rc4")
annotationProcessor(group = "com.google.auto.service", name = "auto-service", version = "1.0-rc4")
compileOnly(group = "com.google.auto.service", name = "auto-service", version = "1.0-rc6")
annotationProcessor(group = "com.google.auto.service", name = "auto-service", version = "1.0-rc6")
}
76 changes: 36 additions & 40 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
- script: |
$ProgressPreference = 'SilentlyContinue'
mkdir build
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"
wget "https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-49_linux-x64_bin.tar.gz" -O "build/jdk-14.tar.gz"
sudo mkdir /opt/java
sudo tar -xzvf build/jdk-13.tar.gz -C /opt/java
displayName: 'Download JDK 13'
sudo tar -xzvf build/jdk-14.tar.gz -C /opt/java
displayName: 'Download JDK 14'
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
tasks: 'check :ui:jpackage -Pgeneration -PjniLocation=build/OpenCVJNI -Pheadless=true -PlogTests -Pjdk13=/opt/java/jdk-13 --stacktrace'
tasks: 'check :ui:jpackage -Pgeneration -PjniLocation=build/OpenCVJNI -Pheadless=true -PlogTests -Pjdk14=/opt/java/jdk-14 --stacktrace'
- task: CopyFiles@2
inputs:
contents: 'ui/build/installer/GRIP-*.deb'
Expand All @@ -51,7 +51,7 @@ jobs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
tasks: ':ui:jpackage -Pcuda -Pjdk13=/opt/java/jdk-13 --stacktrace'
tasks: ':ui:jpackage -Pcuda -Pjdk14=/opt/java/jdk-14 --stacktrace'
- task: CopyFiles@2
inputs:
contents: 'ui/build/installer/GRIP-*.deb'
Expand All @@ -76,9 +76,9 @@ jobs:
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'
wget "https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-49_windows-x64_bin.zip" -O "build\jdk-14.zip"
Expand-Archive build\jdk-14.zip -DestinationPath build
displayName: 'Download JDK 14'
- task: JavaToolInstaller@0
inputs:
jdkSourceOption: localDirectory
Expand All @@ -93,7 +93,7 @@ jobs:
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
tasks: 'check :ui:jpackage -Pheadless=true -Pgeneration -PlogTests -Pjdk13=..\build\jdk-13 --stacktrace'
tasks: 'check :ui:jpackage -Pheadless=true -Pgeneration -PlogTests -PskipUITests -Pjdk14=..\build\jdk-14 --stacktrace'
- task: CopyFiles@2
inputs:
contents: 'ui\build\installer\GRIP-*.exe'
Expand All @@ -105,7 +105,7 @@ jobs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
tasks: ':ui:jpackage -Pcuda -Pjdk13=..\build\jdk-13 --stacktrace'
tasks: ':ui:jpackage -Pcuda -PskipUITests -Pjdk14=..\build\jdk-14 --stacktrace'
- task: CopyFiles@2
inputs:
contents: 'ui\build\installer\GRIP-*.exe'
Expand All @@ -126,8 +126,13 @@ jobs:
- 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"
wget "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_x86-32_windows_hotspot_11.0.4_11.zip" -O "build\jdk.zip"
displayName: 'Download JDK'
- powershell: |
$ProgressPreference = 'SilentlyContinue'
wget "https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-49_windows-x64_bin.zip" -O "build\jdk-14.zip"
Expand-Archive build\jdk-14.zip -DestinationPath build
displayName: 'Download JDK 14'
- task: JavaToolInstaller@0
inputs:
jdkSourceOption: localDirectory
Expand All @@ -141,7 +146,15 @@ jobs:
gradleOptions: '-Xmx1024m'
publishJUnitResults: false
# TODO: run :ui:jpackage once we have a JDK 13 build for 32-bit Windows
tasks: 'check -Pheadless=true -Pgeneration -PlogTests --stacktrace'
tasks: 'check :ui:jpackage -Pheadless=true -Pgeneration -PlogTests -PskipUITests -Pjdk14=..\build\jdk-14 --stacktrace'
# bytedeco does not have a 32 bit enabled CUDA build
# - task: Gradle@2
# inputs:
# workingDirectory: ''
# gradleWrapperFile: 'gradlew'
# gradleOptions: '-Xmx1024m'
# publishJUnitResults: false
# tasks: ':ui:jpackage -Pcuda -PskipUITests -Pjdk14=..\build\jdk-14 --stacktrace'

- task: CopyFiles@2
inputs:
Expand All @@ -160,8 +173,8 @@ jobs:
- 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/
wget "https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-49_osx-x64_bin.tar.gz" -O "build/jdk-14.tar.gz"
sudo tar xzvf build/jdk-14.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'
Expand All @@ -173,11 +186,18 @@ jobs:
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
tasks: 'check :ui:jpackage -Pheadless=true -Pgeneration -PlogTests -Pjdk13=/Library/Java/JavaVirtualMachines/jdk-13.jdk/Contents/Home/ --stacktrace'
tasks: 'check jacocoTestReport jacocoRootReport :ui:jpackage -Pheadless=true -Pgeneration -PlogTests -Pjdk14=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/ --stacktrace'
- task: CopyFiles@2
inputs:
contents: 'ui/build/installer/*'
targetFolder: $(Build.ArtifactStagingDirectory)

- script: |
curl -s https://codecov.io/bash > .codecov
chmod +x .codecov
./.codecov -t $(CODECOV_TOKEN)
displayName: 'Upload jacoco reports to codecov'
- task: Gradle@2
inputs:
workingDirectory: ''
Expand All @@ -186,7 +206,7 @@ jobs:
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
tasks: ':ui:jpackage -Pcuda -Pjdk13=/Library/Java/JavaVirtualMachines/jdk-13.jdk/Contents/Home/ --stacktrace'
tasks: ':ui:jpackage -Pcuda -Pjdk14=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/ --stacktrace'

- task: CopyFiles@2
inputs:
Expand All @@ -196,27 +216,3 @@ jobs:
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'MacInstaller'

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

steps:
- script: |
mkdir build
wget "https://cdn.azul.com/zulu/bin/zulu8.38.0.13-ca-fx-jdk8.0.212-macosx_x64.tar.gz" -O "build/jdk.tar.gz"
sudo tar xzvf build/jdk.tar.gz -C /Library/Java/JavaVirtualMachines/
displayName: 'Install ZuluFX'
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m -Dorg.gradle.java.home=/Library/Java/JavaVirtualMachines/zulu8.38.0.13-ca-fx-jdk8.0.212-macosx_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'
34 changes: 17 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ buildscript {
}
dependencies {
classpath(group = "edu.wpi.first.wpilib.opencv", name = "opencv-installer", version = "2.0.1")
classpath("com.netflix.nebula:gradle-aggregate-javadocs-plugin:2.2.+")
classpath("com.netflix.nebula:gradle-aggregate-javadocs-plugin:3.0.1")

}
}

plugins {
`java`
`jacoco`
`checkstyle`
`pmd`
id("com.github.johnrengelman.shadow") version "4.0.1"
id("com.google.osdetector") version "1.4.0"
id("org.ajoberstar.grgit") version "2.0.0" apply false
java
jacoco
checkstyle
pmd
id("com.github.johnrengelman.shadow") version "5.1.0"
id("com.google.osdetector") version "1.6.2"
id("org.ajoberstar.grgit") version "3.1.1" apply false
//id("net.ltgt.errorprone") version "0.0.16"
id("com.github.spotbugs") version "1.7.1"
id("com.gradle.build-scan") version "2.1"
id("com.github.spotbugs") version "2.0.0"
id("com.gradle.build-scan") version "2.4.2"
}

apply {
plugin("nebula-aggregate-javadocs")
}

buildScan {
setTermsOfServiceUrl("https://gradle.com/terms-of-service")
setTermsOfServiceAgree("yes")
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}

repositories {
Expand All @@ -42,7 +42,7 @@ repositories {
}

tasks.withType<Wrapper>().configureEach {
gradleVersion = "5.0"
gradleVersion = "5.6.3"
distributionType = Wrapper.DistributionType.ALL
}

Expand All @@ -66,7 +66,7 @@ javaSubprojects {
jcenter()
maven {
name = "WPILib Maven Release"
setUrl("https://first.wpi.edu/FRC/roborio/maven/release")
setUrl("https://frcmaven.wpi.edu/artifactory/release")
}
maven {
name = "rosjava Maven"
Expand All @@ -84,11 +84,11 @@ javaSubprojects {
"compile"(group = "javax.annotation", name = "javax.annotation-api", version = "1.3.2")
"annotationProcessor"(group = "javax.annotation", name = "javax.annotation-api", version = "1.3.2")
"compile"(group = "com.google.code.findbugs", name = "annotations", version = "3.0.1")
"testCompile"(group = "net.jodah", name = "concurrentunit", version = "0.4.2")
"testCompile"(group = "net.jodah", name = "concurrentunit", version = "0.4.6")
"testCompile"(group = "org.hamcrest", name = "hamcrest-all", version = "1.3")
"testCompile"(group = "junit", name = "junit", version = "4.12")
"testCompile"(group = "com.google.truth", name = "truth", version = "0.34")
"testCompile"(group = "com.google.guava", name = "guava-testlib", version = "22.0")
"testCompile"(group = "com.google.truth", name = "truth", version = "1.0")
"testCompile"(group = "com.google.guava", name = "guava-testlib", version = "28.1-jre")
}

checkstyle {
Expand Down
32 changes: 0 additions & 32 deletions buildSrc/src/main/kotlin/BuildType.kt

This file was deleted.

34 changes: 7 additions & 27 deletions buildSrc/src/main/kotlin/JpackageExec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import java.io.FileFilter
* Because JDK 13 has not yet been released, and because `jpackage` is not yet included in the
* early-access builds, a compatible JDK must be downloaded from
* [https://jdk.java.net/jpackage/](https://jdk.java.net/jpackage/). The location of the JDK must be
* specified with [jdkHome] (eg `/opt/java/jdk-13/`)
* specified with [jdkHome] (eg `/opt/java/jdk-14/`)
*
*/
open class JpackageExec : DefaultTask() {
Expand Down Expand Up @@ -146,13 +146,6 @@ open class JpackageExec : DefaultTask() {
@get:Optional
val applicationVendor = stringProperty()

/**
* A machine-readable identifier string in reverse-DNS format (e.g. "edu.wpi.grip").
*/
@get:Input
@get:Optional
val identifier = stringProperty()

/**
* A properties file containing key-value pairs for file association integration.
* Currently broken on Linux and Mac.
Expand All @@ -175,13 +168,6 @@ open class JpackageExec : DefaultTask() {
@get:Optional
val winUpgradeUuid = stringProperty()

/**
* Windows-specific. The name to use for the application in its Windows registry entries.
*/
@get:Input
@get:Optional
val winRegistryName = stringProperty()

/**
* Windows-specific. Allows the application to be installed in the Windows start menu.
*/
Expand All @@ -208,7 +194,7 @@ open class JpackageExec : DefaultTask() {
project.exec {
val args = mutableListOf<String>()
args.add(jdkHome.file("bin/jpackage").get().asFile.absolutePath)
args.add("create-installer")
//args.add("create-installer")

runtimeImage.ifPresent { dir ->
args.addAll("--runtime-image", dir.asFile.absolutePath)
Expand All @@ -217,18 +203,18 @@ open class JpackageExec : DefaultTask() {
args.add("--verbose")
}
jvmArgs.ifPresent { jvmArgs ->
args.add("--jvm-args")
args.add("--java-options")
args.add(jvmArgs.joinToString(separator = " ", prefix = "\"", postfix = "\""))
}
args.addAll("--input", inputDir.get().asFile.absolutePath)
resourceDir.ifPresent { dir ->
args.addAll("--resource-dir", dir.asFile.absolutePath)
}
args.addAll("--output", outputDir.get().asFile.absolutePath)
args.addAll("--dest", outputDir.get().asFile.absolutePath)
icon.ifPresent { iconFile ->
args.addAll("--icon", iconFile.toString())
}
args.addAll("--main-jar", mainJar.get().asFile.absolutePath)
args.addAll("--main-jar", mainJar.get().asFile.name)
args.addAll("--main-class", mainClassName.get())

args.addAll("--name", applicationName.get())
Expand All @@ -245,22 +231,16 @@ open class JpackageExec : DefaultTask() {
applicationVendor.ifPresent { vendor ->
args.addAll("--vendor", vendor)
}
identifier.ifPresent { id ->
args.addAll("--identifier", id)
}
fileAssociations.ifPresent { propsFile ->
args.addAll("--file-associations", propsFile.asFile.absolutePath)
}
args.addAll("--installer-type", installerType.get())
args.addAll("--package-type", installerType.get())

when (OperatingSystem.current()) {
OperatingSystem.WINDOWS -> {
winUpgradeUuid.ifPresent { uuid ->
args.addAll("--win-upgrade-uuid", uuid)
}
winRegistryName.ifPresent { name ->
args.addAll("--win-registry-name", name)
}
if (addToWindowsMenu.getOrElse(false)) {
args.add("--win-menu")
}
Expand All @@ -270,7 +250,7 @@ open class JpackageExec : DefaultTask() {
}
OperatingSystem.MAC_OS -> {
macBundleIdentifier.ifPresent { id ->
args.addAll("--mac-bundle-identifier", id)
args.addAll("--mac-package-identifier", id)
}
}
OperatingSystem.LINUX -> {
Expand Down
Loading

0 comments on commit 8923d10

Please sign in to comment.