Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
95a0d1c
Add AGENTS.md
Goooler Aug 13, 2026
e0fb6a7
Validate ZIP entry names to prevent Zip Slip path traversal
Goooler Aug 13, 2026
60cb77a
Stop catching ZipException when writing entries (#1970)
Goooler Aug 13, 2026
7653fce
Fix failing for non-existent class directories (#1976)
Goooler Aug 13, 2026
c3f3421
Use GradleException for expected build failures (#2113)
Goooler Aug 13, 2026
1dead14
Update RelocatorRemapper class pattern to cover more Java method desc…
Goooler Aug 13, 2026
833d931
Fix skipStringConstants per-relocator behavior: use continue instead …
Goooler Aug 13, 2026
8fee4b1
Do not write modified class files for no-op relocations (#1694)
Goooler Aug 13, 2026
62a2f9d
Support relocating list of types in RelocatorRemapper (#1714)
Goooler Aug 13, 2026
0f8d9cd
Fix excluding dependencies whose versions contain + (#1597)
Goooler Aug 13, 2026
7edb3a2
Fix relocation exclusion for file patterns like kotlin/kotlin.kotlin_…
Goooler Aug 13, 2026
6b2a254
Make the output of PropertiesFileTransformer reproducible (#1861)
Goooler Aug 13, 2026
ebaead0
Merge Gradle Module descriptors into the modern META-INF path (#1706)
Goooler Aug 13, 2026
978cd2f
Migrate build configuration to Version Catalog and upgrade Gradle Wra…
Goooler Aug 13, 2026
d3dae0a
Remove rootProject name
Goooler Aug 13, 2026
f1af3b2
Use ZipUtils.zipEntry in transformers to prevent Zip Slip
Goooler Aug 13, 2026
aee1556
Deprecate InheritManifest (#1722)
Goooler Aug 13, 2026
f64927d
Deprecate minimizeJar property (#2124)
Goooler Aug 13, 2026
6d4fdb7
Deprecate TransformerContext.Builder (#2184)
Goooler Aug 13, 2026
b02da5e
Apply suggestions from code review
Goooler Aug 13, 2026
a49a41b
Fix formatting and copyright handling in ApacheNoticeResourceTransfor…
Goooler Aug 13, 2026
c4acdd9
Fix ShadowJar not being successful after includes or excludes are cha…
Goooler Aug 13, 2026
62dba81
Honor executableDir in ShadowApplicationPlugin (#1738)
Goooler Aug 13, 2026
9bd08df
Apply suggestions from code review
Goooler Aug 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Agent Guidelines

To understand how to contribute code, format commits, and run tests for this repository,
please refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) file.

**Instructions for AI Agents:**
1. Adhere to the coding standards and PR templates defined therein.
2. Make an atomic commit after completing each task.
3. Pass `--non-interactive` to Gradle commands to disable interactive console prompts.
4. Prefer using the `gh` CLI for GitHub-related tasks.
24 changes: 12 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import org.gradle.plugin.compatibility.compatibility
plugins {
groovy
`java-gradle-plugin`
id("com.gradle.plugin-publish") version "2.1.0"
id("com.vanniktech.maven.publish") version "0.36.0"
id("com.diffplug.spotless") version "8.2.1"
alias(libs.plugins.pluginPublish)
alias(libs.plugins.mavenPublish)
alias(libs.plugins.spotless)
}

version = providers.gradleProperty("VERSION_NAME").get()
Expand Down Expand Up @@ -73,22 +73,22 @@ publishing.publications.withType<MavenPublication>().configureEach {
}

dependencies {
api("org.apache.ant:ant:1.10.15") // Types from Ant are exposed in the public API.
implementation("org.jdom:jdom2:2.0.6.1")
implementation("commons-io:commons-io:2.19.0")
implementation("org.codehaus.plexus:plexus-utils:4.0.2")
implementation("org.codehaus.plexus:plexus-xml:4.1.1")
implementation("org.apache.logging.log4j:log4j-core:2.25.3")
implementation("org.vafer:jdependency:2.16")
api(libs.apache.ant) // Types from Ant are exposed in the public API.
implementation(libs.commons.io)
implementation(libs.jdom2)
implementation(libs.plexus.utils)
implementation(libs.plexus.xml)
implementation(libs.apache.log4j)
implementation(libs.jdependency)

testImplementation("org.spockframework:spock-core:2.4-groovy-4.0") {
exclude(group = "org.codehaus.groovy")
exclude(group = "org.hamcrest")
}
testImplementation("org.xmlunit:xmlunit-legacy:2.11.0")
testImplementation(libs.xmlunit)
testImplementation("org.apache.commons:commons-lang3:3.17.0")
testImplementation("com.google.guava:guava:33.3.1-jre")
testImplementation(platform("org.junit:junit-bom:5.13.1"))
testImplementation(platform(libs.junit.bom))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.junit.platform:junit-platform-suite-engine")
}
Expand Down
18 changes: 18 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[versions]
pluginPublish = "2.1.1"

[libraries]
apache-ant = "org.apache.ant:ant:1.10.17"
apache-log4j = "org.apache.logging.log4j:log4j-core:2.26.1"
commons-io = "commons-io:commons-io:2.19.0"
jdependency = "org.vafer:jdependency:2.16"
jdom2 = "org.jdom:jdom2:2.0.6.1"
junit-bom = "org.junit:junit-bom:5.14.0"
plexus-utils = "org.codehaus.plexus:plexus-utils:4.0.3"
plexus-xml = "org.codehaus.plexus:plexus-xml:4.1.1"
xmlunit = "org.xmlunit:xmlunit-legacy:2.13.0"

[plugins]
mavenPublish = "com.vanniktech.maven.publish:0.37.0"
pluginPublish = { id = "com.gradle.plugin-publish", version.ref = "pluginPublish" }
spotless = "com.diffplug.spotless:8.9.0"
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
Expand Down
164 changes: 82 additions & 82 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ pluginManagement {
}

plugins {
id("com.gradle.develocity") version "4.2"
id("com.gradle.develocity") version "4.5.0"
}

develocity {
buildScan {
termsOfUseUrl = "https://gradle.com/terms-of-service"
termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
termsOfUseAgree = "yes"
// TODO: workaround for https://github.com/gradle/gradle/issues/22879.
val isCI = providers.environmentVariable("CI").isPresent
Expand All @@ -25,6 +25,4 @@ dependencyResolutionManagement {
}
}

rootProject.name = "shadow"

enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
27 changes: 27 additions & 0 deletions src/docs/changes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@

## [Unreleased]

**Changed**

- Stop catching ZipException when writing entries. ([#1970](https://github.com/GradleUp/shadow/pull/1970))
- Use GradleException for expected build failures. ([#2113](https://github.com/GradleUp/shadow/pull/2113))
- Update `RelocatorRemapper` class pattern to cover more Java method descriptors. ([#1731](https://github.com/GradleUp/shadow/pull/1731))
- Do not write modified class files for no-op relocations. ([#1694](https://github.com/GradleUp/shadow/pull/1694))
- Support relocating list of types in `RelocatorRemapper`. ([#1714](https://github.com/GradleUp/shadow/pull/1714))
- Make the output of `PropertiesFileTransformer` reproducible. ([#1861](https://github.com/GradleUp/shadow/pull/1861))
- Merge Gradle Module descriptors into the modern `META-INF` path. ([#1706](https://github.com/GradleUp/shadow/pull/1706))

**Fixed**

- Validate ZIP entry names to prevent Zip Slip path traversal.
- Fix failing for non-existent class directories. ([#1976](https://github.com/GradleUp/shadow/pull/1976))
- Fix skipStringConstants per-relocator behavior in mapName. ([#1968](https://github.com/GradleUp/shadow/pull/1968))
- Fix excluding dependencies whose versions contain `+`. ([#1597](https://github.com/GradleUp/shadow/pull/1597))
- Fix relocation exclusion for file patterns like `kotlin/kotlin.kotlin_builtins`. ([#1313](https://github.com/GradleUp/shadow/pull/1313))
- Fix formatting and copyright handling in `ApacheNoticeResourceTransformer`. ([#1623](https://github.com/GradleUp/shadow/pull/1623), [#1627](https://github.com/GradleUp/shadow/pull/1627), [#1628](https://github.com/GradleUp/shadow/pull/1628))
- Fix ShadowJar not being re-executed after includes or excludes are changed. ([#1200](https://github.com/GradleUp/shadow/pull/1200))
- Respect `executableDir` in application extension when configuring start scripts and distribution. ([#1738](https://github.com/GradleUp/shadow/pull/1738))


**Deprecated**

- Deprecate `InheritManifest`. ([#1722](https://github.com/GradleUp/shadow/pull/1722))
- Deprecate `minimizeJar` property. ([#2124](https://github.com/GradleUp/shadow/pull/2124))
- Deprecate `TransformerContext.Builder`. ([#2184](https://github.com/GradleUp/shadow/pull/2184))

## [v8.3.11] (2026-05-28)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class ShadowApplicationPlugin implements Plugin<Project> {
project.tasks.named(SHADOW_INSTALL_TASK_NAME, Sync).configure { task ->
task.doFirst {
if (task.destinationDir.directory) {
if (task.destinationDir.listFiles().size() != 0 && (!new File(task.destinationDir, 'lib').directory || !new File(task.destinationDir, 'bin').directory)) {
if (task.destinationDir.listFiles().size() != 0 && (!new File(task.destinationDir, 'lib').directory || !new File(task.destinationDir, javaApplication.executableDir).directory)) {
throw new GradleException("The specified installation directory '${task.destinationDir}' is neither empty nor does it contain an installation for '${javaApplication.applicationName}'.\n" +
"If you really want to install to this directory, delete it and run the install task again.\n" +
"Alternatively, choose a different installation directory."
Expand All @@ -104,7 +104,7 @@ class ShadowApplicationPlugin implements Plugin<Project> {
}
task.doLast {
task.eachFile {
if (it.path == "bin/${javaApplication.applicationName}") {
if (it.path == "${javaApplication.executableDir}/${javaApplication.applicationName}") {
it.mode = 0x755
}
}
Expand All @@ -122,7 +122,7 @@ class ShadowApplicationPlugin implements Plugin<Project> {
from(jar)
from(project.configurations.shadow)
}
into("bin") {
into({ javaApplication.executableDir }) {
from(startScripts)
filePermissions { it.unix(493) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.github.jengelman.gradle.plugins.shadow

import com.github.jengelman.gradle.plugins.shadow.legacy.LegacyShadowPlugin
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.ApplicationPlugin
Expand All @@ -19,6 +20,12 @@ class ShadowPlugin implements Plugin<Project> {
plugins.withType(ApplicationPlugin) {
plugins.apply(ShadowApplicationPlugin)
}
plugins.withId('com.android.base') {
throw new GradleException(
"Shadow does not support being used with AGP. You may need the Android Fused Library plugin instead. " +
"See https://developer.android.com/build/publish-library/fused-library"
)
}
// Apply the legacy plugin last
// Because we apply the ShadowJavaPlugin/ShadowApplication plugin in a withType callback for the
// respective JavaPlugin/ApplicationPlugin, it may still apply before the shadowJar task is created and
Expand Down
Loading