From 859bf45cbb4c3a654dc15c420267f8e0bf4cf9a5 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 2 Aug 2019 02:34:01 +0100 Subject: [PATCH] Excavator: Upgrades Baseline to the latest version (#136) --- .baseline/checkstyle/checkstyle.xml | 3 ++- build.gradle | 3 ++- src/main/java/com/palantir/gradle/graal/ExtractGraalTask.java | 3 ++- src/main/java/com/palantir/gradle/graal/GradleGraalPlugin.java | 2 +- versions.props | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.baseline/checkstyle/checkstyle.xml b/.baseline/checkstyle/checkstyle.xml index 792229c..268ebe3 100644 --- a/.baseline/checkstyle/checkstyle.xml +++ b/.baseline/checkstyle/checkstyle.xml @@ -422,6 +422,7 @@ + @@ -435,7 +436,7 @@ - + diff --git a/build.gradle b/build.gradle index 9ab5d27..979dc49 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ buildscript { classpath 'com.gradle.publish:plugin-publish-plugin:0.10.0' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.0.0' - classpath 'com.palantir.baseline:gradle-baseline-java:0.65.0' + classpath 'com.palantir.baseline:gradle-baseline-java:1.8.2' classpath 'gradle.plugin.com.palantir.gradle.gitversion:gradle-git-version:0.7.3' classpath 'gradle.plugin.org.inferred:gradle-processors:2.2.0' } @@ -56,6 +56,7 @@ version gitVersion() dependencies { compile localGroovy() compile gradleApi() + compile 'com.palantir.safe-logging:preconditions' testCompile gradleTestKit() testCompile 'com.netflix.nebula:nebula-test' diff --git a/src/main/java/com/palantir/gradle/graal/ExtractGraalTask.java b/src/main/java/com/palantir/gradle/graal/ExtractGraalTask.java index 08523ec..f5c7509 100644 --- a/src/main/java/com/palantir/gradle/graal/ExtractGraalTask.java +++ b/src/main/java/com/palantir/gradle/graal/ExtractGraalTask.java @@ -16,6 +16,7 @@ package com.palantir.gradle.graal; +import com.palantir.logsafe.exceptions.SafeIllegalStateException; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; @@ -54,7 +55,7 @@ public class ExtractGraalTask extends DefaultTask { @TaskAction public final void extractGraal() { if (!graalVersion.isPresent()) { - throw new IllegalStateException("extract task requires graal.graalVersion to be defined."); + throw new SafeIllegalStateException("extract task requires graal.graalVersion to be defined."); } // ideally this would be a CopyTask, but through Gradle 4.9 CopyTask fails to correctly extract symlinks diff --git a/src/main/java/com/palantir/gradle/graal/GradleGraalPlugin.java b/src/main/java/com/palantir/gradle/graal/GradleGraalPlugin.java index 867a76f..6fc0db9 100644 --- a/src/main/java/com/palantir/gradle/graal/GradleGraalPlugin.java +++ b/src/main/java/com/palantir/gradle/graal/GradleGraalPlugin.java @@ -53,7 +53,7 @@ public class GradleGraalPlugin implements Plugin { Path cacheDir = Optional.ofNullable((String) project.findProperty("com.palantir.graal.cache.dir")) .map(Paths::get) - .orElse(project.getGradle().getGradleUserHomeDir().toPath() + .orElseGet(() -> project.getGradle().getGradleUserHomeDir().toPath() .resolve("caches") .resolve("com.palantir.graal")); diff --git a/versions.props b/versions.props index 07d1e4a..44dcdc2 100644 --- a/versions.props +++ b/versions.props @@ -1,5 +1,6 @@ com.google.guava:guava = 27.0.1-jre com.netflix.nebula:nebula-test = 7.2.5 +com.palantir.safe-logging:preconditions = 1.10.1 com.squareup.okhttp3:* = 3.14.1 # conflict resolution