Repository: GradleUp/shadow (kotlin)

Issue:
Partial ConfigureShadowRelocation task
Basically, I have been trying to figure out a way to create an partial "uber" jar. The documentation clearly states that by default it will create an "uber" jar from the `shadowJar` task, but I was interested in the proper way to only include one of the dependencies, say dependency `A` (as well as `A`'s dependencies) AND relocate all the packages of dependency `A` as well. I believe that http://imperceptiblethoughts.com/shadow/#using_shadow_to_package_gradle_plugins adds in the `ConfigureShadowRelocation` task which achieves my goal, but it seems to do it for ALL dependencies (not sure how to just pick one dependency, dependency `A`).  

> Configuring the relocation has always been possible, but the build author is required to know all the package names before hand. Shadow v2.0 corrects this by introducing a new task type ConfigureShadowRelocation. Tasks of this type are configured to target a an instance of a ShadowJar task and run immediately before it.

See [below](#gradle-build-script-s) for my configuration

### Shadow Version

`2.0.1`

### Gradle Version

`Gradle 4.1`

### Gradle Build Script(s)
```
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
    }
}

apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'

dependencies {
  compile "A"
  compile "B"
  compile "C"
}

shadowJar {
  //what do i put here to just do relocation for "A"
}
```

Pull request:
- Closes #330.
- Follow up #1325.

Patch:
diff --git a/docs/configuration/relocation/README.md b/docs/configuration/relocation/README.md
index a1bb6f3de..4148f0ead 100644
--- a/docs/configuration/relocation/README.md
+++ b/docs/configuration/relocation/README.md
@@ -93,6 +93,34 @@ expression in `%regex[]` before passing it to `include`/`exclude`.
     }
     ```
 
+It may be desirable to relocate all packages in a Shadow JAR except for a select few. This can be accomplished by
+specifying a relocation with an empty string `''` as the pattern to match on all packages. An `exclude` filter can then
+be used to prevent relocation of specific packages.
+
+=== "Kotlin"
+
+    ```kotlin
+    tasks.shadowJar {
+      relocate("", "my/shadow/prefix") {
+        exclude("META-INF/**")
+        // Exclude all JUnit packages.
+        exclude("junit/**")
+      }
+    }
+    ```
+
+=== "Groovy"
+
+    ```groovy
+    tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
+      relocate('', 'my/shadow/prefix') {
+        exclude 'META-INF/**'
+        // Exclude all JUnit packages.
+        exclude 'junit/**'
+      }
+    }
+    ```
+
 ## Skipping Relocation for String Constants
 
 If there is a class like:


Test patch:
diff --git a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt
index 2fa92e2f6..5630b4bce 100644
--- a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt
+++ b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt
@@ -478,7 +478,7 @@ class RelocationTest : BasePluginTest() {
     val relocateConfig = if (exclude) {
       """
         exclude 'junit/**'
-        exclude '$manifestEntry'
+        exclude 'META-INF/**'
       """.trimIndent()
     } else {
       ""