Skip to content

Commit b12aba9

Browse files
authored
Move the group of ShadowJar from shadow to build (#1355)
Aligns with `Jar`, `SourceJarTask`, and so on.
1 parent 2fcbfd1 commit b12aba9

File tree

8 files changed

+12
-9
lines changed

8 files changed

+12
-9
lines changed

api/shadow.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public abstract class com/github/jengelman/gradle/plugins/shadow/ShadowBasePlugi
2424
public static final field Companion Lcom/github/jengelman/gradle/plugins/shadow/ShadowBasePlugin$Companion;
2525
public static final field DISTRIBUTION_NAME Ljava/lang/String;
2626
public static final field EXTENSION_NAME Ljava/lang/String;
27-
public static final field GROUP_NAME Ljava/lang/String;
2827
public static final field SHADOW Ljava/lang/String;
2928
public fun <init> ()V
3029
public synthetic fun apply (Ljava/lang/Object;)V

docs/changes/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
## [Unreleased]
55

6+
**Changed**
7+
8+
- Move the group of `ShadowJar` from `shadow` to `build`. ([#1355](https://github.com/GradleUp/shadow/pull/1355))
9+
610

711
## [v9.0.0-beta11] (2025-03-18)
812

docs/custom-tasks/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies to merge into the output.
99

1010
```kotlin
1111
val testShadowJar by tasks.registering(com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar::class) {
12-
group = com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.GROUP_NAME
12+
group = LifecycleBasePlugin.BUILD_GROUP
1313
description = "Create a combined JAR of project and test dependencies"
1414

1515
archiveClassifier = "tests"
@@ -33,7 +33,7 @@ dependencies to merge into the output.
3333

3434
```groovy
3535
def testShadowJar = tasks.register('testShadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
36-
group = com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.GROUP_NAME
36+
group = LifecycleBasePlugin.BUILD_GROUP
3737
description = 'Create a combined JAR of project and test dependencies'
3838

3939
archiveClassifier = 'tests'

docs/publishing/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ It is possible to publish a custom `ShadowJar` task's output via the [`MavenPubl
163163
}
164164

165165
val testShadowJar by tasks.registering(com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar::class) {
166-
group = com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.GROUP_NAME
166+
group = LifecycleBasePlugin.BUILD_GROUP
167167
description = "Create a combined JAR of project and test dependencies"
168168
archiveClassifier = "tests"
169169
from(sourceSets.test.map { it.output })
@@ -196,7 +196,7 @@ It is possible to publish a custom `ShadowJar` task's output via the [`MavenPubl
196196
}
197197

198198
def testShadowJar = tasks.register('testShadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
199-
group = com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.GROUP_NAME
199+
group = LifecycleBasePlugin.BUILD_GROUP
200200
description = 'Create a combined JAR of project and test dependencies'
201201
archiveClassifier = 'tests'
202202
from sourceSets.named('test').map { it.output }

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ class JavaPluginTest : BasePluginTest() {
475475
testImplementation 'junit:junit:3.8.2'
476476
}
477477
def $testShadowJarTask = tasks.register('$testShadowJarTask', ${ShadowJar::class.java.name}) {
478-
group = com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.GROUP_NAME
478+
group = LifecycleBasePlugin.BUILD_GROUP
479479
description = 'Create a combined JAR of project and test dependencies'
480480
archiveClassifier = 'tests'
481481
from sourceSets.named('test').map { it.output }

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/PublishingTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class PublishingTest : BasePluginTest() {
148148
publishConfiguration(
149149
projectBlock = """
150150
def testShadowJar = tasks.register('testShadowJar', ${ShadowJar::class.java.name}) {
151-
group = com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.GROUP_NAME
151+
group = LifecycleBasePlugin.BUILD_GROUP
152152
description = 'Create a combined JAR of project and test dependencies'
153153
archiveClassifier = 'tests'
154154
from sourceSets.named('test').map { it.output }

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowBasePlugin.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public abstract class ShadowBasePlugin : Plugin<Project> {
2121

2222
public companion object {
2323
public const val SHADOW: String = "shadow"
24-
public const val GROUP_NAME: String = SHADOW
2524
public const val EXTENSION_NAME: String = SHADOW
2625
public const val CONFIGURATION_NAME: String = SHADOW
2726
public const val COMPONENT_NAME: String = SHADOW

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import org.gradle.api.component.SoftwareComponentFactory
2424
import org.gradle.api.plugins.JavaPlugin
2525
import org.gradle.api.tasks.TaskContainer
2626
import org.gradle.api.tasks.TaskProvider
27+
import org.gradle.language.base.plugins.LifecycleBasePlugin
2728
import org.gradle.plugin.devel.plugins.JavaGradlePluginPlugin
2829

2930
public abstract class ShadowJavaPlugin @Inject constructor(
@@ -127,7 +128,7 @@ public abstract class ShadowJavaPlugin @Inject constructor(
127128
action: Action<ShadowJar>,
128129
): TaskProvider<ShadowJar> {
129130
return tasks.register(SHADOW_JAR_TASK_NAME, ShadowJar::class.java) { task ->
130-
task.group = ShadowBasePlugin.GROUP_NAME
131+
task.group = LifecycleBasePlugin.BUILD_GROUP
131132
task.description = "Create a combined JAR of project and runtime dependencies"
132133
task.archiveClassifier.set("all")
133134
task.exclude(

0 commit comments

Comments
 (0)