diff --git a/buckw b/buckw index d91b51fa2..ac804fb05 100755 --- a/buckw +++ b/buckw @@ -195,6 +195,7 @@ setupBuckRun ( ) { handleParams ( ) { # Go directly to kill. Do not run okbuck. if [[ "kill" == $1 ]]; then + echo "skipping okbuck" SKIP_OKBUCK=true fi } diff --git a/build.gradle b/build.gradle index 8a604da22..e45cb82e4 100644 --- a/build.gradle +++ b/build.gradle @@ -163,6 +163,11 @@ okbuck { } } +task wrapper(type : Wrapper) { + gradleVersion = '3.5' + distributionUrl = "https://services.gradle.org/distributions/gradle-3.5-all.zip" +} + gradle.buildFinished { "zip -d .okbuck/cache/org.hamcrest.hamcrest-core-1.3.jar LICENSE.txt".execute() "zip -d .okbuck/cache/org.hamcrest.hamcrest-library-1.3.jar LICENSE.txt".execute() diff --git a/buildSrc/src/main/java/com/uber/okbuck/core/util/FileUtil.java b/buildSrc/src/main/java/com/uber/okbuck/core/util/FileUtil.java index 3d469fcbe..c1cad5113 100644 --- a/buildSrc/src/main/java/com/uber/okbuck/core/util/FileUtil.java +++ b/buildSrc/src/main/java/com/uber/okbuck/core/util/FileUtil.java @@ -38,15 +38,12 @@ public static String getRelativePath(File root, File f) { @SuppressWarnings("ResultOfMethodCallIgnored") public static void copyResourceToProject(String resource, File destination) { - try { - InputStream inputStream = FileUtil.class.getResourceAsStream(resource); - destination.getParentFile().mkdirs(); - OutputStream outputStream = new FileOutputStream(destination); + destination.getParentFile().mkdirs(); + try (InputStream inputStream = FileUtil.class.getResourceAsStream(resource); + OutputStream outputStream = new FileOutputStream(destination)) { IOUtils.copy(inputStream, outputStream); - IOUtils.closeQuietly(inputStream); - IOUtils.closeQuietly(outputStream); } catch (IOException e) { - throw new IllegalStateException(e); + throw new RuntimeException(e); } } diff --git a/buildSrc/src/main/java/com/uber/okbuck/core/util/ReplaceUtil.java b/buildSrc/src/main/java/com/uber/okbuck/core/util/ReplaceUtil.java index e72b51409..fc1c53e03 100644 --- a/buildSrc/src/main/java/com/uber/okbuck/core/util/ReplaceUtil.java +++ b/buildSrc/src/main/java/com/uber/okbuck/core/util/ReplaceUtil.java @@ -18,18 +18,14 @@ final class ReplaceUtil { @SuppressWarnings("ResultOfMethodCallIgnored") static void copyResourceToProject(String resource, File destination, Map templates) { - try { - InputStream inputStream = FileUtil.class.getResourceAsStream(resource); - destination.getParentFile().mkdirs(); - InputStreamReader reader = new InputStreamReader(inputStream); - TemplateReader replacingReader = new TemplateReader(reader, new TemplateMapResolver(templates)); - - OutputStream outputStream = new FileOutputStream(destination); + destination.getParentFile().mkdirs(); + try (InputStream inputStream = FileUtil.class.getResourceAsStream(resource); + InputStreamReader reader = new InputStreamReader(inputStream); + TemplateReader replacingReader = new TemplateReader(reader, new TemplateMapResolver(templates)); + OutputStream outputStream = new FileOutputStream(destination)){ IOUtils.copy(replacingReader, outputStream); - IOUtils.closeQuietly(inputStream); - IOUtils.closeQuietly(outputStream); } catch (IOException e) { - throw new IllegalStateException(e); + throw new RuntimeException(e); } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 0f0ed5820..42420ec89 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 0e8331a0d..9fa5fc78c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Mar 31 15:13:29 PDT 2017 +#Thu Apr 27 20:36:07 PDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip