forked from majikthys/log4j2-logstash-jsonevent-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
134 lines (108 loc) · 3.31 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'
description = 'Log4J2 Layout for outputting LogStash json_event format'
apply plugin: 'java'
version='4.0.0'
group = 'net.logstash.log4j2'
buildscript {
dependencies {
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
}
repositories {
mavenLocal()
mavenCentral()
}
}
repositories {
mavenLocal()
mavenCentral()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
}
}
repositories {
maven {
if (project.version.endsWith('-SNAPSHOT')) {
if (project.hasProperty('snapshotRepoName')) {
name "${snapshotRepoName}"
}
if (project.hasProperty('snapshotRepoURL')) {
url "${snapshotRepoURL}"
}
} else {
if (project.hasProperty('releaseRepoName')) {
name "$releaseRepoName"
}
if (project.hasProperty('releaseRepoURL')) {
url "$releaseRepoURL"
}
}
}
}
}
dependencies {
def log4j2Version = '2.+';
compile "org.apache.logging.log4j:log4j-api:$log4j2Version"
compile "org.apache.logging.log4j:log4j-core:$log4j2Version"
// Testing stuff, hamcrest comes first please
testCompile 'org.hamcrest:hamcrest-all:1.+'
testCompile 'org.testng:testng:6.+'
testCompile 'commons-collections:commons-collections:3.+'
// JACKSON for JSONification
def jacksonVersion = '2.3.+'
compile "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
compile "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
compile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
compile "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${jacksonVersion}"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${jacksonVersion}"
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jacksonVersion}"
//This JSON Hamcrest Matcher is pretty useful (https://github.com/hertzsprung/hamcrest-json)
testCompile 'uk.co.datumedge:hamcrest-json:0.+'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
test {
useTestNG() {
excludeGroups 'integration'
}
}
task integrationTest(type: Test, dependsOn: ['test']) {
logger.info 'Integration Tests'
useTestNG() {
}
include '**/*IT.class'
// copy resource over???
// set a system property for the test JVM(s)
doFirst {
logger.info 'Logstash required for integration tests'
// start logstash or check for logstash and fail
}
doLast {
//logger.info 'Stop Logstash'
// stop logstash
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}