Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for PropertiesFileTransformer breaks Reproducible builds in 8.1.1 #856 #858

Closed
wants to merge 81 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
fbcd41e
Add test to validate PropertiesFileTransformer supports reproducible …
agascon Apr 18, 2023
a7ef65b
Fix CleanProperties mechanism to strip Properties timestamp and suppo…
agascon Apr 18, 2023
70bbe04
fix(deps): update junit5 monorepo to v5.9.3
renovate[bot] Jul 20, 2023
50ac368
chore(deps): update plugin com.github.node-gradle.node to v3.6.0
renovate[bot] Jul 20, 2023
7091142
chore(deps): update plugin com.gradle.enterprise to v3.14
renovate[bot] Jul 20, 2023
b7e7d29
chore(deps): update plugin com.gradle.plugin-publish to v1.2.0
renovate[bot] Jul 20, 2023
ac94c4f
fix(deps): update dependency commons-io:commons-io to v2.13.0
renovate[bot] Jul 20, 2023
312c6e6
fix(deps): update dependency com.google.guava:guava to v32
renovate[bot] Jul 20, 2023
9f04033
chore(deps): update plugin com.github.node-gradle.node to v5
renovate[bot] Jul 20, 2023
0f0cf46
chore(deps): update plugin org.ajoberstar.git-publish to v4.2.0
renovate[bot] Jul 20, 2023
054f578
Update org.codehaus.plexus:plexus-utils v4
renovate[bot] Jul 20, 2023
6267843
Gradle 8.2.1
renovate[bot] Jul 20, 2023
75d67f5
fix(deps): update junit5 monorepo to v5.10.0
renovate[bot] Jul 23, 2023
a340d18
chore(deps): update plugin com.gradle.enterprise to v3.14.1
renovate[bot] Jul 26, 2023
4adccc8
fix(deps): update dependency org.apache.commons:commons-lang3 to v3.13.0
renovate[bot] Jul 28, 2023
53ea308
fix(deps): update dependency com.google.guava:guava to v32.1.2-jre
renovate[bot] Jul 31, 2023
85687aa
fix(deps): update dependency org.vafer:jdependency to v2.9.0
renovate[bot] Aug 11, 2023
4f88432
chore(deps): update plugin com.gradle.plugin-publish to v1.2.1
renovate[bot] Aug 17, 2023
e707a28
chore(deps): update dependency vuepress to v1.9.10
renovate[bot] Aug 14, 2023
28f5c64
Gradle 8.3
renovate[bot] Aug 17, 2023
3105093
chore(deps): update plugin com.github.node-gradle.node to v6
renovate[bot] Aug 15, 2023
027bcb8
chore(deps): update plugin com.github.node-gradle.node to v7
renovate[bot] Aug 17, 2023
eefd05c
fix(deps): update dependency org.apache.ant:ant to v1.10.14
renovate[bot] Aug 20, 2023
7f320c7
chore(deps): update actions/checkout action to v4
renovate[bot] Sep 4, 2023
e07d172
chore(deps): update plugin com.gradle.enterprise to v3.15
renovate[bot] Sep 13, 2023
07e3e69
chore(deps): update actions/checkout digest to 8ade135
renovate[bot] Sep 25, 2023
4249b52
fix(deps): update dependency org.ow2.asm:asm-commons to v9.6
renovate[bot] Sep 30, 2023
082b888
fix(deps): update dependency org.ow2.asm:asm to v9.6
renovate[bot] Oct 1, 2023
9cee0e5
fix(deps): update dependency commons-io:commons-io to v2.14.0
renovate[bot] Oct 1, 2023
65f52a2
chore(deps): update dependency gradle to v8.4
renovate[bot] Oct 5, 2023
d091ecd
chore(deps): update plugin com.github.node-gradle.node to v7.0.1
renovate[bot] Oct 4, 2023
ef94538
chore(deps): update plugin com.gradle.enterprise to v3.15.1
renovate[bot] Oct 5, 2023
7c6219c
fix(deps): update dependency com.google.guava:guava to v32.1.3-jre
renovate[bot] Oct 11, 2023
d34c2b2
fix(deps): update dependency org.apache.logging.log4j:log4j-core to v…
renovate[bot] Oct 17, 2023
109dbfd
chore(deps): update plugin org.ajoberstar.git-publish to v4.2.1
renovate[bot] Oct 21, 2023
65c5a15
fix(deps): update dependency org.apache.logging.log4j:log4j-core to v…
renovate[bot] Oct 24, 2023
f38fee5
fix(deps): update dependency commons-io:commons-io to v2.15.0
renovate[bot] Oct 26, 2023
b2e6667
Migrate deprecations and warnings
Goooler Oct 27, 2023
bf36338
Reimplement ShadowCopyAction.getPermissions
Goooler Oct 27, 2023
2c85bda
Minor tweaks
Goooler Oct 28, 2023
cdc2103
Polish tests
Goooler Oct 28, 2023
976c02a
fix(deps): update junit5 monorepo to v5.10.1
renovate[bot] Nov 5, 2023
769c8d9
Use azul/zulu-openjdk docker image on CI
Goooler Nov 16, 2023
5b77780
chore(deps): update dependency gradle to v8.5
renovate[bot] Nov 29, 2023
3d7b326
chore(deps): update azul/zulu-openjdk docker tag to v21
renovate[bot] Nov 29, 2023
057c3d7
fix(deps): update dependency org.apache.commons:commons-lang3 to v3.14.0
renovate[bot] Nov 22, 2023
66ec255
fix(deps): update dependency org.apache.logging.log4j:log4j-core to v…
renovate[bot] Nov 20, 2023
2eb3a18
fix(deps): update dependency commons-io:commons-io to v2.15.1
renovate[bot] Nov 29, 2023
d87167b
fix(deps): update dependency org.codehaus.plexus:plexus-xml to v4.0.3
renovate[bot] Dec 13, 2023
4b290d0
chore(deps): update plugin com.gradle.enterprise to v3.16.1
renovate[bot] Dec 14, 2023
1d03f01
fix(deps): update dependency com.google.guava:guava to v33
renovate[bot] Dec 19, 2023
cf88a81
fix(deps): update dependency org.apache.logging.log4j:log4j-core to v…
renovate[bot] Dec 27, 2023
dc3c40f
Remove CC workaround for Sign tasks
Goooler Jan 9, 2024
14ec82f
chore(deps): update plugin com.gradle.enterprise to v3.16.2
renovate[bot] Feb 2, 2024
2d6338d
fix(deps): update dependency org.vafer:jdependency to v2.10
renovate[bot] Jan 25, 2024
8fbe4ee
chore(deps): update gradle/wrapper-validation-action action to v2
renovate[bot] Jan 29, 2024
e5dfc1f
chore(deps): update dependency gradle to v8.6
renovate[bot] Feb 2, 2024
1661709
chore(deps): update plugin com.github.node-gradle.node to v7.0.2
renovate[bot] Feb 3, 2024
ddea78d
chore(deps): update plugin org.ajoberstar.git-publish to v4.2.2
renovate[bot] Feb 18, 2024
52797e8
fix(deps): update junit5 monorepo to v5.10.2
renovate[bot] Feb 4, 2024
f6458ea
Replace deprecated file permission API usage (#82)
jbartok Mar 4, 2024
e012295
fix(deps): update dependency org.apache.logging.log4j:log4j-core to v…
renovate[bot] Feb 21, 2024
4b2b226
Replace deprecated file permission API usage
jbartok Mar 5, 2024
cb55eec
fix(deps): update dependency org.apache.logging.log4j:log4j-core to v…
renovate[bot] Mar 10, 2024
fc406dc
fix(deps): update dependency com.google.guava:guava to v33.1.0-jre
renovate[bot] Mar 13, 2024
41613cb
chore(deps): update dependency gradle to v8.7
renovate[bot] Mar 22, 2024
fc3e9f4
fix(deps): update dependency org.ow2.asm:asm-commons to v9.7
renovate[bot] Mar 23, 2024
c948a32
fix(deps): update dependency org.ow2.asm:asm to v9.7
renovate[bot] Mar 24, 2024
d1e9592
chore(deps): update plugin com.gradle.enterprise to v3.17
renovate[bot] Apr 2, 2024
a84839c
fix(deps): update dependency commons-io:commons-io to v2.16.1
renovate[bot] Apr 8, 2024
b69bbf2
chore(deps): update gradle/wrapper-validation-action action to v3
renovate[bot] Apr 13, 2024
1ed36dc
Migrate to develocity plugin
renovate[bot] Apr 24, 2024
e93d334
fix(deps): update dependency org.codehaus.plexus:plexus-utils to v4.0.1
renovate[bot] Apr 13, 2024
c584842
chore(deps): update dependency gradle to v8.8
renovate[bot] Jun 1, 2024
ddc7fb8
fix(deps): update dependency com.google.guava:guava to v33.2.1-jre
renovate[bot] May 31, 2024
16f1816
fix(deps): update dependency org.codehaus.plexus:plexus-xml to v4.0.4
renovate[bot] May 21, 2024
af47fc9
chore(deps): update plugin com.gradle.develocity to v3.17.4
renovate[bot] May 17, 2024
eac5748
Merge branch 'main' into main
agascon Jun 7, 2024
57c7895
Apply suggestions from code review
Goooler Jun 7, 2024
9d7d97e
Apply suggestions from code review
Goooler Jun 7, 2024
666b57c
Apply suggestions from code review
Goooler Jun 7, 2024
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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defaults: &defaults
working_directory: ~/shadow
docker:
- image: cimg/openjdk:17.0
- image: azul/zulu-openjdk:21-latest
environment:
- TERM: "dumb"
- GRADLE_OPTS: "-Xmx1024m"
Expand Down Expand Up @@ -29,7 +29,7 @@ jobs:
paths:
- ~/.gradle

- run: ./gradlew build --scan
- run: ./gradlew build

- run:
name: Save test results
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
27 changes: 9 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ plugins {
id 'idea'
id 'java-gradle-plugin'
id 'signing'
id 'com.gradle.plugin-publish' version '1.1.0'
id 'org.ajoberstar.git-publish' version '4.1.1'
id 'com.github.node-gradle.node' version '3.5.1'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'org.ajoberstar.git-publish' version '4.2.2'
id 'com.github.node-gradle.node' version '7.0.2'
}

apply plugin: ShadowPlugin
Expand All @@ -20,11 +20,6 @@ apply from: file('gradle/vuepress.gradle')
apply from: file('gradle/ghPages.gradle')
apply from: file('gradle/dependencies.gradle')

repositories {
gradlePluginPortal()
mavenCentral()
}

tasks.withType(Test).configureEach {
useJUnitPlatform()

Expand All @@ -34,25 +29,21 @@ tasks.withType(Test).configureEach {
maxHeapSize "1g"
}

systemProperty 'java.io.tmpdir', buildDir.absolutePath
systemProperty 'java.io.tmpdir', project.layout.buildDirectory.asFile.get().absolutePath

// Required to test configuration cache in tests when using withDebug()
// https://github.com/gradle/gradle/issues/22765#issuecomment-1339427241
jvmArgs(
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.util.concurrent.atomic=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang.invoke=ALL-UNNAMED",
"--add-opens",
"java.base/java.net=ALL-UNNAMED",
"--add-opens", "java.base/java.util=ALL-UNNAMED",
"--add-opens", "java.base/java.util.concurrent.atomic=ALL-UNNAMED",
"--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED",
"--add-opens", "java.base/java.net=ALL-UNNAMED",
)
}

// Remove the gradleApi so it isn't merged into the jar file.
// This is required because 'java-gradle-plugin' adds gradleApi() to the 'api' configuration.
// See https://github.com/gradle/gradle/blob/master/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/JavaGradlePluginPlugin.java#L162
// See https://github.com/gradle/gradle/blob/972c3e5c6ef990dd2190769c1ce31998a9402a79/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/JavaGradlePluginPlugin.java#L161
configurations.named(JavaPlugin.API_CONFIGURATION_NAME) {
dependencies.remove(project.dependencies.gradleApi())
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ScriptHolder {

//Grab the dependencies closure and resolve it against
//the buildSrc project dependencies
//This effectively applies the same dependenices from build.gradle into buildSrc/build.gradle
//This effectively applies the same dependencies from build.gradle into buildSrc/build.gradle
//This is required so that when buildSrc is compiled it has the dependencies to compile the source code
def closure = holder.dependencies.clone()
closure.delegate = project.dependencies
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=2g
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx4g -XX:MaxMetaspaceSize=2g
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.unsafe.configuration-cache=true
org.gradle.configuration-cache=true
24 changes: 13 additions & 11 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ dependencies {
shadow 'org.codehaus.groovy:groovy-backports-compat23:3.0.8'

implementation 'org.jdom:jdom2:2.0.6.1'
implementation 'org.ow2.asm:asm:9.5'
implementation 'org.ow2.asm:asm-commons:9.5'
implementation 'commons-io:commons-io:2.11.0'
implementation 'org.apache.ant:ant:1.10.13'
implementation 'org.codehaus.plexus:plexus-utils:3.5.1'
implementation "org.apache.logging.log4j:log4j-core:2.20.0"
implementation('org.vafer:jdependency:2.8.0') {
implementation 'org.ow2.asm:asm:9.7'
implementation 'org.ow2.asm:asm-commons:9.7'
implementation 'commons-io:commons-io:2.16.1'
implementation 'org.apache.ant:ant:1.10.14'
implementation 'org.codehaus.plexus:plexus-utils:4.0.1'
implementation 'org.codehaus.plexus:plexus-xml:4.0.4'
implementation "org.apache.logging.log4j:log4j-core:2.23.1"
implementation('org.vafer:jdependency:2.10') {
exclude group: 'org.ow2.asm'
}

Expand All @@ -19,8 +20,9 @@ dependencies {
}
testImplementation 'org.spockframework:spock-junit4:2.3-groovy-3.0'
testImplementation 'xmlunit:xmlunit:1.6'
testImplementation 'org.apache.commons:commons-lang3:3.12.0'
testImplementation 'com.google.guava:guava:31.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.9.2'
testImplementation 'org.apache.commons:commons-lang3:3.14.0'
testImplementation 'com.google.guava:guava:33.2.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.10.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
4 changes: 0 additions & 4 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ signing {
sign(publishing.publications)
}

tasks.withType(Sign).configureEach {
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13470")
}

tasks.register('release') {
dependsOn tasks.named('assemble'), tasks.named('publishPlugins'), tasks.named('gitPublishPush')
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
31 changes: 18 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
20 changes: 14 additions & 6 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ pluginManagement {
}

plugins {
id 'com.gradle.enterprise' version '3.12.6'
id 'com.gradle.develocity' version '3.17.4'
}

gradleEnterprise {
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}

def isCI = providers.environmentVariable('CI').present

develocity {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
publishAlways()
if (System.env.CI == 'true') {
termsOfUseUrl = 'https://gradle.com/terms-of-service'
termsOfUseAgree = 'yes'
publishing.onlyIf { isCI }
if (isCI) {
tag 'CI'
if (System.env.CIRCLE_TAG) {
link 'VCS', "https://github.com/johnrengelman/shadow/tree/${System.env.CIRCLE_TAG}"
Expand Down
4 changes: 3 additions & 1 deletion src/docs/application-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'

mainClassName = 'myapp.Main'
application {
mainClass = 'myapp.Main'
}
```

## Running the Shadow JAR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ShadowApplicationPlugin implements Plugin<Project> {
startScripts.classpath = project.files(jar)
startScripts.conventionMapping.mainClassName = { javaApplication.mainClass.get() }
startScripts.conventionMapping.applicationName = { javaApplication.applicationName }
startScripts.conventionMapping.outputDir = { new File(project.buildDir, 'scriptsShadow') }
startScripts.conventionMapping.outputDir = { new File(project.layout.buildDirectory.asFile.get(), 'scriptsShadow') }
startScripts.conventionMapping.defaultJvmOpts = { javaApplication.applicationDefaultJvmArgs }
startScripts.inputs.files project.objects.fileCollection().from { -> jar }
}
Expand Down Expand Up @@ -126,7 +126,7 @@ class ShadowApplicationPlugin implements Plugin<Project> {
}
into("bin") {
from(startScripts)
fileMode = 493
filePermissions { unix(493) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ class ShadowBasePlugin implements Plugin<Project> {

@Override
void apply(Project project) {
if (GradleVersion.current() < GradleVersion.version("8.0")) {
throw new GradleException("This version of Shadow supports Gradle 8.0+ only. Please upgrade.")
if (GradleVersion.current() < GradleVersion.version("8.3")) {
throw new GradleException("This version of Shadow supports Gradle 8.3+ only. Please upgrade.")
}
project.extensions.create(EXTENSION_NAME, ShadowExtension, project)
createShadowConfiguration(project)

project.tasks.register(KnowsTask.NAME, KnowsTask) { knows ->
knows.group = ShadowJavaPlugin.SHADOW_GROUP
knows.description = KnowsTask.DESC
knows.description = DESC
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import org.gradle.api.Project
import org.gradle.api.plugins.ApplicationPlugin
import org.gradle.api.plugins.JavaPlugin

import static java.util.Objects.nonNull

class ShadowPlugin implements Plugin<Project> {

@Override
Expand All @@ -21,17 +19,25 @@ class ShadowPlugin implements Plugin<Project> {
plugins.apply(ShadowApplicationPlugin)
}

// Legacy build scan support for Gradle Enterprise, users should migrate to develocity plugin.
rootProject.plugins.withId('com.gradle.enterprise') {
rootProject.buildScan.buildFinished {
def shadowTasks = tasks.withType(ShadowJar)
shadowTasks.each { task ->
if (task.didWork) {
task.stats.buildScanData.each { k, v ->
rootProject.buildScan.value "shadow.${task.path}.${k}", v.toString()
}
rootProject.buildScan.value "shadow.${task.path}.configurations", task.configurations*.name.join(", ")
}
configureBuildScan(rootProject)
}
rootProject.plugins.withId('com.gradle.develocity') {
configureBuildScan(rootProject)
}
}
}

private void configureBuildScan(Project rootProject) {
rootProject.buildScan.buildFinished {
def shadowTasks = tasks.withType(ShadowJar)
shadowTasks.each { task ->
if (task.didWork) {
task.stats.buildScanData.each { k, v ->
rootProject.buildScan.value "shadow.${task.path}.${k}", v.toString()
}
rootProject.buildScan.value "shadow.${task.path}.configurations", task.configurations*.name.join(", ")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ShadowStats {
Map<String, String> getBuildScanData() {
[
dependencies: jarCount,
relocations: relocationString
]
relocations : relocationString,
] as Map<String, String>
}
}
Loading