@@ -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
1719repositories {
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- }
0 commit comments