-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
188 lines (148 loc) · 3.71 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//
// Thoughtfully generated by synapticloop project initialiser
//
// https://github.com/synapticloopltd/project-initialiser
//
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// list all of the plugins for this project
plugins {
id 'java'
id 'eclipse'
id 'net.saliman.cobertura' version '2.5.4'
id 'synapticloop.copyrightr' version '1.2.1'
id 'synapticloop.documentr' version '2.9.0'
id 'maven-publish'
id 'co.riiid.gradle' version '0.4.2'
id 'com.jfrog.bintray' version '1.8.0'
id 'com.github.ben-manes.versions' version '0.17.0'
}
// textual information for this project
group = 'synapticloop'
archivesBaseName = 'c3p0-multitenant'
description = """Multi tenanted c3p0 pool"""
version = '1.2.1'
sourceCompatibility = 1.7
targetCompatibility = 1.7
// all of the repositories in use for this project
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
// list all of the dependencies for this project
dependencies {
runtime 'com.mchange:c3p0:0.9.5.2'
compile 'com.mchange:c3p0:0.9.5.2'
testRuntime 'org.postgresql:postgresql:42.2.2'
testRuntime 'junit:junit:4.12'
testRuntime 'org.slf4j:slf4j-api:1.7.25'
testCompile 'org.postgresql:postgresql:42.2.2'
testCompile 'junit:junit:4.12'
}
// we always want to fail on version conflicts
configurations.all {
resolutionStrategy {
failOnVersionConflict()
eachDependency {
DependencyResolveDetails details ->
if (details.requested.group == 'junit') {
details.useVersion '4.12'
}
}
}
}
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'b', 'dmr'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
cobertura {
coverageFormats = [ 'html', 'xml']
}
test {
include '**/*Test.class'
maxParallelForks = 1
forkEvery = 50
}
copyrightr {
dryRun = false
copyrightHolder = "Synapticloop"
includes = [
"src/**/*.java",
"src/**/*.groovy",
]
excludes = [
"**/*.class",
"src/test/java/**/*.java"
]
onlyReplaceFirst = false
yearSeparator = " - "
}
documentr {
directory = '.'
verbose = 'false'
extension = 'md'
}
def javaApiUrl = 'http://docs.oracle.com/javase/7/docs/api/'
def groovyApiUrl = 'http://groovy.codehaus.org/gapi/'
tasks.withType(Javadoc) {
options.links(javaApiUrl, groovyApiUrl)
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
publishing {
publications {
synapticloop(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId 'synapticloop'
artifactId 'c3p0-multitenant'
pom.withXml {
configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
asNode().dependencies[0].dependency.find {
it.artifactId[0].text() == dep.moduleName &&
it.groupId[0].text() == dep.moduleGroup
}.scope[0].value = 'compile'
}
}
}
}
}
github {
owner = 'synapticloopltd'
repo = archivesBaseName
if(System.getenv('GITHUB_TOKEN')) {
token = System.getenv('GITHUB_TOKEN')
}
tagName = version
name = version
assets = [
'build/libs/' + archivesBaseName + '-' + version + '.jar'
]
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_PASSWORD')
publications = [ 'synapticloop' ]
publish = true
pkg {
repo = 'maven'
name = 'c3p0-multitenant'
}
}
build.finalizedBy(project.tasks.cobertura)