-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
169 lines (138 loc) · 4.98 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
/*
* Copyright 2021 Aiven Oy https://aiven.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.gradle.util.DistributionLocator
import org.gradle.util.GradleVersion
plugins {
// https://docs.gradle.org/current/userguide/java_library_plugin.html
id "java-library"
// https://docs.gradle.org/current/userguide/distribution_plugin.html
id "distribution"
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
id "checkstyle"
// https://docs.gradle.org/current/userguide/jacoco_plugin.html
id "jacoco"
// https://docs.gradle.org/current/userguide/publishing_maven.html
id "maven-publish"
// https://github.com/melix/jmh-gradle-plugin
id "me.champeau.jmh" version "0.7.2"
//https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
}
wrapper {
distributionType = 'ALL'
doLast {
final DistributionLocator locator = new DistributionLocator()
final GradleVersion version = GradleVersion.version(wrapper.gradleVersion)
final URI distributionUri = locator.getDistributionFor(version, wrapper.distributionType.name().toLowerCase(Locale.ENGLISH))
final URI sha256Uri = new URI(distributionUri.toString() + ".sha256")
final String sha256Sum = new String(sha256Uri.toURL().bytes)
wrapper.getPropertiesFile() << "distributionSha256Sum=${sha256Sum}\n"
println "Added checksum to wrapper properties"
}
}
compileJava {
options.compilerArgs = ["-Xlint:all", "-Werror"]
}
jmh {
jmhVersion = "1.28"
resultFormat = "TEXT"
}
ext {
kafkaVersion = "3.6.0"
mockitoVersion = "5.14.2"
}
dependencies {
implementation "com.google.guava:guava:33.4.0-jre"
implementation "com.google.code.gson:gson:2.11.0"
compileOnly "org.apache.kafka:kafka_2.12:${kafkaVersion}"
compileOnly "org.slf4j:slf4j-api:1.7.36"
testImplementation "org.apache.kafka:kafka_2.12:${kafkaVersion}"
testImplementation "org.slf4j:slf4j-log4j12:1.7.36"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.11.4"
testImplementation "org.junit.jupiter:junit-jupiter:5.11.4"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.11.4"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion"
testImplementation "org.hamcrest:hamcrest-library:3.0"
testImplementation "org.openjdk.jmh:jmh-core:1.37"
testImplementation "org.openjdk.jmh:jmh-generator-annprocess:1.37"
testImplementation "org.assertj:assertj-core:3.27.0"
testImplementation 'org.awaitility:awaitility:4.2.2'
jmh "org.apache.kafka:kafka_2.12:${kafkaVersion}"
}
group = "io.aiven"
processResources {
filesMatching("auth-for-apache-kafka-version.properties") {
expand(version: version)
}
}
checkstyle {
toolVersion "9.2.1"
getConfigDirectory().set(rootProject.file("checkstyle/"))
}
jacoco {
toolVersion = "0.8.7"
}
test {
useJUnitPlatform()
}
jar {
manifest {
attributes(
"Version": "${project.version}"
)
}
}
publishing {
publications {
maven(MavenPublication) {
groupId = getGroup()
artifactId = "auth-for-apache-kafka"
version = getVersion()
pom {
name = "Aiven Authentication and Authorization Plugins for Apache Kafka"
description = "Aiven Authentication and Authorization Plugins for Apache Kafka"
url = "https://aiven.io"
organization {
name = "Aiven Oy"
url = "https://aiven.io"
}
licenses {
license {
name = "Apache 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0"
distribution = "repo"
}
}
scm {
connection = "scm:git:git://github.com/aiven/auth-for-apache-kafka.git"
developerConnection = "scm:git:git@github.com:aiven/auth-for-apache-kafka.git"
url = "https://github.com/aiven/auth-for-apache-kafka.git"
tag = "HEAD"
}
}
from components.java
}
}
}