From 21bb1ce1e307440f74e4ea4434ed748ead3e79f2 Mon Sep 17 00:00:00 2001 From: Oleksii Lisikh Date: Fri, 30 Jun 2017 10:42:01 +0200 Subject: [PATCH] Stop using deprecated Manifest.writeTo(Writer) and using Manifest.writeTo(Object) instead In Gradle 4.0 Manifest.writeTo(Writer) will be removed, to make it compatible, Manifest.writeTo(Object) needs to be used --- .../github/rholder/gradle/task/OneJar.groovy | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/groovy/com/github/rholder/gradle/task/OneJar.groovy b/src/main/groovy/com/github/rholder/gradle/task/OneJar.groovy index 9b37b20..2c641bd 100644 --- a/src/main/groovy/com/github/rholder/gradle/task/OneJar.groovy +++ b/src/main/groovy/com/github/rholder/gradle/task/OneJar.groovy @@ -178,14 +178,13 @@ class OneJar extends Jar { File writeOneJarManifestFile(Manifest manifest) { File manifestFile = File.createTempFile("one-jar-manifest", ".mf") manifestFile.deleteOnExit() - - manifestFile.withWriter { writer -> - manifest.attributes.put("Main-Class", "com.simontuffs.onejar.Boot") - manifest.attributes.put("One-Jar-Main-Class", mainClass) - manifest.attributes.put("One-Jar-Show-Expand", showExpand) - manifest.attributes.put("One-Jar-Confirm-Expand", confirmExpand) - manifest.writeTo(writer) - } - return manifestFile + + manifest.attributes.put("Main-Class", "com.simontuffs.onejar.Boot") + manifest.attributes.put("One-Jar-Main-Class", mainClass) + manifest.attributes.put("One-Jar-Show-Expand", showExpand) + manifest.attributes.put("One-Jar-Confirm-Expand", confirmExpand) + manifest.writeTo(manifestFile.path) + + manifestFile } }