Skip to content

Commit c4487ce

Browse files
Merge pull request shazam#193 from shazam/update-gradle-wrapper-to-7-4-2
Update Gradle wrapper to 7.4.2
2 parents 2a96ef0 + ecf1a20 commit c4487ce

File tree

7 files changed

+66
-84
lines changed

7 files changed

+66
-84
lines changed

build-scripts/gradle-mvn-push.gradle

Lines changed: 48 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apply plugin: 'maven'
1+
apply plugin: 'maven-publish'
22
apply plugin: 'signing'
33

44
def isReleaseBuild() {
@@ -23,79 +23,66 @@ def getRepositoryPassword() {
2323
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
2424
}
2525

26-
uploadArchives {
27-
repositories {
28-
mavenDeployer {
29-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
30-
31-
pom.groupId = GROUP
32-
pom.artifactId = POM_ARTIFACT_ID
33-
pom.version = VERSION_NAME
26+
java {
27+
withJavadocJar()
28+
withSourcesJar()
29+
}
3430

35-
repository(url: getReleaseRepositoryUrl()) {
36-
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
31+
afterEvaluate {
32+
publishing {
33+
repositories {
34+
maven {
35+
def releaseRepositoryUrl = getReleaseRepositoryUrl()
36+
def snapshotRepositoryUrl = getSnapshotRepositoryUrl()
37+
url = isReleaseBuild() ? releaseRepositoryUrl : snapshotRepositoryUrl
38+
credentials {
39+
username = getRepositoryUsername()
40+
password = getRepositoryPassword()
41+
}
3742
}
43+
}
3844

39-
snapshotRepository(url: getSnapshotRepositoryUrl()) {
40-
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
41-
}
45+
publications {
46+
release(MavenPublication) {
47+
groupId = GROUP
48+
artifactId = POM_ARTIFACT_ID
49+
version = VERSION_NAME
4250

43-
pom.project {
44-
name POM_NAME
45-
packaging POM_PACKAGING
46-
description POM_DESCRIPTION
47-
url POM_URL
51+
from(project.components.java)
4852

49-
scm {
50-
url POM_SCM_URL
51-
connection POM_SCM_CONNECTION
52-
developerConnection POM_SCM_DEV_CONNECTION
53-
}
53+
pom {
54+
name = POM_NAME
55+
packaging = POM_PACKAGING
56+
description = POM_DESCRIPTION
57+
url = POM_URL
5458

55-
licenses {
56-
license {
57-
name POM_LICENCE_NAME
58-
url POM_LICENCE_URL
59-
distribution POM_LICENCE_DIST
59+
scm {
60+
url = POM_SCM_URL
61+
connection = POM_SCM_CONNECTION
62+
developerConnection = POM_SCM_DEV_CONNECTION
6063
}
61-
}
6264

63-
developers {
64-
developer {
65-
id POM_DEVELOPER_ID
66-
name POM_DEVELOPER_NAME
65+
licenses {
66+
license {
67+
name = POM_LICENCE_NAME
68+
url = POM_LICENCE_URL
69+
distribution = POM_LICENCE_DIST
70+
}
71+
}
72+
73+
developers {
74+
developer {
75+
id = POM_DEVELOPER_ID
76+
name = POM_DEVELOPER_NAME
77+
}
6778
}
6879
}
6980
}
7081
}
7182
}
72-
}
7383

74-
signing {
75-
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
76-
sign configurations.archives
77-
}
78-
79-
task javadocJar(type: Jar) {
80-
classifier = 'javadoc'
81-
from javadoc
82-
}
83-
84-
task sourcesJar(type: Jar) {
85-
classifier = 'sources'
86-
from sourceSets.main.allSource
87-
}
88-
89-
artifacts {
90-
archives javadocJar, sourcesJar
91-
}
92-
93-
install {
94-
repositories {
95-
mavenInstaller {
96-
pom.groupId = GROUP
97-
pom.artifactId = POM_ARTIFACT_ID
98-
pom.version = VERSION_NAME
99-
}
84+
signing {
85+
required { isReleaseBuild() }
86+
sign publishing.publications.release
10087
}
10188
}

build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ subprojects {
5555
jacocoTestReport.dependsOn test
5656
jacocoTestReport.reports.html.enabled false
5757
jacocoTestReport.reports.xml.enabled true
58-
59-
// Weirdly archives are signed even if signing.required {false}, so also skipping task explicitly.
60-
signArchives.onlyIf { !VERSION_NAME.endsWith("SNAPSHOT") }
6158
}
6259
}
6360

fork-reporter-jenkins-gradle-plugin/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,16 @@ dependencies {
2626
"com.offbytwo.jenkins:jenkins-client:0.3.4",
2727
"org.apache.commons:commons-lang3:$commonsLangVersion")
2828
}
29+
30+
// favour publication configured by `gradle-mvn-push.gradle`
31+
tasks.withType(PublishToMavenRepository).configureEach {
32+
if (name.contains("PluginMaven")) {
33+
enabled = false
34+
}
35+
}
36+
37+
tasks.withType(PublishToMavenLocal).configureEach {
38+
if (name.contains("PluginMaven")) {
39+
enabled = false
40+
}
41+
}

gradle/wrapper/gradle-wrapper.jar

293 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fi
130130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133-
133+
134134
JAVACMD=`cygpath --unix "$JAVACMD"`
135135

136136
# We build the pattern for arguments to be converted via cygpath

gradlew.bat

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4040

4141
set JAVA_EXE=java.exe
4242
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4444

4545
echo.
4646
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
5454
set JAVA_HOME=%JAVA_HOME:"=%
5555
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5656

57-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5858

5959
echo.
6060
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,29 +64,14 @@ echo location of your Java installation.
6464

6565
goto fail
6666

67-
:init
68-
@rem Get command-line arguments, handling Windows variants
69-
70-
if not "%OS%" == "Windows_NT" goto win9xME_args
71-
72-
:win9xME_args
73-
@rem Slurp the command line arguments.
74-
set CMD_LINE_ARGS=
75-
set _SKIP=2
76-
77-
:win9xME_args_slurp
78-
if "x%~1" == "x" goto execute
79-
80-
set CMD_LINE_ARGS=%*
81-
8267
:execute
8368
@rem Setup the command line
8469

8570
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8671

8772

8873
@rem Execute Gradle
89-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
9075

9176
:end
9277
@rem End local scope for the variables with windows NT shell

0 commit comments

Comments
 (0)