1- import me.qoomon.gitversioning.commons.GitRefType
2- import java.util .*
1+ import java.util.Calendar
2+ import org.jreleaser.model.Active .*
33
44plugins {
5+ `java- library`
56 `maven- publish`
6- idea
77 jacoco
8- `java- library`
9- signing
10- id(" org.sonarqube" ) version " 6.2.0.5505"
8+ idea
119 id(" org.cadixdev.licenser" ) version " 0.6.1"
1210 id(" me.qoomon.git-versioning" ) version " 6.4.4"
13- id(" io.freefair.lombok" ) version " 8.12.1"
14- id(" io.freefair.javadoc-links" ) version " 8.12.1"
15- id(" io.freefair.javadoc-utf-8" ) version " 8.12.1"
11+ id(" io.freefair.lombok" ) version " 8.14.2"
12+ id(" io.freefair.javadoc-links" ) version " 8.14.2"
13+ id(" io.freefair.javadoc-utf-8" ) version " 8.14.2"
14+ id(" io.freefair.maven-central.validate-poms" ) version " 8.14.2"
1615 id(" com.github.ben-manes.versions" ) version " 0.52.0"
17- id(" me.champeau.jmh" ) version " 0.7.3"
18- id(" io.freefair.maven-central.validate-poms" ) version " 8.12.1"
1916 id(" ru.vyarus.pom" ) version " 3.0.0"
20- id(" io.codearte.nexus-staging" ) version " 0.30.0"
17+ id(" org.jreleaser" ) version " 1.19.0"
18+ id(" org.sonarqube" ) version " 6.2.0.5505"
19+ id(" me.champeau.jmh" ) version " 0.7.3"
2120}
2221
2322repositories {
2423 mavenLocal()
2524 mavenCentral()
26- maven(url = " https://jitpack.io" )
2725}
2826
2927group = " io.github.1c-syntax"
3028gitVersioning.apply {
3129 refs {
32- considerTagsOnBranches = true
30+ describeTagFirstParent = false
3331 tag(" v(?<tagVersion>[0-9].*)" ) {
3432 version = " \$ {ref.tagVersion}\$ {dirty}"
3533 }
34+
35+ branch(" develop" ) {
36+ version = " \$ {describe.tag.version.major}." +
37+ " \$ {describe.tag.version.minor.next}.0." +
38+ " \$ {describe.distance}-SNAPSHOT\$ {dirty}"
39+ }
40+
3641 branch(" .+" ) {
3742 version = " \$ {ref}-\$ {commit.short}\$ {dirty}"
3843 }
@@ -42,11 +47,10 @@ gitVersioning.apply {
4247 version = " \$ {commit.short}\$ {dirty}"
4348 }
4449}
45- val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType .TAG
4650
4751dependencies {
48- implementation(" io.github.1c-syntax" , " bsl-parser-core" , " 0.3.0 " )
49- implementation(" io.github.1c-syntax" , " antlr4" , " 0.1.1 " )
52+ implementation(" io.github.1c-syntax" , " bsl-parser-core" , " 0.3.1 " )
53+ implementation(" io.github.1c-syntax" , " antlr4" , " 0.1.2 " )
5054 implementation(" commons-io" , " commons-io" , " 2.15.1" )
5155 implementation(" org.junit.jupiter" , " junit-jupiter-api" , " 5.10.1" )
5256 implementation(" org.assertj" , " assertj-core" , " 3.25.0" )
@@ -123,39 +127,16 @@ artifacts {
123127 archives(tasks[" javadocJar" ])
124128}
125129
126- signing {
127- val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey
128- val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword
129- if (signingInMemoryKey != null ) {
130- useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword)
131- sign(publishing.publications)
132- }
133- }
134-
135130publishing {
136131 repositories {
137132 maven {
138- name = " sonatype"
139- url = if (isSnapshot)
140- uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
141- else
142- uri(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" )
143-
144- val sonatypeUsername: String? by project
145- val sonatypePassword: String? by project
146-
147- credentials {
148- username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername
149- password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword
150- }
133+ name = " staging"
134+ url = layout.buildDirectory.dir(" staging-deploy" ).get().asFile.toURI()
151135 }
152136 }
153137 publications {
154138 create<MavenPublication >(" maven" ) {
155139 from(components[" java" ])
156- if (isSnapshot && project.hasProperty(" simplifyVersion" )) {
157- version = findProperty(" git.ref.slug" ) as String + " -SNAPSHOT"
158- }
159140
160141 pom {
161142 description.set(" Library for testing parsers for Language 1C (BSL) in ANTLR4 format." )
@@ -182,12 +163,44 @@ publishing {
182163 developerConnection.set(
" scm:git:[email protected] :1c-syntax/bsl-parser-testing.git" )
183164 url.set(" https://github.com/1c-syntax/bsl-parser-testing" )
184165 }
166+ issueManagement {
167+ system.set(" GitHub Issues" )
168+ url.set(" https://github.com/1c-syntax/bsl-parser-testing/issues" )
169+ }
170+ ciManagement {
171+ system.set(" GitHub Actions" )
172+ url.set(" https://github.com/1c-syntax/bsl-parser-testing/actions" )
173+ }
185174 }
186175 }
187176 }
188177}
189178
190- nexusStaging {
191- serverUrl = " https://s01.oss.sonatype.org/service/local/"
192- stagingProfileId = " 15bd88b4d17915" // ./gradlew getStagingProfile
179+ jreleaser {
180+ signing {
181+ active = ALWAYS
182+ armored = true
183+ }
184+ deploy {
185+ maven {
186+ mavenCentral {
187+ create(" release-deploy" ) {
188+ active = RELEASE
189+ url = " https://central.sonatype.com/api/v1/publisher"
190+ stagingRepository(" build/staging-deploy" )
191+ }
192+ }
193+ nexus2 {
194+ create(" snapshot-deploy" ) {
195+ active = SNAPSHOT
196+ snapshotUrl = " https://central.sonatype.com/repository/maven-snapshots/"
197+ applyMavenCentralRules = true
198+ snapshotSupported = true
199+ closeRepository = true
200+ releaseRepository = true
201+ stagingRepository(" build/staging-deploy" )
202+ }
203+ }
204+ }
205+ }
193206}
0 commit comments