From c70b4bbe4ae1fca2084a5e1b2d968e5b111436c2 Mon Sep 17 00:00:00 2001 From: Goooler Date: Sat, 11 Jan 2025 23:19:29 +0800 Subject: [PATCH] Tweak the doc about packaging Gradle plugins --- src/docs/plugins/README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/docs/plugins/README.md b/src/docs/plugins/README.md index b4b6a4840..e65c9534e 100644 --- a/src/docs/plugins/README.md +++ b/src/docs/plugins/README.md @@ -11,10 +11,10 @@ and `relocationPrefix` settings on any `ShadowJar` task. A simple Gradle plugin can use this feature by applying the `shadow` plugin and configuring the `shadowJar` task for relocation. ```groovy -dependencies { - shadow localGroovy() - shadow gradleApi() +apply plugin: 'java-gradle-plugin' +apply plugin: 'com.gradleup.shadow' +dependencies { implementation 'org.jdom:jdom2:2.0.6' implementation 'org.ow2.asm:asm:6.0' implementation 'org.ow2.asm:asm-commons:6.0' @@ -25,14 +25,10 @@ dependencies { tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { enableRelocation = true + archiveClassifier = '' } ``` -Note that the `localGroovy()` and `gradleApi()` dependencies are added to the `shadow` configuration instead of the -normal `compile` configuration. These 2 dependencies are provided by Gradle to compile your project but are ultimately -provided by the Gradle runtime when executing the plugin. Thus, it is **not** advisable to bundle these dependencies -with your plugin. - ## Publishing shadowed Gradle plugins The Gradle Publish Plugin introduced support for plugins packaged with Shadow in version 1.0.0. Starting with this version, plugin projects that apply both Shadow and the Gradle Plugin Publish plugin will be