-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
157 lines (131 loc) · 4.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
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
import java.text.SimpleDateFormat
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
group = 'co.ipregistry'
version = '4.0.0'
repositories {
mavenCentral()
}
configurations {
integrationTestImplementation.extendsFrom implementation
integrationTestRuntimeOnly.extendsFrom runtimeOnly
}
java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
jar {
manifest {
attributes(
'Built-By': System.properties['user.name'],
'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS': "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}",
'Created-By': 'Gradle ${gradle.gradleVersion}',
'Name': 'co/ipregistry/api/client/',
'Specification-Title': 'Ipregistry Client',
'Specification-Version': project.version,
'Specification-Vendor': 'Ipregistry',
'Implementation-Title': 'co.ipregistry.api.client',
'Implementation-Version': project.version,
'Implementation-Vendor': 'Ipregistry',
)
}
}
dependencies {
annotationProcessor 'org.projectlombok:lombok:1.18.36'
compileOnly 'org.projectlombok:lombok:1.18.36'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2'
implementation 'com.google.guava:guava:33.3.1-jre'
implementation 'org.apache.httpcomponents.client5:httpclient5-fluent:5.4.1'
implementation 'com.maxmind.db:maxmind-db:3.1.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.4'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.4'
testImplementation 'org.mockito:mockito-core:5.14.2'
integrationTestImplementation 'io.rest-assured:rest-assured:5.5.0'
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.4'
integrationTestRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.4'
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'co.ipregistry'
artifactId = 'ipregistry-client'
version = project.version
from components.java
pom {
name = 'Ipregistry Java Client'
packaging = 'jar'
description = 'Official Java client for Ipregistry, a fast, reliable IP geolocation and threat data API.'
url = 'https://github.com/ipregistry/ipregistry-java'
developers {
developer {
id = 'ipregistry-team'
name = 'Ipregistry Team'
email = '[email protected]'
}
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection = 'scm:git:[email protected]:ipregistry/ipregistry-java.git'
developerConnection = 'scm:git:[email protected]:ipregistry/ipregistry-java.git'
url = 'https://github.com/ipregistry/ipregistry-java.git'
}
}
}
}
repositories {
maven {
name = 'OSSRH'
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_PASSWORD')
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
sourceSets {
integrationTest {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
samples {
compileClasspath += main.output + main.compileClasspath
runtimeClasspath += main.output + main.runtimeClasspath
}
}
task integrationTest(type: Test) {
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
shouldRunAfter test
}
check.dependsOn integrationTest
test {
useJUnitPlatform()
}
integrationTest {
useJUnitPlatform()
}