-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.gradle
122 lines (106 loc) · 3.4 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
plugins {
id 'java-library'
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/oauth2-essentials"
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|break(ing)?)\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")
}
otherwise patch
}
preReleases {
on ~/main/ use { "beta" }
on ~/(.*\/)?(?<name>.*)/ use { "alpha-${group('name')}.1" }
}
releaseBranchPattern ~/main$/
}
sourceSets {
main {
java {
srcDirs 'src/main/java'
srcDirs 'build/generated/java'
}
}
}
group 'org.dmfs'
tasks.withType(Jar) {
eachFile {
it.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
sourceCompatibility = 1.8
configurations {
pom
}
apply from: 'publish.gradle'
apply from: 'jacoco.gradle'
repositories {
mavenCentral()
}
import org.apache.tools.ant.filters.ReplaceTokens
task generateSources(type: Copy) {
from 'src/templates/java'
into "${buildDir}/generated/java"
filter(ReplaceTokens, tokens: [
'NAME' : "${project.name}".toString(),
'VERSION': "${project.version}".toString()
])
}
compileJava.dependsOn generateSources
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
}
}
}
}
dependencies {
api 'org.dmfs:jems:1.44'
api 'org.dmfs:rfc3986-uri:0.8.1'
api 'org.dmfs:rfc5545-datetime:0.3'
api 'org.dmfs:http-client-essentials:' + HTTP_CLIENT_ESSENTIALS_VERSION
implementation 'net.iharder:base64:2.3.9'
implementation 'org.dmfs:http-client-headers:' + HTTP_CLIENT_ESSENTIALS_VERSION
implementation 'org.dmfs:http-client-types:' + HTTP_CLIENT_ESSENTIALS_VERSION
implementation 'org.dmfs:http-client-basics:' + HTTP_CLIENT_ESSENTIALS_VERSION
implementation 'org.dmfs:http-executor-decorators:' + HTTP_CLIENT_ESSENTIALS_VERSION
implementation 'org.dmfs:express-json:0.2.0'
implementation 'org.dmfs:jems2:' + JEMS2_VERSION
implementation 'org.json:json:20230227'
testImplementation 'org.saynotobugs:confidence-core:0.8.0'
testImplementation 'org.saynotobugs:confidence-mockito4:0.8.0'
testImplementation 'org.dmfs:jems2-testing:' + JEMS2_VERSION
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:4.8.0'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
testImplementation 'org.dmfs:http-client-mockutils:' + HTTP_CLIENT_ESSENTIALS_VERSION
testImplementation 'org.jmockit:jmockit:1.49'
}