-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
70 lines (65 loc) · 1.85 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
plugins {
id "org.dmfs.gver" version "0.18.0"
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' apply false
}
gver {
issueTracker GitHub {
repo = "dmfs/gver"
if (project.hasProperty("GITHUB_API_TOKEN")) {
accessToken = GITHUB_API_TOKEN
}
}
changes {
are none when {
affects only(matches(~/.*\.md/))
}
are major when {
commitMessage contains("(?i)#major\\b")
}
are major when {
commitMessage contains("(?i)#break\\b")
}
are minor when {
commitMessage contains(~/(?i)#(?<issue>\d+)\b/) {
where("issue") { isIssue { labeled "enhancement" } }
}
}
are patch when {
commitMessage contains(~/(?i)#(?<issue>\d+)\b/) {
where("issue") { isIssue { labeled "bug" } }
}
}
are minor when {
commitMessage contains("#feature\\b")
}
}
releaseBranchPattern ~/main$/
}
if (project.hasProperty('SONATYPE_USERNAME') && project.hasProperty('SONATYPE_PASSWORD')) {
apply plugin: 'io.github.gradle-nexus.publish-plugin'
nexusPublishing {
repositories {
sonatype {
username = SONATYPE_USERNAME
password = SONATYPE_PASSWORD
}
}
}
}
allprojects {
group 'org.dmfs'
repositories {
mavenCentral()
}
}
gradle.taskGraph.whenReady {
tasks.withType(PublishToMavenRepository) { PublishToMavenRepository t ->
if ( t.repository == null ) {
logger.info( "Task `{}` had null repository", t.path )
}
else if ( t.repository.name == "sonatype" ) {
logger.lifecycle( "Disabling task `{}` because it publishes to Sonatype", t.path )
t.enabled = false
}
}
}