-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.gradle
More file actions
140 lines (114 loc) · 3.28 KB
/
build.gradle
File metadata and controls
140 lines (114 loc) · 3.28 KB
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
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'jacoco'
archivesBaseName = 'queuengin'
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
eclipse {
classpath {
downloadSources=true
}
}
eclipse.classpath.defaultOutputDir = file( 'build/classes' )
group = 'com.neverwinterdp'
sourceCompatibility = 1.7
version = '1.0-SNAPSHOT'
configurations.compile.transitive = true
project.ext {
kafkaVersion = "0.8.1.1"
zookeeperVersion = "3.4.6"
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile group: 'com.neverwinterdp', name: 'commons.utils', version: '1.0-SNAPSHOT'
compile group: 'com.neverwinterdp', name: 'commons.api', version: '1.0-SNAPSHOT'
compile group: 'com.neverwinterdp', name: 'commons.cluster', version: '1.0-SNAPSHOT'
compile group: 'com.neverwinterdp', name: 'commons.zookeeper', version: '1.0-SNAPSHOT'
compile group: 'com.neverwinterdp', name: 'commons.yara.core', version: '1.0-SNAPSHOT'
compile group: 'org.apache.kafka', name: 'kafka_2.10', version: project.kafkaVersion
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.5'
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.5'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
jacoco {
toolVersion = "0.6.2.201302030002"
reportsDir = file("$buildDir/JacocoReportDir")
}
test {
forkEvery = 1
ignoreFailures = true
testLogging.showStandardStreams = true
filter {
includeTestsMatching "*UnitTest"
}
}
task testJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.output
}
configurations {
tests
published.extendsFrom tests, archives
}
install {
configuration = configurations.published
}
artifacts {
tests testJar
}
task release (dependsOn: 'build') << {
def releaseDir = "${buildDir}/release/queuengin"
doRelease(releaseDir)
}
def doRelease(String releaseDir) {
println "\n\n"
println "*************************************************"
println "Preparing the release directory ${releaseDir}"
println "*************************************************"
/*
println "Copying kafka_2.8.0-0.8.1.1 to the release directory"
copy {
from "${buildDir}/../../../../NeverwinterDP-dependencies/kafka_2.8.0-0.8.1.1"
into "${releaseDir}"
}
*/
println "Patch kafka_2.8.0-0.8.1.1 with the custom script"
copy {
from "src/app"
into "${releaseDir}"
}
def jars = [
"commons.utils", "commons.api", "commons.cluster", 'commons.zookeeper',
"jackson-core-2.2.2", "jackson-databind", "jackson-annotations", "jcommander", "reflections", "guava", "javassist",
'guice', 'javax.inject', 'hazelcast', 'aopalliance',
"kafka", "scala-library",
'zookeeper', 'zkclient',
"log4j", "slf4j-api", "slf4j-log4j12"
]
println "Patch kafka_2.8.0-0.8.1.1 with the additional library"
configurations.compile.each { File file ->
if(isIn(jars, file)) {
println " Copy $file.name to queuengin/libs"
copy {
from file
into "${releaseDir}/libs"
}
}
}
println "Patch kafka_2.8.0-0.8.1.1 with the queuengin library"
copy {
from "${buildDir}/libs"
into "${releaseDir}/libs"
}
}
def isIn(set, File file) {
for(item in set) {
if(file.name.startsWith(item)) return true ;
}
return false ;
}