1
- import me.qoomon.gitversioning.commons.GitRefType
2
- import java.util .*
1
+ import java.util.Calendar
2
+ import org.jreleaser.model.Active .*
3
3
4
4
plugins {
5
+ `java- library`
5
6
`maven- publish`
6
- idea
7
7
jacoco
8
- `java- library`
9
- signing
10
- id(" org.sonarqube" ) version " 6.0.1.5171"
8
+ idea
11
9
id(" org.cadixdev.licenser" ) version " 0.6.1"
12
10
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"
15
15
id(" com.github.ben-manes.versions" ) version " 0.52.0"
16
- id(" io.freefair.maven-central.validate-poms" ) version " 8.12.1"
17
16
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"
19
19
}
20
20
21
21
repositories {
22
22
mavenLocal()
23
23
mavenCentral()
24
- maven(url = " https://s01.oss.sonatype.org/content/repositories/snapshots" )
25
24
}
26
25
27
26
group = " io.github.1c-syntax"
28
27
gitVersioning.apply {
29
28
refs {
30
- considerTagsOnBranches = true
29
+ describeTagFirstParent = false
31
30
tag(" v(?<tagVersion>[0-9].*)" ) {
32
31
version = " \$ {ref.tagVersion}\$ {dirty}"
33
32
}
33
+
34
+ branch(" develop" ) {
35
+ version = " \$ {describe.tag.version.major}." +
36
+ " \$ {describe.tag.version.minor.next}.0." +
37
+ " \$ {describe.distance}-SNAPSHOT\$ {dirty}"
38
+ }
39
+
34
40
branch(" .+" ) {
35
41
version = " \$ {ref}-\$ {commit.short}\$ {dirty}"
36
42
}
@@ -40,11 +46,10 @@ gitVersioning.apply {
40
46
version = " \$ {commit.short}\$ {dirty}"
41
47
}
42
48
}
43
- val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType .TAG
44
49
45
50
dependencies {
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 " )
48
53
implementation(" commons-io" , " commons-io" , " 2.15.1" )
49
54
}
50
55
@@ -118,39 +123,16 @@ artifacts {
118
123
archives(tasks[" javadocJar" ])
119
124
}
120
125
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
-
130
126
publishing {
131
127
repositories {
132
128
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()
146
131
}
147
132
}
148
133
publications {
149
134
create<MavenPublication >(" maven" ) {
150
135
from(components[" java" ])
151
- if (isSnapshot && project.hasProperty(" simplifyVersion" )) {
152
- version = findProperty(" git.ref.slug" ) as String + " -SNAPSHOT"
153
- }
154
136
155
137
pom {
156
138
description.set(" Core library for Collection of parsers for Language 1C (BSL) in ANTLR4 format." )
@@ -193,12 +175,44 @@ publishing {
193
175
developerConnection.set(
" scm:git:[email protected] :1c-syntax/bsl-parser-core.git" )
194
176
url.set(" https://github.com/1c-syntax/bsl-parser-core" )
195
177
}
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
+ }
196
186
}
197
187
}
198
188
}
199
189
}
200
190
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
+ }
204
218
}
0 commit comments