-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
126 lines (111 loc) · 4.29 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
/*
* Copyright 2014-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
buildscript {
ext {
orgSpringframeworkVersion = '4.0.6.RELEASE'
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'distribution'
// project.name - Defined in settings.gradle as Gradle defaults it to name of project dir and makes it read-only
project.version = '1.0.0-beta2'
project.group = 'com.brighttalk.channels'
eclipse.classpath.downloadJavadoc = true // defaults to 'false'
repositories {
mavenCentral()
}
dependencies {
// Compile-time dependencies
compile("com.google.guava:guava:16.0.1")
compile("org.slf4j:slf4j-api:1.7.7")
// Spring framework modules for Spring implementation of API client based on RestTemplate
// spring-web module for RestTemplate et al.
compile("org.springframework:spring-web:${orgSpringframeworkVersion}")
// spring-oxm module for Marshaller classes etc.
compile("org.springframework:spring-oxm:${orgSpringframeworkVersion}")
compile("org.apache.httpcomponents:httpclient:4.3.3")
// Test dependencies
testCompile("junit:junit:4.11")
testCompile("org.hamcrest:hamcrest-library:1.3")
testCompile("org.springframework:spring-test:${orgSpringframeworkVersion}")
testCompile("com.thoughtworks.xstream:xstream:1.4.7")
// Use an SLF4J-binding of logback-classic for testing purposes, but avoid imposing it as a dependency upon
// users of the app by declaring the scope of the dependency of 'test' only
testCompile("ch.qos.logback:logback-classic:1.1.2")
// Add support for bridging logs written to Java Commons Logging by 3rd party classes (e.g. Apache HTTP client) to SLF4J
testCompile("org.slf4j:jcl-over-slf4j:1.7.7")
// Add support for bridging logs written to Log4j by 3rd party classes (e.g. Wiremock) to SLF4J
testCompile("org.slf4j:log4j-over-slf4j:1.7.7")
testCompile("org.easymock:easymock:3.2")
testCompile("com.github.tomakehurst:wiremock:1.51")
}
jar {
// Exclude environment specific props files from JAR as they're only templates and get packaged in the zip
exclude('brighttalk-channel-reporting-api-client-*.properties')
}
task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
distributions {
// Specifies the contents of the binary distribution. (Note - Keep aligned with Maven assembly in pom.xml).
bin {
// Override default archive name of $project.name-$name to remove '..-bin-..' for consistency with Maven assembly
baseName = "${project.name}"
contents {
from 'readme.md'
from 'LICENSE.txt'
from('src/main/resources') {
include '*.properties'
include 'logback-template.xml'
}
from jar.outputs.files
from sourcesJar.outputs.files
from javadocJar.outputs.files
}
}
}
artifacts {
// Extend artefacts published by install task to include additional ones over and above the default binary/classes JAR
archives sourcesJar
archives javadocJar
archives binDistZip
archives binDistTar
}
// Customise distZip task for 'bin' distribution
binDistZip {
// Add name of distribution as suffix to archive name for consistency with Maven assembly plugin
classifier = 'bin'
}
// Customise distTar task for 'bin' distribution
binDistTar {
// Add name of distribution as suffix to archive name for consistency with Maven assembly plugin
classifier = 'bin'
// Enable use of compression, to create tgz, rather than plain tar
compression = Compression.GZIP
// Use extension 'tar.gz' rather than default tgz for consistency with Maven assembly plugin
extension = 'tar.gz'
}
task wrapper(type: Wrapper) {
gradleVersion = '1.12'
}