1- import me.qoomon.gitversioning.commons.GitRefType
2- import java.util .*
1+ import java.util.Calendar
2+ import org.jreleaser.model.Active .*
33
44plugins {
55 `java- library`
66 `maven- publish`
77 jacoco
8- signing
9- id(" org.sonarqube" ) version " 6.0.1.5171"
108 id(" org.cadixdev.licenser" ) version " 0.6.1"
119 id(" me.qoomon.git-versioning" ) version " 6.4.4"
12- id(" io.freefair.lombok" ) version " 8.12.1 "
13- id(" io.freefair.javadoc-links" ) version " 8.12.1 "
14- id(" io.freefair.javadoc-utf-8" ) version " 8.12.1 "
15- id(" io.freefair.maven-central.validate-poms" ) version " 8.12.1 "
10+ id(" io.freefair.lombok" ) version " 8.14.2 "
11+ id(" io.freefair.javadoc-links" ) version " 8.14.2 "
12+ id(" io.freefair.javadoc-utf-8" ) version " 8.14.2 "
13+ id(" io.freefair.maven-central.validate-poms" ) version " 8.14.2 "
1614 id(" com.github.ben-manes.versions" ) version " 0.52.0"
1715 id(" ru.vyarus.pom" ) version " 3.0.0"
18- id(" io.codearte.nexus-staging" ) version " 0.30.0"
16+ id(" org.jreleaser" ) version " 1.19.0"
17+ id(" org.sonarqube" ) version " 6.2.0.5505"
1918}
2019
2120group = " io.github.1c-syntax"
2221gitVersioning.apply {
2322 refs {
24- considerTagsOnBranches = true
23+ describeTagFirstParent = false
2524 tag(" v(?<tagVersion>[0-9].*)" ) {
2625 version = " \$ {ref.tagVersion}\$ {dirty}"
2726 }
27+
28+ branch(" develop" ) {
29+ version = " \$ {describe.tag.version.major}." +
30+ " \$ {describe.tag.version.minor.next}.0." +
31+ " \$ {describe.distance}-SNAPSHOT\$ {dirty}"
32+ }
33+
2834 branch(" .+" ) {
2935 version = " \$ {ref}-\$ {commit.short}\$ {dirty}"
3036 }
@@ -34,7 +40,6 @@ gitVersioning.apply {
3440 version = " \$ {commit.short}\$ {dirty}"
3541 }
3642}
37- val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType .TAG
3843
3944repositories {
4045 mavenLocal()
@@ -47,7 +52,7 @@ dependencies {
4752
4853 // прочее
4954 implementation(" commons-io" , " commons-io" , " 2.18.0" )
50- api(" io.github.1c-syntax" , " bsl-common-library" , " 0.8.0 " )
55+ api(" io.github.1c-syntax" , " bsl-common-library" , " 0.8.1 " )
5156
5257 // тестирование
5358 testImplementation(" org.junit.jupiter" , " junit-jupiter-api" , " 5.11.4" )
@@ -122,39 +127,16 @@ license {
122127 exclude(" **/*.xml" )
123128}
124129
125- signing {
126- val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey
127- val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword
128- if (signingInMemoryKey != null ) {
129- useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword)
130- sign(publishing.publications)
131- }
132- }
133-
134130publishing {
135131 repositories {
136132 maven {
137- name = " sonatype"
138- url = if (isSnapshot)
139- uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
140- else
141- uri(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" )
142-
143- val sonatypeUsername: String? by project
144- val sonatypePassword: String? by project
145-
146- credentials {
147- username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername
148- password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword
149- }
133+ name = " staging"
134+ url = layout.buildDirectory.dir(" staging-deploy" ).get().asFile.toURI()
150135 }
151136 }
152137 publications {
153138 create<MavenPublication >(" maven" ) {
154139 from(components[" java" ])
155- if (isSnapshot && project.hasProperty(" simplifyVersion" )) {
156- version = findProperty(" git.ref.slug" ) as String + " -SNAPSHOT"
157- }
158140 pom {
159141 description.set(" Support configuration read library for Language 1C (BSL)" )
160142 url.set(" https://github.com/1c-syntax/supportconf" )
@@ -188,6 +170,16 @@ publishing {
188170 developerConnection.set(
" scm:git:[email protected] :1c-syntax/supportconf.git" )
189171 url.set(" https://github.com/1c-syntax/supportconf" )
190172 }
173+ // Добавлено для Maven Central validation
174+ issueManagement {
175+ system.set(" GitHub Issues" )
176+ url.set(" https://github.com/1c-syntax/supportconf/issues" )
177+ }
178+ // Добавлено для Maven Central validation
179+ ciManagement {
180+ system.set(" GitHub Actions" )
181+ url.set(" https://github.com/1c-syntax/supportconf/actions" )
182+ }
191183 }
192184 }
193185 }
@@ -205,7 +197,31 @@ tasks.withType<Javadoc> {
205197 .addStringOption(" Xdoclint:none" , " -quiet" )
206198}
207199
208- nexusStaging {
209- serverUrl = " https://s01.oss.sonatype.org/service/local/"
210- stagingProfileId = " 15bd88b4d17915" // ./gradlew getStagingProfile
200+ jreleaser {
201+ signing {
202+ active = ALWAYS
203+ armored = true
204+ }
205+ deploy {
206+ maven {
207+ mavenCentral {
208+ create(" release-deploy" ) {
209+ active = RELEASE
210+ url = " https://central.sonatype.com/api/v1/publisher"
211+ stagingRepository(" build/staging-deploy" )
212+ }
213+ }
214+ nexus2 {
215+ create(" snapshot-deploy" ) {
216+ active = SNAPSHOT
217+ snapshotUrl = " https://central.sonatype.com/repository/maven-snapshots/"
218+ applyMavenCentralRules = true
219+ snapshotSupported = true
220+ closeRepository = true
221+ releaseRepository = true
222+ stagingRepository(" build/staging-deploy" )
223+ }
224+ }
225+ }
226+ }
211227}
0 commit comments