forked from meilisearch/meilisearch-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
205 lines (178 loc) · 4.91 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.3/userguide/java_library_plugin.html
*/
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'io.github.gradle-nexus.publish-plugin' version "2.0.0"
id "com.diffplug.spotless" version "6.13.0"
}
group = 'com.meilisearch.sdk'
archivesBaseName = 'meilisearch-java'
version = '0.14.1'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
jacoco {
toolVersion = "0.8.8"
reportsDirectory = layout.buildDirectory.dir("$projectDir/tmp/coverage")
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.30
}
}
}
}
repositories {
mavenCentral()
}
configurations {
testCompile.extendsFrom compileOnly
}
dependencies {
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'org.json:json:20240303'
// https://mvnrepository.com/artifact/org.apache.httpcomponents.client5/httpclient5
api 'com.squareup.okhttp3:okhttp:[4.10.0,5.0.0)'
// Use JUnit test framework
testImplementation(platform('org.junit:junit-bom:5.11.1'))
testImplementation('org.junit.jupiter:junit-jupiter:5.11.1')
// https://mvnrepository.com/artifact/org.mockito/mockito-core
testImplementation 'org.mockito:mockito-core:4.9.0'
testImplementation 'org.hamcrest:hamcrest:3.0'
testImplementation 'com.squareup.okio:okio:3.9.1'
testImplementation 'com.squareup.okhttp3:okhttp:4.12.0'
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.18.0'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.18.0'
// Lombok
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
testCompileOnly 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
// Jwt
implementation 'com.auth0:java-jwt:4.4.0'
}
task buildJar(type: Jar) {
archiveBaseName = 'meilisearch-java'
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
{
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}
with jar
}
test {
finalizedBy jacocoTestReport
useJUnitPlatform {
excludeTags('integration')
}
testLogging {
events 'passed', 'skipped', 'failed'
}
}
jacocoTestReport {
dependsOn test
reports {
xml.required = false
csv.required = false
html.outputLocation = layout.buildDirectory.dir("$projectDir/tmp/test-reports")
}
finalizedBy jacocoTestCoverageVerification
}
task integrationTest(type: Test) {
useJUnitPlatform {
includeTags('integration')
}
testLogging {
events 'passed', 'skipped', 'failed'
showStandardStreams = System.getenv('DEBUG') != null
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'meilisearch-java'
from components.java
pom {
name = 'com.meilisearch.sdk:meilisearch-java'
packaging = 'jar'
artifactId = 'meilisearch-java'
description = 'Meilisearch is a powerful, fast, open-source, easy to use and deploy search engine.'
url = 'https://github.com/meilisearch/meilisearch-java'
scm {
connection = 'scm:git:git://github.com/meilisearch/meilisearch-java.git'
developerConnection = 'scm:git:ssh://github.com:meilisearch/meilisearch-java.git'
url = 'http://github.com/meilisearch/meilisearch-java'
}
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'eskombro'
name = 'Samuel Jimenez'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username System.getenv('OSSRH_USERNAME')
password System.getenv('OSSRH_PASSWORD')
}
}
}
}
nexusPublishing {
packageGroup = "com.meilisearch"
repositories {
sonatype {
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_PASSWORD')
stagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE_ID')
}
}
}
signing {
sign publishing.publications.mavenJava
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
spotless {
java {
// don't need to set target, it is inferred from java
// apply a specific flavor of google-java-format
googleJavaFormat('1.7').aosp()
}
}