Skip to content

Commit

Permalink
Merge pull request #1 from alisiikh/manifest_writeTo_deprecated
Browse files Browse the repository at this point in the history
Stop using deprecated Manifest.writeTo(Writer) and using Manifest.wri…
  • Loading branch information
LeviticusMB authored Aug 12, 2017
2 parents 6a6e5bf + 21bb1ce commit a0f2fac
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/main/groovy/com/github/rholder/gradle/task/OneJar.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,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
}
}

0 comments on commit a0f2fac

Please sign in to comment.