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
8
id(" org.cadixdev.licenser" ) version " 0.6.1"
10
9
id(" me.qoomon.git-versioning" ) version " 6.4.4"
11
- id(" com.gorylenko.gradle-git-properties " ) version " 2.5.0 "
12
- id(" io.freefair.lombok " ) version " 8.14"
13
- id(" io.freefair.javadoc-links " ) version " 8.14"
14
- id(" io.freefair.javadoc-utf-8 " ) version " 8.14"
15
- id(" io.freefair.maven-central.validate-poms " ) version " 8.14 "
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 "
14
+ id(" com.github.ben-manes.versions " ) version " 0.52.0 "
16
15
id(" ru.vyarus.pom" ) version " 3.0.0"
16
+ id(" org.jreleaser" ) version " 1.19.0"
17
17
id(" org.sonarqube" ) version " 6.2.0.5505"
18
- id(" io.codearte.nexus-staging" ) version " 0.30.0"
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,12 +40,10 @@ 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()
41
46
mavenCentral()
42
- maven(url = " https://s01.oss.sonatype.org/content/repositories/snapshots/" )
43
47
}
44
48
45
49
dependencies {
@@ -53,9 +57,9 @@ dependencies {
53
57
54
58
// прочее
55
59
implementation(" commons-io" , " commons-io" , " 2.18.0" )
56
- implementation(" io.github.1c-syntax" , " utils" , " 0.6.2 " )
57
- implementation(" io.github.1c-syntax" , " bsl-common-library" , " 0.8.0 " )
58
- implementation(" io.github.1c-syntax" , " supportconf" , " 0.14.2 " )
60
+ implementation(" io.github.1c-syntax" , " utils" , " 0.6.3 " )
61
+ implementation(" io.github.1c-syntax" , " bsl-common-library" , " 0.8.1 " )
62
+ implementation(" io.github.1c-syntax" , " supportconf" , " 0.14.3 " )
59
63
60
64
// быстрый поиск классов
61
65
implementation(" io.github.classgraph" , " classgraph" , " 4.8.179" )
@@ -105,7 +109,7 @@ tasks.check {
105
109
tasks.jacocoTestReport {
106
110
reports {
107
111
xml.required.set(true )
108
- xml.outputLocation.set(File ( " $buildDir / reports/jacoco/test/jacoco.xml" ))
112
+ xml.outputLocation.set(layout.buildDirectory.file( " reports/jacoco/test/jacoco.xml" ))
109
113
}
110
114
}
111
115
@@ -134,7 +138,7 @@ sonar {
134
138
property(" sonar.projectKey" , " 1c-syntax_mdclasses" )
135
139
property(" sonar.projectName" , " MDClasses" )
136
140
property(" sonar.exclusions" , " **/resources/**/*.*" )
137
- property(" sonar.coverage.jacoco.xmlReportPaths" , " $buildDir /reports/jacoco/test/jacoco.xml" )
141
+ property(" sonar.coverage.jacoco.xmlReportPaths" , " ${layout.buildDirectory.get()} /reports/jacoco/test/jacoco.xml" )
138
142
}
139
143
}
140
144
@@ -161,41 +165,18 @@ license {
161
165
exclude(" **/*.orig" )
162
166
}
163
167
164
- signing {
165
- val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey
166
- val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword
167
- if (signingInMemoryKey != null ) {
168
- useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword)
169
- sign(publishing.publications)
170
- }
171
- }
172
168
173
169
publishing {
174
170
repositories {
175
171
maven {
176
- name = " sonatype"
177
- url = if (isSnapshot)
178
- uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
179
- else
180
- uri(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" )
181
-
182
- val sonatypeUsername: String? by project
183
- val sonatypePassword: String? by project
184
-
185
- credentials {
186
- username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername
187
- password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword
188
- }
172
+ name = " staging"
173
+ url = layout.buildDirectory.dir(" staging-deploy" ).get().asFile.toURI()
189
174
}
190
175
}
191
176
publications {
192
177
create<MavenPublication >(" maven" ) {
193
178
from(components[" java" ])
194
179
195
- if (isSnapshot && project.hasProperty(" simplifyVersion" )) {
196
- version = findProperty(" git.ref.slug" ) as String + " -SNAPSHOT"
197
- }
198
-
199
180
pom {
200
181
description.set(" Metadata read/write library for Language 1C (BSL)" )
201
182
url.set(" https://github.com/1c-syntax/mdclasses" )
@@ -229,19 +210,53 @@ publishing {
229
210
developerConnection.set(
" scm:git:[email protected] :1c-syntax/mdclasses.git" )
230
211
url.set(" https://github.com/1c-syntax/mdclasses" )
231
212
}
213
+ // Добавлено для Maven Central validation
214
+ issueManagement {
215
+ system.set(" GitHub Issues" )
216
+ url.set(" https://github.com/1c-syntax/mdclasses/issues" )
217
+ }
218
+ // Добавлено для Maven Central validation
219
+ ciManagement {
220
+ system.set(" GitHub Actions" )
221
+ url.set(" https://github.com/1c-syntax/mdclasses/actions" )
222
+ }
232
223
}
233
224
}
234
225
}
235
226
}
236
227
237
- nexusStaging {
238
- serverUrl = " https://s01.oss.sonatype.org/service/local/"
239
- stagingProfileId = " 15bd88b4d17915" // ./gradlew getStagingProfile
240
- }
241
-
242
228
tasks.register(" precommit" ) {
243
229
description = " Run all precommit tasks"
244
230
group = " Developer tools"
245
231
dependsOn(" :test" )
246
232
dependsOn(" :updateLicenses" )
247
233
}
234
+
235
+ jreleaser {
236
+ signing {
237
+ active = ALWAYS
238
+ armored = true
239
+ }
240
+ deploy {
241
+ maven {
242
+ mavenCentral {
243
+ create(" release-deploy" ) {
244
+ active = RELEASE
245
+ url = " https://central.sonatype.com/api/v1/publisher"
246
+ stagingRepository(" build/staging-deploy" )
247
+ }
248
+ }
249
+ nexus2 {
250
+ create(" snapshot-deploy" ) {
251
+ active = SNAPSHOT
252
+ snapshotUrl = " https://central.sonatype.com/repository/maven-snapshots/"
253
+ applyMavenCentralRules = true
254
+ snapshotSupported = true
255
+ closeRepository = true
256
+ releaseRepository = true
257
+ stagingRepository(" build/staging-deploy" )
258
+ }
259
+ }
260
+ }
261
+ }
262
+ }
0 commit comments