This repository has been archived by the owner on Jun 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathbuild.gradle
86 lines (73 loc) · 2.1 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
import java.text.SimpleDateFormat
apply plugin: 'java'
apply plugin: 'jacoco'
// me.snov.newrelic.elasticsearch.ElasticsearchAgent
version = '2.4.0'
repositories {
mavenCentral()
}
dependencies {
compile files('lib/metrics_publish-2.0.1.jar')
compile 'com.google.code.gson:gson:2.6.1'
compile 'commons-codec:commons-codec:1.10'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
}
task copyTestResources(type: Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test/resources"
}
processTestResources.dependsOn copyTestResources
test {
useJUnit {
excludeCategories 'me.snov.newrelic.elasticsearch.IntegrationTest'
}
}
task integrationTest(type: Test) {
useJUnit {
includeCategories 'me.snov.newrelic.elasticsearch.IntegrationTest'
}
}
tasks.withType(Test) {
testLogging {
events "passed", "skipped", "failed"
}
}
jacocoTestReport {
reports {
xml.enabled true
}
}
def getDateTime() {
return new SimpleDateFormat("YYYYMMDDHHmm").format(new Date());
}
task fatJar(type: Jar) {
manifest {
attributes 'Specification-Title': 'New Relic Elasticsearch Plugin'
attributes 'Specification-Vendor': 'Sergey Novikov'
attributes 'Implementation-Vendor': 'Sergey Novikov'
attributes 'Built-Date': getDateTime()
attributes 'Specification-Version': version
attributes 'Implementation-Version': "${version}-${getDateTime()}"
attributes 'Main-Class': 'me.snov.newrelic.elasticsearch.Main'
}
baseName = 'plugin'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task dist(type: Tar) {
baseName 'newrelic-elasticsearch-plugin'
extension = 'tar.gz'
compression Compression.GZIP
into("newrelic-elasticsearch-plugin-${version}") {
from 'LICENSE'
into("config") {
from 'config', 'config'
}
from("${buildDir}/libs") {
include 'plugin*'
rename 'plugin-(.*).jar', 'plugin.jar'
}
}
}
dist.dependsOn fatJar