forked from deliveredtechnologies/rulebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
277 lines (238 loc) · 8.23 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
}
plugins {
id "com.github.kt3k.coveralls" version "2.8.0"
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
def projectUrl = properties['project.url']
def projectYear = properties['project.inceptionYear']
def projectScmUrl = properties['project.scm.url']
def projectScmConnection = properties['project.scm.connection']
def projectLicenseName = properties['project.license.name']
def projectLicenseUrl = properties['project.license.url']
def projectLicenseDistro = properties['project.license.distribution']
def projectIssueMgmtSystem = properties['project.issuemgmt.system']
def projectIssueMgmtUrl = properties['project.issuemgmt.url']
def projectDistMgmtId = properties['project.distributionmgmt.site.id']
def projectDistMgmtUrl = properties['project.distributionmgmt.site.url']
allprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
repositories {
jcenter()
mavenCentral()
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
subprojects {
apply plugin: 'idea'
apply plugin: 'checkstyle'
apply plugin: 'com.bmuschko.nexus'
group = properties['project.group']
version = properties['project.version']
sourceCompatibility = properties['project.compatibility']
targetCompatibility = properties['project.compatibility']
dependencies {
//logging
compile("org.slf4j:slf4j-api:1.7.22")
testCompile("junit:junit:4.12")
//for mocking
testCompile("org.mockito:mockito-all:1.10.19")
testRuntime("cglib:cglib-nodep:3.1")
testRuntime("org.objenesis:objenesis:2.1")
}
compileJava.doFirst {
println "source compatibility " + sourceCompatibility
println "target compatibility " + targetCompatibility
}
jacocoTestReport {
additionalSourceDirs = files(sourceSets.main.allSource.srcDirs)
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
classDirectories = files(sourceSets.main.output)
reports {
xml.enabled true
csv.enabled false
html.destination "${buildDir}/reports/jacoco/test/"
}
}
nexus {
sign = true
}
checkstyle {
configFile = new File("${rootDir}/config/checkstyle/checkstyle.xml")
toolVersion = '6.7'
ignoreFailures = false
}
task checkstyleMainHtml << {
ant.xslt(in: checkstyleMain.reports.xml.destination,
style: file('../config/checkstyle/checkstyle.xsl'),
out: new File("${buildDir}/reports/checkstyle", 'main.html'))
}
task checkstyleTestHtml << {
ant.xslt(in: checkstyleTest.reports.xml.destination,
style: file('../config/checkstyle/checkstyle.xsl'),
out: new File("${buildDir}/reports/checkstyle", 'test.html'))
}
checkstyleMainHtml.dependsOn checkstyleMain
checkstyleTestHtml.dependsOn checkstyleTest
build.dependsOn jacocoTestReport, checkstyleMainHtml, checkstyleTestHtml
}
project('rulebook-core') {
modifyPom {
project {
name 'RuleBook'
description 'A simple and intuitive rules abstraction for Java'
url "${projectUrl}"
inceptionYear "${projectYear}"
scm {
url "${projectScmUrl}"
connection "${projectScmConnection}"
developerConnection "${projectScmConnection}"
}
distributionManagement {
site {
id "${projectDistMgmtId}"
url "${projectDistMgmtUrl}"
}
}
issueManagement {
system "${projectIssueMgmtSystem}"
url "${projectIssueMgmtUrl}"
}
licenses {
license {
name "${projectLicenseName}"
url "${projectLicenseUrl}"
distribution "${projectLicenseDistro}"
}
}
developers {
developer {
id 'Clayton7510'
name 'Clayton Long'
url 'https://github.com/Clayton7510'
email '[email protected]'
roles {
role 'Author'
}
}
}
contributors {
contributor {
name 'Nicholas Lambert'
url 'https://github.com/NicolasLambert'
roles {
role 'code contributor for v0.2.1'
}
}
contributor {
name 'wheezymustafa'
url 'https://github.com/wheezymustafa'
roles {
role 'raised bugs and enhancement suggestions for v0.3 and v0.3.1'
}
}
contributor {
name 'Alessandro Torrisi'
url 'https://github.com/typhoon1978'
roles {
role 'raised bug for v0.5.1'
}
}
contributor {
name 'Marc Seeger'
url 'https://github.com/Gersee'
roles {
role 'raised bug for v0.5.1'
}
}
contributor {
name 'abhineet27'
url 'https://github.com/abhineet27'
roles {
role 'raised toString bug in TypeConvertibleFactMap for v0.6.1'
role 'raised POJO result chaining on read bug for v0.6.2'
}
}
}
}
}
}
project('rulebook-spring') {
def springVersion = properties['spring.version']
dependencies {
compile project(":rulebook-core")
//spring dependencies
compile ("org.springframework:spring-context:${springVersion}")
testCompile ("org.springframework:spring-test:${springVersion}")
}
modifyPom {
project {
name 'RuleBook Spring'
description 'Spring support for RuleBook'
url "${projectUrl}"
inceptionYear "${projectYear}"
scm {
url "${projectScmUrl}"
connection "${projectScmConnection}"
developerConnection "${projectScmConnection}"
}
distributionManagement {
site {
id "${projectDistMgmtId}"
url "${projectDistMgmtUrl}"
}
}
issueManagement {
system "${projectIssueMgmtSystem}"
url "${projectIssueMgmtUrl}"
}
licenses {
license {
name "${projectLicenseName}"
url "${projectLicenseUrl}"
distribution "${projectLicenseDistro}"
}
}
developers {
developer {
id 'Clayton7510'
name 'Clayton Long'
email '[email protected]'
}
}
}
}
}
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn subprojects.test
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(subprojects.sourceSets.main.output)
executionData = files(subprojects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
xml.destination "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
html.destination "${buildDir}/reports/jacoco/test/"
}
}
task alljavadoc(type: Javadoc) {
source subprojects.sourceSets.main.allSource
classpath = files(subprojects.sourceSets.main.compileClasspath)
destinationDir = file("${projectDir}/docs/javadocs")
}
task copySource(type: Copy) {
from subprojects.sourceSets.main.allSource
into "${rootDir}/src/main/java"
}