-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
164 lines (132 loc) · 4.28 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
group 'com.turn.griffin'
apply plugin: 'application'
apply plugin: 'com.google.protobuf'
apply plugin: 'spring-boot'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'docker'
apply plugin: 'findbugs'
sourceCompatibility = 1.7
group = "srangwal"
jar {
version = '0.1.0'
baseName = 'griffin'
}
//Get protobuf gradle plugin
buildscript {
repositories {
mavenCentral()
}
dependencies {
/* https://github.com/google/protobuf-gradle-plugin */
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.0"
/* Spring framework */
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE"
/* Docker plugin */
classpath "se.transmode.gradle:gradle-docker:1.2"
}
}
// Get dependencies from Maven central repository
repositories {
mavenCentral()
jcenter()
}
// Project dependencies
dependencies {
testCompile group: 'org.testng', name: 'testng', version: '6.8.8'
compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0'
compile group: 'com.google.api.client', name: 'google-api-client-util', version: '1.2.3-alpha'
compile group: 'com.google.guava', name: 'guava', version: '16.0+'
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.6+'
compile group: 'org.xerial.snappy', name: 'snappy-java', version: '1.0.4.1+'
compile group: 'commons-io', name: 'commons-io', version: '2.4+'
compile group: 'commons-codec', name: 'commons-codec', version: '1.1+'
compile group: 'org.apache.commons', name: 'commons-email', version: '1.4+'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4+'
compile group: 'org.apache.commons', name: 'commons-compress', version: '1.9+'
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '2.5.0'
compile group: 'com.101tec', name: 'zkclient', version: '0.3'
compile group: 'org.apache.kafka', name: 'kafka_2.9.2', version: '0.8.2.0'
compile group: 'org.apache.kafka', name: 'kafka-clients', version: '0.8.2.0'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web'
compile group: 'com.google.code.gson', name: 'gson', version: '2.4'
}
configurations.all {
exclude module: 'slf4j-log4j12'
}
def generateProtoBufDir = "$projectDir/src/generated"
protobuf {
/* Location for protobuf generated files */
generatedFilesBaseDir = generateProtoBufDir
}
clean {
/* Clean generated files as well */
delete generateProtoBufDir
}
idea {
project {
jdkName = '1.7'
languageLevel = '1.7'
vcs = 'Git'
}
module {
/* Add protobuf generated files to sources for idea file */
sourceDirs += file(generateProtoBufDir)
}
}
javadoc {
dependsOn tasks.build
options.memberLevel = JavadocMemberLevel.PACKAGE
options.noQualifiers = ["all"]
/* Add protobuf generated files to sources for javadoc */
source = [sourceSets.main.allJava, files(generateProtoBufDir)]
classpath = configurations.compile
}
task buildDocker(type: Docker, dependsOn: build) {
description 'Build a Griffin docker image'
push = false
applicationName = jar.baseName
dockerfile = file('src/main/docker/Dockerfile')
doFirst {
copy {
from jar
from file("src/main/docker/run")
from file("src/main/docker/application.properties")
into stageDir
}
}
}
// FINDBUGS
findbugs {
effort = "max"
ignoreFailures = true
}
tasks.withType(FindBugs) {
// TODO: Make sure this is not excluding GriffinControlManager
def excludeGriffinControl = 'com/turn/griffin/GriffinControl$'
def excludeGriffinData = 'com/turn/griffin/GriffinData$'
def excludeProtobufFiles = 'com/turn/protobufkafka/'
classes = classes.filter {
!( it.path.contains(excludeProtobufFiles) ||
it.path.contains(excludeGriffinControl) ||
it.path.contains(excludeGriffinData))
}
// Generate HTML output for findbugs
reports {
xml.enabled = false
html.enabled = true
}
}
test {
// enable TestNG support (default is JUnit)
useTestNG()
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message )
}
}
/* vim: set ft=groovy */