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.0.1.5171"
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.javadoc-links" ) version " 8.12.1"
14- 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"
1515 id(" com.github.ben-manes.versions" ) version " 0.52.0"
16- id(" io.freefair.maven-central.validate-poms" ) version " 8.12.1"
1716 id(" ru.vyarus.pom" ) version " 3.0.0"
18- 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"
1919}
2020
2121repositories {
2222 mavenLocal()
2323 mavenCentral()
24- maven(url = " https://s01.oss.sonatype.org/content/repositories/snapshots" )
2524}
2625
2726group = " io.github.1c-syntax"
2827gitVersioning.apply {
2928 refs {
30- considerTagsOnBranches = true
29+ describeTagFirstParent = false
3130 tag(" v(?<tagVersion>[0-9].*)" ) {
3231 version = " \$ {ref.tagVersion}\$ {dirty}"
3332 }
33+
34+ branch(" develop" ) {
35+ version = " \$ {describe.tag.version.major}." +
36+ " \$ {describe.tag.version.minor.next}.0." +
37+ " \$ {describe.distance}-SNAPSHOT\$ {dirty}"
38+ }
39+
3440 branch(" .+" ) {
3541 version = " \$ {ref}-\$ {commit.short}\$ {dirty}"
3642 }
@@ -40,11 +46,10 @@ gitVersioning.apply {
4046 version = " \$ {commit.short}\$ {dirty}"
4147 }
4248}
43- val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType .TAG
4449
4550dependencies {
46- implementation(" io.github.1c-syntax" , " antlr4" , " 0.1.1 " )
47- implementation(" io.github.1c-syntax" , " utils" , " 0.6.2 " )
51+ implementation(" io.github.1c-syntax" , " antlr4" , " 0.1.2 " )
52+ implementation(" io.github.1c-syntax" , " utils" , " 0.6.3 " )
4853 implementation(" commons-io" , " commons-io" , " 2.15.1" )
4954}
5055
@@ -118,39 +123,16 @@ artifacts {
118123 archives(tasks[" javadocJar" ])
119124}
120125
121- signing {
122- val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey
123- val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword
124- if (signingInMemoryKey != null ) {
125- useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword)
126- sign(publishing.publications)
127- }
128- }
129-
130126publishing {
131127 repositories {
132128 maven {
133- name = " sonatype"
134- url = if (isSnapshot)
135- uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
136- else
137- uri(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" )
138-
139- val sonatypeUsername: String? by project
140- val sonatypePassword: String? by project
141-
142- credentials {
143- username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername
144- password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword
145- }
129+ name = " staging"
130+ url = layout.buildDirectory.dir(" staging-deploy" ).get().asFile.toURI()
146131 }
147132 }
148133 publications {
149134 create<MavenPublication >(" maven" ) {
150135 from(components[" java" ])
151- if (isSnapshot && project.hasProperty(" simplifyVersion" )) {
152- version = findProperty(" git.ref.slug" ) as String + " -SNAPSHOT"
153- }
154136
155137 pom {
156138 description.set(" Core library for Collection of parsers for Language 1C (BSL) in ANTLR4 format." )
@@ -193,12 +175,44 @@ publishing {
193175 developerConnection.set(
" scm:git:[email protected] :1c-syntax/bsl-parser-core.git" )
194176 url.set(" https://github.com/1c-syntax/bsl-parser-core" )
195177 }
178+ issueManagement {
179+ system.set(" GitHub Issues" )
180+ url.set(" https://github.com/1c-syntax/bsl-parser-core/issues" )
181+ }
182+ ciManagement {
183+ system.set(" GitHub Actions" )
184+ url.set(" https://github.com/1c-syntax/bsl-parser-core/actions" )
185+ }
196186 }
197187 }
198188 }
199189}
200190
201- nexusStaging {
202- serverUrl = " https://s01.oss.sonatype.org/service/local/"
203- stagingProfileId = " 15bd88b4d17915" // ./gradlew getStagingProfile
191+ jreleaser {
192+ signing {
193+ active = ALWAYS
194+ armored = true
195+ }
196+ deploy {
197+ maven {
198+ mavenCentral {
199+ create(" release-deploy" ) {
200+ active = RELEASE
201+ url = " https://central.sonatype.com/api/v1/publisher"
202+ stagingRepository(" build/staging-deploy" )
203+ }
204+ }
205+ nexus2 {
206+ create(" snapshot-deploy" ) {
207+ active = SNAPSHOT
208+ snapshotUrl = " https://central.sonatype.com/repository/maven-snapshots/"
209+ applyMavenCentralRules = true
210+ snapshotSupported = true
211+ closeRepository = true
212+ releaseRepository = true
213+ stagingRepository(" build/staging-deploy" )
214+ }
215+ }
216+ }
217+ }
204218}
0 commit comments