Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #193 from shazam/update-gradle-wrapper-to-7-4-2
Browse files Browse the repository at this point in the history
Update Gradle wrapper to 7.4.2
  • Loading branch information
AndreiZaitcev authored Apr 14, 2022
2 parents 2a96ef0 + ecf1a20 commit c4487ce
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 84 deletions.
109 changes: 48 additions & 61 deletions build-scripts/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'

def isReleaseBuild() {
Expand All @@ -23,79 +23,66 @@ def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME
java {
withJavadocJar()
withSourcesJar()
}

repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
afterEvaluate {
publishing {
repositories {
maven {
def releaseRepositoryUrl = getReleaseRepositoryUrl()
def snapshotRepositoryUrl = getSnapshotRepositoryUrl()
url = isReleaseBuild() ? releaseRepositoryUrl : snapshotRepositoryUrl
credentials {
username = getRepositoryUsername()
password = getRepositoryPassword()
}
}
}

snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
publications {
release(MavenPublication) {
groupId = GROUP
artifactId = POM_ARTIFACT_ID
version = VERSION_NAME

pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL
from(project.components.java)

scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}
pom {
name = POM_NAME
packaging = POM_PACKAGING
description = POM_DESCRIPTION
url = POM_URL

licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
scm {
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}
}

developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
distribution = POM_LICENCE_DIST
}
}

developers {
developer {
id = POM_DEVELOPER_ID
name = POM_DEVELOPER_NAME
}
}
}
}
}
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar
}

install {
repositories {
mavenInstaller {
pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME
}
signing {
required { isReleaseBuild() }
sign publishing.publications.release
}
}
3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ subprojects {
jacocoTestReport.dependsOn test
jacocoTestReport.reports.html.enabled false
jacocoTestReport.reports.xml.enabled true

// Weirdly archives are signed even if signing.required {false}, so also skipping task explicitly.
signArchives.onlyIf { !VERSION_NAME.endsWith("SNAPSHOT") }
}
}

Expand Down
13 changes: 13 additions & 0 deletions fork-reporter-jenkins-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@ dependencies {
"com.offbytwo.jenkins:jenkins-client:0.3.4",
"org.apache.commons:commons-lang3:$commonsLangVersion")
}

// favour publication configured by `gradle-mvn-push.gradle`
tasks.withType(PublishToMavenRepository).configureEach {
if (name.contains("PluginMaven")) {
enabled = false
}
}

tasks.withType(PublishToMavenLocal).configureEach {
if (name.contains("PluginMaven")) {
enabled = false
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

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

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

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

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

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

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


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

:end
@rem End local scope for the variables with windows NT shell
Expand Down

0 comments on commit c4487ce

Please sign in to comment.