Skip to content

Commit

Permalink
Update to Gradle 4.0.2 (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinShalit authored and JLLeitschuh committed Aug 3, 2017
1 parent fb7ca6a commit 316458a
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
38 changes: 19 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
Expand All @@ -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'
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -69,7 +70,7 @@ private enum FileTypes {

@Override
public String toString() {
return super.toString().toLowerCase();
return super.toString().toLowerCase(Locale.ENGLISH);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.List;
import java.util.Locale;
import java.util.Properties;

/**
Expand Down Expand Up @@ -75,7 +76,7 @@ public String toString() {
}

public String toProperty() {
return toString().toUpperCase();
return toString().toUpperCase(Locale.ENGLISH);
}
}

Expand Down
1 change: 1 addition & 0 deletions core/src/test/java/edu/wpi/grip/core/CoreSanityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ public CoreSanityTest() {
() -> null));
setDefault(OperationDescription.class, OperationDescription.builder().name("").summary("")
.build());
setDefault(Step.class, new MockStep());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ public ImmutableList<OperationMetaData> 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;
}
Expand Down
3 changes: 0 additions & 3 deletions gradle.properties

This file was deleted.

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 " "
}
Expand Down
3 changes: 2 additions & 1 deletion pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<rule ref="rulesets/java/braces.xml" />
<rule ref="rulesets/java/design.xml">
<exclude name="AccessorClassGeneration" />
<exclude name="AccessorMethodGeneration" />
<exclude name="AvoidSynchronizedAtMethodLevel" />
<exclude name="CloseResource" />
<exclude name="ConfusingTernary" />
Expand Down Expand Up @@ -37,4 +38,4 @@
<rule ref="rulesets/java/unnecessary.xml">
<exclude name="UselessParentheses" />
</rule>
</ruleset>
</ruleset>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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(" ", "-"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 316458a

Please sign in to comment.