From 36295e9f18307aa6d380c2197da075110aa2fc1e Mon Sep 17 00:00:00 2001 From: John Engelman Date: Tue, 26 Aug 2014 10:27:52 -0500 Subject: [PATCH] [misc] Remove deprecated method and add notes about breaking change. --- ChangeLog.md | 3 ++- .../gradle/plugins/shadow/tasks/ShadowJar.groovy | 14 -------------- .../gradle/plugins/shadow/tasks/ShadowSpec.groovy | 3 --- .../gradle/plugins/shadow/RelocationSpec.groovy | 2 +- .../gradle/plugins/shadow/TransformerSpec.groovy | 6 +++--- 5 files changed, 6 insertions(+), 22 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 053e45989..192252fcc 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,8 @@ v1.1.0 ====== ++ (Breaking Change!) Fix leaking of `shadowJar.manifest` into `jar.manifest`. ([Issue #82](https://github.com/johnrengelman/shadow/issues/82)) + To simplify behavior, the `shadowJar.appendManifest` method has been removed. Replace uses with `shadowJar.manifest` + `ShadowTask` now has a `configurations` property that is resolved to the files in the resolved configuration before being added to the copy spec. This allows for an easier implementation for filtering. The default 'shadowJar' task has the convention of adding the `'runtime'` scope to this list. Manually created instances of `ShadowTask` have no @@ -14,7 +16,6 @@ v1.1.0 + [Matt Hurne](https://github.com/mhurne) - Added `GroovyExtensionModuleTransformer` for merging Groovy Extension module descriptor files. The existing `ServiceFileTransformer` now excludes Groovy Extension Module descriptors by default. + `distShadowZip` and `distShadowZip` now contain the shadow library and run scripts instead of the default from the `'application'` plugin ([Issue #89](https://github.com/johnrengelman/shadow/issues/89)) -+ Fix leaking of `shadowJar.manifest` into `jar.manifest`. ([Issue #82](https://github.com/johnrengelman/shadow/issues/82)) v1.0.3 ====== diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.groovy index f91a55fa1..76b695fa0 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.groovy @@ -152,20 +152,6 @@ class ShadowJar extends Jar implements ShadowSpec { } } - /** - * Append content to the JAR Manifest created by the Jar task. - * @param configureClosure - * @return - * - * @deprecated Use manifest {} instead - */ - @Deprecated - ShadowJar appendManifest(Closure configureClosure) { - logger.warn 'The appendManifest method is deprecated and will be removed in the next major version. Use manifest(Closure) instead.' - ConfigureUtil.configure(configureClosure, getManifest()) - return this - } - /** * Add a class relocator that maps each class in the pattern to the provided destination * @param pattern diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowSpec.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowSpec.groovy index e6f2119bf..63b37a6f7 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowSpec.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowSpec.groovy @@ -24,9 +24,6 @@ interface ShadowSpec extends CopySpec { ShadowSpec append(String resourcePath) - @Deprecated - ShadowSpec appendManifest(Closure configure) - ShadowSpec relocate(String pattern, String destination) ShadowSpec relocate(String pattern, String destination, Closure configure) diff --git a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/RelocationSpec.groovy b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/RelocationSpec.groovy index 77b2a4f8c..0ed67e54b 100644 --- a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/RelocationSpec.groovy +++ b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/RelocationSpec.groovy @@ -27,7 +27,7 @@ class RelocationSpec extends PluginSpecification { | classifier = null | relocate 'junit.textui', 'a' | relocate 'junit.framework', 'b' - | appendManifest { + | manifest { | attributes 'TEST-VALUE': 'FOO' | } |} diff --git a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/TransformerSpec.groovy b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/TransformerSpec.groovy index 55c53b194..ac05a4a01 100644 --- a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/TransformerSpec.groovy +++ b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/TransformerSpec.groovy @@ -362,7 +362,7 @@ class TransformerSpec extends PluginSpecification { |shadowJar { | baseName = 'shadow' | classifier = null - | appendManifest { + | manifest { | attributes 'Test-Entry': 'PASSED' | attributes 'New-Entry': 'NEW' | } @@ -509,7 +509,7 @@ class TransformerSpec extends PluginSpecification { } @Issue('SHADOW-82') - def 'shadow.appendManifest leaks to jar.manifest'() { + def 'shadow manifest leaks to jar manifest'() { given: File main = file('src/main/java/shadow/Main.java') main << ''' @@ -536,7 +536,7 @@ class TransformerSpec extends PluginSpecification { |shadowJar { | baseName = 'shadow' | classifier = null - | appendManifest { + | manifest { | attributes 'Test-Entry': 'PASSED' | attributes 'New-Entry': 'NEW' | }