This repository has been archived by the owner on Apr 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
171 lines (153 loc) · 4.81 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
plugins {
id 'org.springframework.boot' version '2.4.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'distribution'
id 'java-library'
id 'java-library-distribution'
id 'maven-publish'
id 'jacoco'
id 'com.jfrog.bintray' version '1.8.5'
id 'net.researchgate.release' version '2.8.1'
id 'com.github.ben-manes.versions' version '0.38.0'
id 'com.github.breadmoirai.github-release' version '2.2.12'
}
group = 'com.redislabs'
description = 'Java client for RediSearch based on Lettuce'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
java {
withJavadocJar()
withSourcesJar()
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
bootJar {
enabled = false
}
jar {
enabled = true
}
dependencies {
api 'io.lettuce:lettuce-core:6.1.0.RELEASE'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.slf4j:slf4j-simple'
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testImplementation 'org.testcontainers:testcontainers:1.15.2'
testImplementation 'org.testcontainers:junit-jupiter:1.15.2'
testImplementation 'org.apache.commons:commons-pool2'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
test {
useJUnitPlatform()
}
distributions {
main {
contents {
from (project.docsDir) {
into 'docs'
}
from 'README.adoc'
from 'LICENSE'
}
}
}
distTar {
compression = Compression.GZIP
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'LettuSearch'
description = 'Java client for RediSearch based on Lettuce'
url = 'https://github.com/RediSearch/lettusearch'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'jruaux'
name = 'Julien Ruaux'
}
}
scm {
connection = 'scm:git:git://github.com/RediSearch/lettusearch.git'
developerConnection = 'scm:git:[email protected]:RediSearch/lettusearch.git'
url = 'https://github.com/RediSearch/lettusearch'
}
}
}
}
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : ''
key = project.hasProperty('bintrayKey') ? project.property('bintrayKey') : ''
publications = ['mavenJava']
publish = true
pkg {
repo = 'maven'
name = project.name
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/RediSearch/lettusearch.git'
version {
gpg {
sign = true
}
mavenCentralSync {
sync = true
user = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
password = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
}
}
}
}
githubRelease {
token = project.hasProperty('githubToken') ? project.property('githubToken') : ''
owner "RediSearch"
repo "lettusearch"
releaseAssets distZip, distTar
draft true
body changelog()
}
def isNonStable = { String version ->
def nonStableKeyword = ['PREVIEW'].any { it -> version.toUpperCase().contains(it) }
def stableKeyword = ['RELEASE', 'FINAL', 'GA', 'JRE8'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+([.-]r)?$/
return nonStableKeyword || (!stableKeyword && !(version ==~ regex))
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}
tasks.distZip.shouldRunAfter tasks.javadocJar
check.dependsOn jacocoTestReport
afterReleaseBuild.dependsOn ":githubRelease"
afterReleaseBuild.dependsOn bintrayUpload