diff --git a/ChangeLog.md b/ChangeLog.md index 196e4d65c..63878bc8e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,7 @@ v0.9.0-M2 + Added integration with `application` plugin to replace old `OutputSignedJars` task + Fixed bug that resulted in duplicate file entries in the resulting Jar ++ Changed plugin id to 'com.github.johnrengelman.shadow' to support Gradle 2.x plugin infrastructure. v0.9.0-M1 ========= diff --git a/README.md b/README.md index af0ee5242..03270e112 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ buildscript { } } -apply plugin: 'shadow' +apply plugin: 'com.github.johnrengelman.shadow' ``` @@ -188,7 +188,7 @@ TODO - need to implement this ### Publishing the shadow jar as an additional resource to the main jar ``` -apply plugin: 'shadow' +apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'maven-publish' publishing { @@ -204,7 +204,7 @@ publishing { ### Publishing the shadow jar as a standalone artifact ``` -apply plugin: 'shadow' +apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'maven-publish' shadowJar { diff --git a/src/main/resources/META-INF/gradle-plugins/com.github.jengelman.gradle.plugins.shadow.properties b/src/main/resources/META-INF/gradle-plugins/com.github.johnrengelman.shadow.properties similarity index 100% rename from src/main/resources/META-INF/gradle-plugins/com.github.jengelman.gradle.plugins.shadow.properties rename to src/main/resources/META-INF/gradle-plugins/com.github.johnrengelman.shadow.properties diff --git a/src/main/resources/META-INF/gradle-plugins/shadow.properties b/src/main/resources/META-INF/gradle-plugins/shadow.properties deleted file mode 100644 index e77803a7e..000000000 --- a/src/main/resources/META-INF/gradle-plugins/shadow.properties +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright 2011 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -implementation-class=com.github.jengelman.gradle.plugins.shadow.ShadowPlugin diff --git a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/PublishingSpec.groovy b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/PublishingSpec.groovy index f41251fcb..2ee11ebf9 100644 --- a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/PublishingSpec.groovy +++ b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/PublishingSpec.groovy @@ -148,7 +148,7 @@ public class Main { } """ buildFile << """ -apply plugin: 'shadow' +apply plugin: ${ShadowPlugin.name} apply plugin: 'application' mainClassName = 'myapp.Main' diff --git a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowPluginSpec.groovy b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowPluginSpec.groovy index 63b472979..5d2405d69 100644 --- a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowPluginSpec.groovy +++ b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/ShadowPluginSpec.groovy @@ -43,6 +43,29 @@ class ShadowPluginSpec extends PluginSpecification { } + def 'apply plugin by id'() { + given: + buildFile << """ +apply plugin: 'com.github.johnrengelman.shadow' + +repositories { jcenter() } +dependencies { compile 'junit:junit:3.8.2' } + +shadowJar { + baseName = 'shadow' + classifier = null +} +""" + + when: + runner.arguments << 'shadowJar' + ExecutionResult result = runner.run() + + then: + success(result) + assert output.exists() + } + def 'shadow copy'() { given: URL artifact = this.class.classLoader.getResource('test-artifact-1.0-SNAPSHOT.jar')