diff --git a/.travis.yml b/.travis.yml index 310b4c7bd8..0bde2b5f38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,8 +38,8 @@ script: # will not be able to run MainWindowTest.testDragOperationFromPaletteToPipeline - | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; - then ./gradlew check jacocoTestReport jacocoRootReport --stacktrace -Pheadless=true -PlogTests -Dscan -Pgeneration -PjniLocation=$HOME/opencv/jni; - else ./gradlew check jacocoTestReport jacocoRootReport --stacktrace -Pheadless=true -PlogTests -Dscan; + then ./gradlew check jacocoTestReport jacocoRootReport --stacktrace -Pheadless=true -PlogTests --scan -Pgeneration -PjniLocation=$HOME/opencv/jni; + else ./gradlew check jacocoTestReport jacocoRootReport --stacktrace -Pheadless=true -PlogTests --scan; fi after_success: diff --git a/build.gradle b/build.gradle index 165e12b700..e1ba42be5e 100644 --- a/build.gradle +++ b/build.gradle @@ -14,9 +14,9 @@ buildscript { } dependencies { - classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.5.2' - classpath 'com.netflix.nebula:gradle-aggregate-javadocs-plugin:2.2.+' - classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8' + classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.8.0' + classpath 'com.netflix.nebula:gradle-aggregate-javadocs-plugin:3.0.1' + classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.11' classpath group: 'edu.wpi.first.wpilib.opencv', name: 'opencv-installer', version: '2.0.0' } } @@ -25,15 +25,15 @@ import edu.wpi.first.wpilib.opencv.installer.Installer import edu.wpi.first.wpilib.opencv.installer.platform.Platform plugins { - id 'com.gradle.build-scan' version '1.3' + id 'com.gradle.build-scan' version '1.8' id 'java' id 'idea' id 'eclipse' id 'jacoco' id 'com.google.osdetector' version '1.4.0' - id 'com.github.johnrengelman.shadow' version '1.2.3' - id "com.dorongold.task-tree" version "1.2.2" - id 'org.ajoberstar.grgit' version '1.6.0' apply false + id 'com.github.johnrengelman.shadow' version '1.2.4' + id 'com.dorongold.task-tree' version '1.3' + id 'org.ajoberstar.grgit' version '1.7.1' apply false } apply plugin: 'nebula-aggregate-javadocs' apply from: 'git.gradle' @@ -89,7 +89,7 @@ configure(subprojects - project(':ui:linuxLauncher')) { apply plugin: 'findbugs' configurations.errorprone { - resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.15' + resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.21' } checkstyle { @@ -127,12 +127,16 @@ configure(subprojects - project(':ui:linuxLauncher')) { } } - task findbugsMainReport << { - printReportSafe(findbugsMain.reports.getXml().destination) + task findbugsMainReport { + doLast { + printReportSafe(findbugsMain.reports.getXml().destination) + } } - task findbugsTestReport << { - printReportSafe(findbugsTest.reports.getXml().destination) + task findbugsTestReport { + doLast { + printReportSafe(findbugsTest.reports.getXml().destination) + } } findbugsMain.finalizedBy findbugsMainReport @@ -142,18 +146,14 @@ configure(subprojects - project(':ui:linuxLauncher')) { mavenCentral() jcenter() } - jacoco { - toolVersion = "0.7.5.201505241946" - } - dependencies { compile group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1' testCompile group: 'net.jodah', name: 'concurrentunit', version: '0.4.2' 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.30' - testCompile group: 'com.google.guava', name: 'guava-testlib', version: '20.0' + testCompile group: 'com.google.truth', name: 'truth', version: '0.34' + testCompile group: 'com.google.guava', name: 'guava-testlib', version: '22.0' } version = getVersionName() @@ -582,7 +582,7 @@ task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') { } task wrapper(type: Wrapper) { - gradleVersion = '3.2.1' + gradleVersion = '4.0.2' // We want the sources with the wrapper. distributionType = DistributionType.ALL } diff --git a/core/src/main/java/edu/wpi/grip/core/operations/composite/SaveImageOperation.java b/core/src/main/java/edu/wpi/grip/core/operations/composite/SaveImageOperation.java index 37b179481a..f948bbec73 100644 --- a/core/src/main/java/edu/wpi/grip/core/operations/composite/SaveImageOperation.java +++ b/core/src/main/java/edu/wpi/grip/core/operations/composite/SaveImageOperation.java @@ -18,6 +18,7 @@ import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; +import java.util.Locale; import java.util.concurrent.TimeUnit; import static org.bytedeco.javacpp.opencv_core.Mat; @@ -69,7 +70,7 @@ private enum FileTypes { @Override public String toString() { - return super.toString().toLowerCase(); + return super.toString().toLowerCase(Locale.ENGLISH); } } diff --git a/core/src/main/java/edu/wpi/grip/core/sources/CameraSource.java b/core/src/main/java/edu/wpi/grip/core/sources/CameraSource.java index b17f96e5b5..3e3a95bba6 100644 --- a/core/src/main/java/edu/wpi/grip/core/sources/CameraSource.java +++ b/core/src/main/java/edu/wpi/grip/core/sources/CameraSource.java @@ -31,6 +31,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.List; +import java.util.Locale; import java.util.Optional; import java.util.Properties; import java.util.concurrent.Executor; @@ -352,7 +353,7 @@ public void onSourceRemovedEvent(SourceRemovedEvent event) throws InterruptedExc // a new camera source is added. For webcam sources, this means that the video stream // won't be freed and new sources won't be able to connect to the webcam until the // application is closed. - if (StandardSystemProperty.OS_NAME.value().toLowerCase().contains("mac")) { + if (StandardSystemProperty.OS_NAME.value().toLowerCase(Locale.ENGLISH).contains("mac")) { // Workaround for #716. This affects webcams as well as IP camera sources. // Use only stopAsync() to avoid blocking. Since we have no way of knowing when // the capture has actually been freed, we use a dumb delay to try to make sure it's diff --git a/core/src/main/java/edu/wpi/grip/core/sources/NetworkTableEntrySource.java b/core/src/main/java/edu/wpi/grip/core/sources/NetworkTableEntrySource.java index 9742a4392c..423a6e0471 100644 --- a/core/src/main/java/edu/wpi/grip/core/sources/NetworkTableEntrySource.java +++ b/core/src/main/java/edu/wpi/grip/core/sources/NetworkTableEntrySource.java @@ -20,6 +20,7 @@ import com.thoughtworks.xstream.annotations.XStreamAlias; import java.util.List; +import java.util.Locale; import java.util.Properties; /** @@ -75,7 +76,7 @@ public String toString() { } public String toProperty() { - return toString().toUpperCase(); + return toString().toUpperCase(Locale.ENGLISH); } } diff --git a/core/src/test/java/edu/wpi/grip/core/CoreSanityTest.java b/core/src/test/java/edu/wpi/grip/core/CoreSanityTest.java index 9041b2c2df..30cbca1eae 100644 --- a/core/src/test/java/edu/wpi/grip/core/CoreSanityTest.java +++ b/core/src/test/java/edu/wpi/grip/core/CoreSanityTest.java @@ -42,5 +42,6 @@ public CoreSanityTest() { () -> null)); setDefault(OperationDescription.class, OperationDescription.builder().name("").summary("") .build()); + setDefault(Step.class, new MockStep()); } } diff --git a/core/src/test/java/edu/wpi/grip/core/operations/OperationsUtil.java b/core/src/test/java/edu/wpi/grip/core/operations/OperationsUtil.java index 2eb460762b..8920b3cbdc 100644 --- a/core/src/test/java/edu/wpi/grip/core/operations/OperationsUtil.java +++ b/core/src/test/java/edu/wpi/grip/core/operations/OperationsUtil.java @@ -20,9 +20,11 @@ public ImmutableList operations() { public OperationMetaData getMetaData(String opName) { Locale locOpName = new Locale(opName); - String newOpName = locOpName.toString().toLowerCase().replaceAll("[^a-zA-Z]", ""); + String newOpName + = locOpName.toString().toLowerCase(Locale.ENGLISH).replaceAll("[^a-zA-Z]", ""); for (OperationMetaData data : operations()) { - String dataName = data.getDescription().name().toLowerCase().replaceAll("[^a-zA-Z]", ""); + String dataName + = data.getDescription().name().toLowerCase(Locale.ENGLISH).replaceAll("[^a-zA-Z]", ""); if (dataName.equals(newOpName)) { return data; } diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index e54844dd1c..0000000000 --- a/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.parallel=true -org.gradle.configureondemand=true -org.gradle.cache.tasks=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 51288f9c2f..140e48c45f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d10cf03efd..42ac071913 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Dec 09 22:08:14 EST 2016 +#Wed Aug 02 23:12:11 PDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-all.zip diff --git a/gradlew b/gradlew index 4453ccea33..cccdd3d517 100755 --- a/gradlew +++ b/gradlew @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -155,7 +155,7 @@ if $cygwin ; then fi # Escape application args -save ( ) { +save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } diff --git a/pmd-ruleset.xml b/pmd-ruleset.xml index 3a8ffb335d..bd92a94192 100644 --- a/pmd-ruleset.xml +++ b/pmd-ruleset.xml @@ -7,6 +7,7 @@ + @@ -37,4 +38,4 @@ - \ No newline at end of file + diff --git a/ui/src/main/java/edu/wpi/grip/ui/pipeline/SocketHandleView.java b/ui/src/main/java/edu/wpi/grip/ui/pipeline/SocketHandleView.java index cca5e113b1..08646d7c4a 100644 --- a/ui/src/main/java/edu/wpi/grip/ui/pipeline/SocketHandleView.java +++ b/ui/src/main/java/edu/wpi/grip/ui/pipeline/SocketHandleView.java @@ -16,6 +16,7 @@ import com.google.inject.Singleton; import com.google.inject.assistedinject.Assisted; +import java.util.Locale; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -54,7 +55,8 @@ public class SocketHandleView extends Button { this.setTooltip(new Tooltip("Drag to connect")); - this.getStyleClass().addAll("socket-handle", socket.getDirection().toString().toLowerCase()); + this.getStyleClass().addAll("socket-handle", + socket.getDirection().toString().toLowerCase(Locale.ENGLISH)); this.connectingProperty.addListener((observableValue, oldValue, isConnecting) -> this.pseudoClassStateChanged(CONNECTING_PSEUDO_CLASS, isConnecting)); diff --git a/ui/src/main/java/edu/wpi/grip/ui/util/StyleClassNameUtility.java b/ui/src/main/java/edu/wpi/grip/ui/util/StyleClassNameUtility.java index f90501ef6f..341af852e0 100644 --- a/ui/src/main/java/edu/wpi/grip/ui/util/StyleClassNameUtility.java +++ b/ui/src/main/java/edu/wpi/grip/ui/util/StyleClassNameUtility.java @@ -5,6 +5,8 @@ import edu.wpi.grip.core.OperationDescription; import edu.wpi.grip.core.Step; +import java.util.Locale; + /** * Creates CSS style classes and ID's for nodes. This makes it possible to use CSS selectors to * retrieve nodes in unit tests. @@ -81,6 +83,7 @@ public static String cssSelectorForInputSocketHandleOn(Step step) { } private static StringBuilder shortNameFor(OperationDescription operationDescription) { - return new StringBuilder(operationDescription.name().toLowerCase().replace(" ", "-")); + return new StringBuilder(operationDescription.name().toLowerCase(Locale.ENGLISH) + .replace(" ", "-")); } } diff --git a/ui/src/test/java/edu/wpi/grip/ui/codegeneration/FilterLinesGenerationTesting.java b/ui/src/test/java/edu/wpi/grip/ui/codegeneration/FilterLinesGenerationTesting.java index 6a378c7613..37eac1b3ce 100644 --- a/ui/src/test/java/edu/wpi/grip/ui/codegeneration/FilterLinesGenerationTesting.java +++ b/ui/src/test/java/edu/wpi/grip/ui/codegeneration/FilterLinesGenerationTesting.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Locale; import java.util.Optional; import static org.junit.Assert.assertTrue; @@ -48,7 +49,7 @@ public FilterLinesGenerationTesting() { @Before public void ignoreIfWindows() { assumeFalse("OpenCV JNI bindings crash in Windows using Line segment detector", - System.getProperty("os.name").toLowerCase().contains("windows")); + System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows")); } void generatePipeline() { diff --git a/ui/src/test/java/edu/wpi/grip/ui/codegeneration/FindLinesGenerationTesting.java b/ui/src/test/java/edu/wpi/grip/ui/codegeneration/FindLinesGenerationTesting.java index 25f79bc2ef..53cb0d9f34 100644 --- a/ui/src/test/java/edu/wpi/grip/ui/codegeneration/FindLinesGenerationTesting.java +++ b/ui/src/test/java/edu/wpi/grip/ui/codegeneration/FindLinesGenerationTesting.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.Optional; import java.util.logging.Logger; @@ -46,7 +47,7 @@ public FindLinesGenerationTesting() { @Before public void ignoreIfWindows() { assumeFalse("OpenCV JNI bindings crash in Windows using Line segment detector", - System.getProperty("os.name").toLowerCase().contains("windows")); + System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows")); } void generatePipeline() { diff --git a/ui/src/test/java/edu/wpi/grip/ui/codegeneration/tools/PythonPipelineInterfacer.java b/ui/src/test/java/edu/wpi/grip/ui/codegeneration/tools/PythonPipelineInterfacer.java index f773781109..44b85640cc 100644 --- a/ui/src/test/java/edu/wpi/grip/ui/codegeneration/tools/PythonPipelineInterfacer.java +++ b/ui/src/test/java/edu/wpi/grip/ui/codegeneration/tools/PythonPipelineInterfacer.java @@ -22,6 +22,7 @@ import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Matcher; @@ -50,7 +51,7 @@ public class PythonPipelineInterfacer implements PipelineInterfacer { fail("Could not load code directory"); logger.log(Level.WARNING, e.getMessage(), e); } - if (System.getProperty("os.name").toLowerCase().contains("windows")) { + if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows")) { pythonCmd = "python"; } else { pythonCmd = "python3";