diff --git a/build.gradle b/build.gradle index 7039f5b..fe98aae 100644 --- a/build.gradle +++ b/build.gradle @@ -3,18 +3,23 @@ buildscript { mavenCentral() } dependencies { - classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.32.0" + classpath "org.ajoberstar.grgit:grgit-gradle:${grgitGradleVersion}" } } -apply plugin: 'groovy' -apply plugin: 'maven-publish' - -ext { - jgitVersion = '5.6.0.201912101111-r' +plugins { + id 'groovy' + id 'java-library' + id "com.jfrog.artifactory" version "${artifactoryPluginVersion}" apply false + id "org.ajoberstar.grgit" version "${grgitGradleVersion}" apply false + id "maven-publish" + id 'java-gradle-plugin' } repositories { + maven { + url = uri("https://plugins.gradle.org/m2/") + } mavenCentral() } @@ -24,59 +29,54 @@ dependencies { implementation 'org.ajoberstar.grgit:grgit-core:4.1.1' implementation "org.eclipse.jgit:org.eclipse.jgit.ui:${jgitVersion}" implementation "org.eclipse.jgit:org.eclipse.jgit:${jgitVersion}" - implementation 'org.tmatesoft.svnkit:svnkit:1.8.12' - testImplementation "junit:junit:4.12" + implementation 'org.tmatesoft.svnkit:svnkit:1.10.6' + testImplementation "junit:junit:4.13.2" testImplementation "commons-lang:commons-lang:2.6" - testImplementation "commons-io:commons-io:2.5" + testImplementation "commons-io:commons-io:2.11.0" } -project.version = "1.1.2-SNAPSHOT" +group = 'org.labkey.build' +project.version = "1.1.4-SNAPSHOT" -/** - * Plug-in publication - */ -publishing { - publications { - mavenJava (MavenPublication) { - groupId 'org.labkey.build' - artifactId 'versioning' - from components.java +gradlePlugin { + plugins { + versioning { + id = "org.labkey.build" + displayName = "Versioning plugin for Gradle" + description = "Gradle plug-in that computes version information from the SCM" + implementationClass = "net.nemerosa.versioning.VersioningPlugin" } } } -if (project.hasProperty('doPublishing') && project.hasProperty('artifactory_contextUrl') && project.hasProperty('artifactory_user') && project.hasProperty('artifactory_password')) -{ - apply plugin: 'com.jfrog.artifactory' - artifactory { - contextUrl = "${artifactory_contextUrl}" - publish { - repository { - repoKey = project.version.endsWith('-SNAPSHOT') ? 'plugins-snapshot-local' : "plugins-release-local" - username = "${artifactory_user}" - password = "${artifactory_password}" - maven = true +publishing { + repositories { + if (project.version.contains("SNAPSHOT")) { + maven { + url = "${artifactory_contextUrl}/plugins-snapshot-local" + credentials { + username = artifactory_user + password = artifactory_password + } + authentication { + basic(BasicAuthentication) + // enable preemptive authentication to get around https://www.jfrog.com/jira/browse/RTFACT-4434 + } } - defaults { - publications ('mavenJava') - publishPom = true - publishIvy = false - } - } - resolve { - repository { - repoKey = project.version.endsWith('-SNAPSHOT') ? 'plugins-snapshot-local' : "plugins-release" + } else { + maven { + url = "${artifactory_contextUrl}/plugins-release" + credentials { + username = artifactory_user + password = artifactory_password + } + authentication { + basic(BasicAuthentication) + // enable preemptive authentication to get around https://www.jfrog.com/jira/browse/RTFACT-4434 + } } + } } } -test { - ignoreFailures = true - - //Skips all tests - exclude "**/*.class" - - environment "GIT_TEST_BRANCH", "feature/456-cute" - environment "SVN_TEST_BRANCH", "feature-456-cute" -} diff --git a/gradle.properties b/gradle.properties index 501cec2..ab16e7f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,13 @@ # the URL for the artifact repository where our build plugins are housed # as well as the build artifacts. (Be careful not to include a trailing slash # in the context URL or you will get a 500 error from artifactory.) -artifactory_contextUrl=https://artifactory.labkey.com/artifactory -# Placeholders for Bintray credentials -bintrayUser = -bintrayApiKey = +artifactory_contextUrl=https://labkey.jfrog.io/artifactory sourceCompatibility=8 targetCompatibility=8 + +artifactoryPluginVersion=6.0.0 + +grgitGradleVersion=5.3.2 + +jgitVersion = 6.1.0.202203080745-r diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cb..c1962a7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d..ab521aa 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68..aeb74cb 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done 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"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +141,7 @@ 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=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +149,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | 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=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# 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, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/src/main/groovy/net/nemerosa/versioning/VersioningExtension.groovy b/src/main/groovy/net/nemerosa/versioning/VersioningExtension.groovy index 24da0f7..912eef3 100644 --- a/src/main/groovy/net/nemerosa/versioning/VersioningExtension.groovy +++ b/src/main/groovy/net/nemerosa/versioning/VersioningExtension.groovy @@ -313,7 +313,7 @@ class VersioningExtension { throw new DirtyException() } else { if (!noWarningOnDirty) { - project.getLogger().warn("[versioning] WARNING - the working copy has unstaged or uncommitted changes.") + project.getLogger().warn("[versioning] WARNING - the working copy for ${project.path} has unstaged or uncommitted changes.") } versionDisplay = dirty(versionDisplay) versionFull = dirty(versionFull)