-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
136 lines (117 loc) · 3.96 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
plugins {
id 'java-library'
id 'jacoco'
id 'maven-publish'
id 'signing'
}
group 'net.sandrohc'
version '2.2.0'
ext.isReleaseVersion = !version.endsWith('SNAPSHOT')
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
jar {
manifest {
attributes(
'Implementation-Title': 'reactive-jikan',
'Implementation-Version': project.version
)
}
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
repositories {
mavenCentral()
}
dependencies {
// Project Reactor
api 'io.projectreactor.netty:reactor-netty:1.1.0'
// Jackson (JSON serializer)
api 'com.fasterxml.jackson.core:jackson-databind:2.14.0'
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.0'
// Logging
api 'org.slf4j:slf4j-api:1.7.36'
// Tests
testRuntimeOnly 'ch.qos.logback:logback-classic:1.4.5'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
testImplementation 'org.assertj:assertj-core:3.23.1'
testImplementation 'org.mock-server:mockserver-netty:5.14.0'
testImplementation 'org.mock-server:mockserver-client-java:5.14.0'
testImplementation 'io.projectreactor:reactor-test:3.5.0'
// Required for 'mockserver-client-java', as the module 'sun.security.x509' became internal starting on JDK 16.
// https://github.com/mock-server/mockserver/issues/1031
testRuntimeOnly 'org.bouncycastle:bcprov-jdk15on:1.70'
testRuntimeOnly 'org.bouncycastle:bcpkix-jdk15on:1.70'
}
test {
useJUnitPlatform()
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
}
}
tasks.withType(JavaCompile) {
// force UTF-8 encoding on Windows machines
options.encoding = 'UTF-8'
}
publishing {
repositories {
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : 'unk'
password = project.hasProperty('ossrhPassword') ? ossrhPassword : 'unk'
}
}
}
publications {
maven(MavenPublication) {
from components.java
pom {
name = 'Reactive Jikan'
description = 'A fast and fully-typed API wrapper for Jikan - an unofficial MyAnimeList API - with the power of Project Reactor and reactive streams. ⚡'
url = 'https://github.com/SandroHc/reactive-jikan'
licenses {
license {
name = 'GNU Lesser General Public License v2.1'
url = 'https://gnu.org/licenses/old-licenses/lgpl-2.1.en.html'
}
}
developers {
developer {
id = 'SandroHc'
name = 'Sandro Marques'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/SandroHc/reactive-jikan.git'
developerConnection = 'scm:git:ssh://github.com/SandroHc/reactive-jikan.git'
url = 'https://github.com/SandroHc/reactive-jikan'
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/SandroHc/reactive-jikan/issues'
}
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.maven
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion && project.hasProperty('ossrhUsername') }
}