Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit 49eb8ce

Browse files
Issue 54138: Update versioning plugin to latest Gradle version (#7)
1 parent 9b289a3 commit 49eb8ce

File tree

6 files changed

+63
-59
lines changed

6 files changed

+63
-59
lines changed

build.gradle

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,23 @@ buildscript {
33
mavenCentral()
44
}
55
dependencies {
6-
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.32.0"
6+
classpath "org.ajoberstar.grgit:grgit-gradle:${grgitGradleVersion}"
77
}
88
}
99

10-
apply plugin: 'groovy'
11-
apply plugin: 'maven-publish'
12-
13-
ext {
14-
jgitVersion = '5.6.0.201912101111-r'
10+
plugins {
11+
id 'groovy'
12+
id 'java-library'
13+
id "com.jfrog.artifactory" version "${artifactoryPluginVersion}" apply false
14+
id "org.ajoberstar.grgit" version "${grgitGradleVersion}" apply false
15+
id "maven-publish"
16+
id 'java-gradle-plugin'
1517
}
1618

1719
repositories {
20+
maven {
21+
url = uri("https://plugins.gradle.org/m2/")
22+
}
1823
mavenCentral()
1924
}
2025

@@ -24,59 +29,54 @@ dependencies {
2429
implementation 'org.ajoberstar.grgit:grgit-core:4.1.1'
2530
implementation "org.eclipse.jgit:org.eclipse.jgit.ui:${jgitVersion}"
2631
implementation "org.eclipse.jgit:org.eclipse.jgit:${jgitVersion}"
27-
implementation 'org.tmatesoft.svnkit:svnkit:1.8.12'
28-
testImplementation "junit:junit:4.12"
32+
implementation 'org.tmatesoft.svnkit:svnkit:1.10.6'
33+
testImplementation "junit:junit:4.13.2"
2934
testImplementation "commons-lang:commons-lang:2.6"
30-
testImplementation "commons-io:commons-io:2.5"
35+
testImplementation "commons-io:commons-io:2.11.0"
3136
}
3237

33-
project.version = "1.1.2-SNAPSHOT"
38+
group = 'org.labkey.build'
39+
project.version = "1.1.4-SNAPSHOT"
3440

35-
/**
36-
* Plug-in publication
37-
*/
38-
publishing {
39-
publications {
40-
mavenJava (MavenPublication) {
41-
groupId 'org.labkey.build'
42-
artifactId 'versioning'
43-
from components.java
41+
gradlePlugin {
42+
plugins {
43+
versioning {
44+
id = "org.labkey.build"
45+
displayName = "Versioning plugin for Gradle"
46+
description = "Gradle plug-in that computes version information from the SCM"
47+
implementationClass = "net.nemerosa.versioning.VersioningPlugin"
4448
}
4549
}
4650
}
4751

48-
if (project.hasProperty('doPublishing') && project.hasProperty('artifactory_contextUrl') && project.hasProperty('artifactory_user') && project.hasProperty('artifactory_password'))
49-
{
50-
apply plugin: 'com.jfrog.artifactory'
51-
artifactory {
52-
contextUrl = "${artifactory_contextUrl}"
53-
publish {
54-
repository {
55-
repoKey = project.version.endsWith('-SNAPSHOT') ? 'plugins-snapshot-local' : "plugins-release-local"
56-
username = "${artifactory_user}"
57-
password = "${artifactory_password}"
58-
maven = true
52+
publishing {
53+
repositories {
54+
if (project.version.contains("SNAPSHOT")) {
55+
maven {
56+
url = "${artifactory_contextUrl}/plugins-snapshot-local"
57+
credentials {
58+
username = artifactory_user
59+
password = artifactory_password
60+
}
61+
authentication {
62+
basic(BasicAuthentication)
63+
// enable preemptive authentication to get around https://www.jfrog.com/jira/browse/RTFACT-4434
64+
}
5965
}
60-
defaults {
61-
publications ('mavenJava')
62-
publishPom = true
63-
publishIvy = false
64-
}
65-
}
66-
resolve {
67-
repository {
68-
repoKey = project.version.endsWith('-SNAPSHOT') ? 'plugins-snapshot-local' : "plugins-release"
66+
} else {
67+
maven {
68+
url = "${artifactory_contextUrl}/plugins-release"
69+
credentials {
70+
username = artifactory_user
71+
password = artifactory_password
72+
}
73+
authentication {
74+
basic(BasicAuthentication)
75+
// enable preemptive authentication to get around https://www.jfrog.com/jira/browse/RTFACT-4434
76+
}
6977
}
78+
7079
}
7180
}
7281
}
7382

74-
test {
75-
ignoreFailures = true
76-
77-
//Skips all tests
78-
exclude "**/*.class"
79-
80-
environment "GIT_TEST_BRANCH", "feature/456-cute"
81-
environment "SVN_TEST_BRANCH", "feature-456-cute"
82-
}

gradle.properties

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# the URL for the artifact repository where our build plugins are housed
22
# as well as the build artifacts. (Be careful not to include a trailing slash
33
# in the context URL or you will get a 500 error from artifactory.)
4-
artifactory_contextUrl=https://artifactory.labkey.com/artifactory
5-
# Placeholders for Bintray credentials
6-
bintrayUser =
7-
bintrayApiKey =
4+
artifactory_contextUrl=https://labkey.jfrog.io/artifactory
85

96
sourceCompatibility=8
107
targetCompatibility=8
8+
9+
artifactoryPluginVersion=6.0.0
10+
11+
grgitGradleVersion=5.3.2
12+
13+
jgitVersion = 6.1.0.202203080745-r

gradle/wrapper/gradle-wrapper.jar

502 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

gradlew

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ done
8585
APP_BASE_NAME=${0##*/}
8686
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90-
9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
9390

@@ -144,15 +141,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144141
case $MAX_FD in #(
145142
max*)
146143
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
144+
# shellcheck disable=SC3045
148145
MAX_FD=$( ulimit -H -n ) ||
149146
warn "Could not query maximum file descriptor limit"
150147
esac
151148
case $MAX_FD in #(
152149
'' | soft) :;; #(
153150
*)
154151
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
152+
# shellcheck disable=SC3045
156153
ulimit -n "$MAX_FD" ||
157154
warn "Could not set maximum file descriptor limit to $MAX_FD"
158155
esac
@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
197194
done
198195
fi
199196

197+
198+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200+
200201
# Collect all arguments for the java command;
201202
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202203
# shell script including quotes and variable substitutions, so put them in

src/main/groovy/net/nemerosa/versioning/VersioningExtension.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ class VersioningExtension {
313313
throw new DirtyException()
314314
} else {
315315
if (!noWarningOnDirty) {
316-
project.getLogger().warn("[versioning] WARNING - the working copy has unstaged or uncommitted changes.")
316+
project.getLogger().warn("[versioning] WARNING - the working copy for ${project.path} has unstaged or uncommitted changes.")
317317
}
318318
versionDisplay = dirty(versionDisplay)
319319
versionFull = dirty(versionFull)

0 commit comments

Comments
 (0)