forked from unbroken-dome/embedded-kafka
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
159 lines (131 loc) · 4.65 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
import static org.gradle.api.JavaVersion.VERSION_11
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:_"
classpath("io.codearte.nexus-staging:io.codearte.nexus-staging.gradle.plugin:_")
}
}
repositories {
mavenCentral()
}
apply plugin: "kotlin"
apply plugin: "io.codearte.nexus-staging"
apply plugin: "maven-publish"
description = "Embedded Kafka Broker and JUnit5 Extension"
version = project.hasProperty("releaseVersion") ? project.releaseVersion : "LOCAL"
group = "dev.forkhandles"
test {
useJUnitPlatform()
}
jar {
manifest {
attributes "Implementation-Title": project.name,
"Implementation-Vendor": "dev.forkhandles",
"Implementation-Version": project.version,
"embedded-kafka-Version": archiveVersion
}
}
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}
tasks.register("sourcesJar", Jar) {
dependsOn classes
classifier = "sources"
from sourceSets.main.allSource
}
tasks.register("javadocJar", Jar) {
dependsOn javadoc
classifier = 'javadoc'
from javadoc.destinationDir
}
tasks.register("testJar", Jar) {
classifier "test"
from sourceSets.test.output
}
compileKotlin.kotlinOptions.jvmTarget = "11"
compileTestKotlin.kotlinOptions.jvmTarget = "11"
sourceCompatibility = VERSION_11
targetCompatibility = VERSION_11
configurations {
testArtifacts.extendsFrom testRuntime
}
artifacts {
testArtifacts testJar
archives sourcesJar, javadocJar
}
def enableSigning = project.findProperty("sign") == "true"
apply plugin: "maven-publish"
if (enableSigning) { // when added it expects signing keys to be configured
apply plugin: "signing"
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications
}
}
def nexusUsername = project.findProperty("nexusUsername") ?: "notset"
def nexusPassword = project.findProperty("nexusPassword") ?: "notset"
publishing {
repositories {
maven {
name "SonatypeStaging"
url "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username nexusUsername
password nexusPassword
}
}
maven {
name "SonatypeSnapshot"
url "https://oss.sonatype.org/content/repositories/snapshots/"
credentials {
username nexusUsername
password nexusPassword
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
pom.withXml {
asNode().appendNode("name", archivesBaseName)
asNode().appendNode("description", description)
asNode().appendNode("url", "https://forkhandles.dev")
asNode().appendNode("developers")
.appendNode("developer").appendNode("name", "Nat Pryce").parent().appendNode("email", "[email protected]")
.parent().parent()
.appendNode("developer").appendNode("name", "David Denton").parent().appendNode("email", "[email protected]")
.parent().parent()
.appendNode("developer").appendNode("name", "Dmitry Kandalov").parent().appendNode("email", "[email protected]")
.parent().parent()
.appendNode("developer").appendNode("name", "Duncan McGregor").parent().appendNode("email", "[email protected]")
asNode().appendNode("scm").
appendNode("url", "[email protected]:fork-handles/embedded-kafka.git").parent().
appendNode("connection", "scm:git:[email protected]:fork-handles/embedded-kafka.git").parent().
appendNode("developerConnection", "scm:git:[email protected]:fork-handles/embedded-kafka.git")
asNode().appendNode("licenses").appendNode("license").
appendNode("name", "MIT License").parent()
}
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
dependencies {
api(Kotlin.stdlib.jdk8)
api("com.google.guava:guava:_")
api("org.apache.kafka:kafka_2.13:_")
api("org.apache.zookeeper:zookeeper:_")
api(Testing.junit.jupiter.api)
testApi(Testing.junit.jupiter.api)
testApi(Testing.junit.jupiter.engine)
}