-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
129 lines (116 loc) · 4.14 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
plugins {
id 'scala'
id 'jacoco'
id 'signing'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.bisnode.opa' version '0.3.2'
}
group 'org.openpolicyagent.kafka'
version '1.5.1'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
// See versions used in Kafka here https://github.com/apache/kafka/blob/2.8.0/gradle/dependencies.gradle
dependencies {
compileOnly group: 'com.fasterxml.jackson.module', name: 'jackson-module-scala_2.13', version: '2.10.5'
compileOnly group: 'org.apache.kafka', name: 'kafka_2.13', version: '2.8.0'
implementation group: 'com.google.guava', name: 'guava', version: '32.1.3-jre'
testImplementation group: 'org.scalatest', name: 'scalatest_2.13', version: '3.2.17'
testImplementation group: 'org.scalatestplus', name: 'junit-4-13_2.13', version: '3.2.17.0'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.14.0'
testImplementation group: 'org.apache.kafka', name: 'kafka_2.13', version: '2.8.0'
}
shadowJar {
dependencies {
exclude(dependency {
!(it.moduleGroup in [
'org.openpolicyagent.kafka',
'com.google.guava'
])
})
}
}
jacocoTestReport {
reports {
xml.required = true
html.required = false
}
}
test {
testLogging {
events "passed", "skipped", "failed"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId ='org.openpolicyagent.kafka'
artifactId = 'opa-authorizer'
version = '1.5.1'
from components.java
pom {
name = 'Open Policy Agent plugin for Kafka authorization'
description = 'Open Policy Agent (OPA) plugin for Kafka authorization.'
url = 'https://github.com/anderseknert/opa-kafka-plugin'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'Anders Eknert'
email = 'anders@eknert.com'
organization = 'Styra'
organizationUrl = 'https://www.styra.com'
}
developer {
name = 'Jakub Scholz'
email = 'jakub@scholz.cz'
organization = 'Red Hat'
organizationUrl = 'https://www.redhat.com'
}
}
scm {
connection = 'scm:git:git://github.com/anderseknert/opa-kafka-plugin.git'
developerConnection = 'scm:git:ssh://github.com/anderseknert/opa-kafka-plugin.git'
url = 'https://github.com/anderseknert/opa-kafka-plugin.git'
}
}
}
}
repositories {
maven {
name = 'OSSRH'
credentials {
username = findProperty('ossrhUsername')
password = findProperty('ossrhPassword')
}
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
check.dependsOn(testRego, testRegoCoverage)
test.dependsOn startOpa
test.finalizedBy stopOpa
test.outputs.upToDateWhen {
// Consider alternatives to this: https://stackoverflow.com/a/52484259
false
}