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`
8+ idea
99 antlr
10- signing
11- id(" org.sonarqube" ) version " 6.0.1.5171"
1210 id(" org.cadixdev.licenser" ) version " 0.6.1"
1311 id(" me.qoomon.git-versioning" ) version " 6.4.4"
14- id(" io.freefair.javadoc-links" ) version " 8.12.1"
15- id(" io.freefair.javadoc-utf-8" ) version " 8.12.1"
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.gradle.jmh" ) version " 0.5.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.gradle.jmh" ) version " 0.5.3"
2120}
2221
2322repositories {
2423 mavenLocal()
2524 mavenCentral()
26- maven(url = " https://s01.oss.sonatype.org/content/repositories/snapshots" )
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,18 +47,17 @@ gitVersioning.apply {
4247 version = " \$ {commit.short}\$ {dirty}"
4348 }
4449}
45- val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType .TAG
4650
4751dependencies {
48- antlr(" io.github.1c-syntax" , " antlr4" , " 0.1.1 " )
52+ antlr(" io.github.1c-syntax" , " antlr4" , " 0.1.2 " )
4953
50- implementation(" io.github.1c-syntax" , " bsl-parser-core" , " 0.3.0 " )
54+ implementation(" io.github.1c-syntax" , " bsl-parser-core" , " 0.3.1 " )
5155
5256 // stat analysis
5357 compileOnly(" com.github.spotbugs" , " spotbugs-annotations" , " 4.8.6" )
5458
5559 // testing
56- testImplementation(" io.github.1c-syntax" , " bsl-parser-testing" , " 0.3.0 " )
60+ testImplementation(" io.github.1c-syntax" , " bsl-parser-testing" , " 0.3.1 " )
5761 testImplementation(" org.junit.jupiter" , " junit-jupiter-api" , " 5.11.4" )
5862 testImplementation(" org.junit.jupiter" , " junit-jupiter-engine" , " 5.11.4" )
5963 testImplementation(" org.junit.jupiter" , " junit-jupiter-params" , " 5.11.4" )
@@ -199,39 +203,16 @@ artifacts {
199203 archives(tasks[" javadocJar" ])
200204}
201205
202- signing {
203- val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey
204- val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword
205- if (signingInMemoryKey != null ) {
206- useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword)
207- sign(publishing.publications)
208- }
209- }
210-
211206publishing {
212207 repositories {
213208 maven {
214- name = " sonatype"
215- url = if (isSnapshot)
216- uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
217- else
218- uri(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" )
219-
220- val sonatypeUsername: String? by project
221- val sonatypePassword: String? by project
222-
223- credentials {
224- username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername
225- password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword
226- }
209+ name = " staging"
210+ url = layout.buildDirectory.dir(" staging-deploy" ).get().asFile.toURI()
227211 }
228212 }
229213 publications {
230214 create<MavenPublication >(" maven" ) {
231215 from(components[" java" ])
232- if (isSnapshot && project.hasProperty(" simplifyVersion" )) {
233- version = findProperty(" git.ref.slug" ) as String + " -SNAPSHOT"
234- }
235216
236217 pom {
237218 description.set(" Collection of parsers for Language 1C (BSL) in ANTLR4 format." )
@@ -282,12 +263,44 @@ publishing {
282263 developerConnection.set(
" scm:git:[email protected] :1c-syntax/bsl-parser.git" )
283264 url.set(" https://github.com/1c-syntax/bsl-parser" )
284265 }
266+ issueManagement {
267+ system.set(" GitHub Issues" )
268+ url.set(" https://github.com/1c-syntax/bsl-parser/issues" )
269+ }
270+ ciManagement {
271+ system.set(" GitHub Actions" )
272+ url.set(" https://github.com/1c-syntax/bsl-parser/actions" )
273+ }
285274 }
286275 }
287276 }
288277}
289278
290- nexusStaging {
291- serverUrl = " https://s01.oss.sonatype.org/service/local/"
292- stagingProfileId = " 15bd88b4d17915" // ./gradlew getStagingProfile
279+ jreleaser {
280+ signing {
281+ active = ALWAYS
282+ armored = true
283+ }
284+ deploy {
285+ maven {
286+ mavenCentral {
287+ create(" release-deploy" ) {
288+ active = RELEASE
289+ url = " https://central.sonatype.com/api/v1/publisher"
290+ stagingRepository(" build/staging-deploy" )
291+ }
292+ }
293+ nexus2 {
294+ create(" snapshot-deploy" ) {
295+ active = SNAPSHOT
296+ snapshotUrl = " https://central.sonatype.com/repository/maven-snapshots/"
297+ applyMavenCentralRules = true
298+ snapshotSupported = true
299+ closeRepository = true
300+ releaseRepository = true
301+ stagingRepository(" build/staging-deploy" )
302+ }
303+ }
304+ }
305+ }
293306}
0 commit comments