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
5
`java- library`
6
6
`maven- publish`
7
7
jacoco
8
- signing
9
- id(" org.sonarqube" ) version " 6.2.0.5505"
10
8
id(" org.cadixdev.licenser" ) version " 0.6.1"
11
9
id(" me.qoomon.git-versioning" ) version " 6.4.4"
12
- id(" io.freefair.lombok" ) version " 8.13.1 "
13
- id(" io.freefair.javadoc-links" ) version " 8.13.1 "
14
- id(" io.freefair.javadoc-utf-8" ) version " 8.13.1 "
15
- id(" io.freefair.maven-central.validate-poms" ) version " 8.13.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 "
16
14
id(" com.github.ben-manes.versions" ) version " 0.52.0"
17
15
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"
19
18
}
20
19
21
20
group = " io.github.1c-syntax"
22
21
gitVersioning.apply {
23
22
refs {
24
- considerTagsOnBranches = true
23
+ describeTagFirstParent = false
25
24
tag(" v(?<tagVersion>[0-9].*)" ) {
26
25
version = " \$ {ref.tagVersion}\$ {dirty}"
27
26
}
27
+
28
+ branch(" develop" ) {
29
+ version = " \$ {describe.tag.version.major}." +
30
+ " \$ {describe.tag.version.minor.next}.0." +
31
+ " \$ {describe.distance}-SNAPSHOT\$ {dirty}"
32
+ }
33
+
28
34
branch(" .+" ) {
29
35
version = " \$ {ref}-\$ {commit.short}\$ {dirty}"
30
36
}
@@ -34,7 +40,6 @@ gitVersioning.apply {
34
40
version = " \$ {commit.short}\$ {dirty}"
35
41
}
36
42
}
37
- val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType .TAG
38
43
39
44
repositories {
40
45
mavenLocal()
@@ -47,7 +52,7 @@ dependencies {
47
52
48
53
// прочее
49
54
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 " )
51
56
52
57
// тестирование
53
58
testImplementation(" org.junit.jupiter" , " junit-jupiter-api" , " 5.11.4" )
@@ -122,39 +127,16 @@ license {
122
127
exclude(" **/*.xml" )
123
128
}
124
129
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
-
134
130
publishing {
135
131
repositories {
136
132
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()
150
135
}
151
136
}
152
137
publications {
153
138
create<MavenPublication >(" maven" ) {
154
139
from(components[" java" ])
155
- if (isSnapshot && project.hasProperty(" simplifyVersion" )) {
156
- version = findProperty(" git.ref.slug" ) as String + " -SNAPSHOT"
157
- }
158
140
pom {
159
141
description.set(" Support configuration read library for Language 1C (BSL)" )
160
142
url.set(" https://github.com/1c-syntax/supportconf" )
@@ -188,6 +170,16 @@ publishing {
188
170
developerConnection.set(" scm:git:git@github.com:1c-syntax/supportconf.git" )
189
171
url.set(" https://github.com/1c-syntax/supportconf" )
190
172
}
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
+ }
191
183
}
192
184
}
193
185
}
@@ -205,7 +197,31 @@ tasks.withType<Javadoc> {
205
197
.addStringOption(" Xdoclint:none" , " -quiet" )
206
198
}
207
199
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
+ }
211
227
}
0 commit comments