-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
174 lines (150 loc) · 4.19 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn more about Gradle by exploring our samples at https://docs.gradle.org/7.5/samples
*/
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'fr.brouillard.oss.gradle.jgitver' version '0.9.1'
id 'io.codearte.nexus-staging' version '0.30.0'
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.11
targetCompatibility = 1.11
jgitver {
strategy 'MAVEN'
nonQualifierBranches 'main'
useDirty true
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
ext {
okhttpVersion = '4.12.0'
jacksonVersion = '2.18.1'
hamcrestVersion = '3.0'
}
dependencies {
implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}"
implementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "org.apache.commons:commons-lang3:3.17.0"
compileOnly 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.projectlombok:lombok:1.18.36'
testCompileOnly 'org.projectlombok:lombok:1.18.36'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.36'
testImplementation "org.mockito:mockito-core:5.14.2"
testImplementation "com.squareup.okhttp3:mockwebserver:${okhttpVersion}"
testImplementation "org.hamcrest:hamcrest-core:${hamcrestVersion}"
testImplementation "org.hamcrest:hamcrest-library:${hamcrestVersion}"
testImplementation "junit:junit:4.13.2"
}
jar {
manifest {
attributes('Implementation-Title': 'notifir')
}
}
task sourceJar(type: Jar) {
description 'Packages up the source in a Jar for Maven publishing'
from sourceSets.main.allJava
from sourceSets.main.resources
}
task javadocJar(type: Jar, dependsOn: javadoc) {
description 'Packages up the javadoc in a Jar for Maven publishing'
from javadoc.destinationDir
}
artifacts {
archives jar, sourceJar, javadocJar
}
publishing {
repositories {
maven {
name = "OSSRH"
if (project.hasProperty("release")) {
url 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
} else {
url 'https://s01.oss.sonatype.org/content/repositories/snapshots'
}
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_TOKEN")
}
}
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/notifir/notifir-java"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
maven(MavenPublication) {
groupId = "io.github.notifir"
artifactId = "notifir"
artifact jar
artifact sourceJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom {
name = "notifir"
description = "Java client library for Notifir"
url = "https://github.com/notifir/notifir-java"
packaging = 'jar'
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = "titenkov"
name = "Pavel Titenkov"
email = "[email protected]"
}
developer {
id = "katyaterletskaya"
name = "Katya Kuzmenchuk"
email = "[email protected]"
}
}
scm {
connection = "scm:git:https://github.com/notifir/notifir-java.git"
developerConnection = "scm:git:https://github.com/notifir/notifir-java.git"
url = "https://github.com/notifir/notifir-java"
}
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.maven
}
nexusStaging {
serverUrl = "https://s01.oss.sonatype.org/service/local/"
packageGroup = "io.github.notifir"
username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_TOKEN')
}
tasks.test {
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
reports {
xml.required.set(true)
}
}