-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
119 lines (103 loc) · 3.89 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
task wrapper(type: Wrapper) {
gradleVersion = project.gradle.gradleVersion
}
ext {
sourceCompatibility = 1.8
version = '1.0.0'
guavaVersion = '18.0'
kafkaVersion = '0.10.2.1'
slf4jVersion = '1.7.21'
skipSigning = project.hasProperty('s kipSigning') && skipSigning.toBoolean()
shouldSign = !skipSigning && !version.endsWith("SNAPSHOT") && project.gradle.startParameter.taskNames.any {
it.contains("upload")
}
mavenUrl = project.hasProperty('mavenUrl') ? project.mavenUrl : ''
mavenUsername = project.hasProperty('mavenUsername') ? project.mavenUsername : ''
mavenPassword = project.hasProperty('mavenPassword') ? project.mavenPassword : ''
}
subprojects {
apply plugin: 'java'
apply plugin: 'osgi'
apply plugin: 'maven'
apply plugin: 'signing'
repositories {
mavenCentral()
}
dependencies {
testCompile([
"org.hamcrest:hamcrest-all:1.3",
"org.mockito:mockito-all:1.10.19",
"org.slf4j:slf4j-simple:$slf4jVersion",
"org.awaitility:awaitility:2.0.0",
"com.google.guava:guava-testlib:$guavaVersion",
])
testCompile("junit:junit:4.12") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile([
"org.slf4j:slf4j-api:$slf4jVersion",
"org.apache.kafka:kafka-clients:$kafkaVersion",
"com.google.guava:guava:$guavaVersion"
])
}
//Some OSGi information
jar {
manifest {
version = project.version
symbolicName = "$project.group.$baseName"
}
}
uploadArchives {
repositories {
signing {
required { shouldSign }
sign configurations.archives
// To test locally, replace mavenUrl in ~/.gradle/gradle.properties to file://localhost/tmp/myRepo/
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "${mavenUrl}") {
authentication(userName: "${mavenUsername}", password: "${mavenPassword}")
}
afterEvaluate {
pom.artifactId = "${archivesBaseName}"
pom.project {
name 'verteiler'
packaging 'jar'
url 'http://datanerds.io'
description 'verteiler is a simple multi threaded blocking queue kafka consumer api'
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection 'https://github.com/datanerds-io/verteiler.git'
developerConnection 'https://github.com/datanerds-io/verteiler.git'
url 'https://github.com/datanerds-io/verteiler'
}
developers {
developer {
id 'larsp'
name 'Lars Pfannenschmidt'
email 'lars@d8a.wtf'
}
}
}
}
}
}
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
}