forked from MorphiaOrg/morphia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
165 lines (132 loc) · 4.33 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
ext.configDir = new File(rootDir, 'config')
ext.slf4jVersion = '1.7.5'
ext.git = find('git')
ext.majorVersion = version.split('\\.').dropRight(1).join('.') + ( gitVersion() == 'master' ? '-SNAPSHOT' : '')
ext.latest = gitVersion() == 'master' ? version : latest_release
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.2'
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:1.12.+'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
}
configure(subprojects.findAll { it.name != 'util' }) {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
apply plugin: 'optional-base'
group = 'org.mongodb.morphia'
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
evaluationDependsOn(':util')
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenLocal()
}
dependencies {
testCompile 'junit:junit:4.12'
}
project.archivesBaseName = "morphia-${project.name}"
task listDependencies << {
configurations.compile.each { File file -> println file }
}
task testCoverage(dependsOn: check)
checkstyle {
toolVersion = "6.7"
configFile = new File("$configDir/checkstyle.xml")
}
findbugs {
excludeFilter = new File("$configDir/findbugs-exclude.xml")
toolVersion = '3.0.0'
sourceSets = [sourceSets.main]
}
tasks.withType(FindBugs) {
reports {
xml.enabled = project.buildingWith('xmlReports.enabled')
html.enabled = !project.buildingWith('xmlReports.enabled')
}
}
tasks.withType(AbstractCompile) {
options.encoding = 'ISO-8859-1'
options.fork = true
options.debug = true
options.compilerArgs = ['-Xlint:unchecked', '-Xlint:deprecation', '-Xlint:-options']
}
tasks.withType(Test) {
if (System.getenv()['RS_ENABLED'] == "true") {
systemProperty 'MONGO_URI', 'mongodb://localhost:27017,localhost:27018,localhost:27019'
}
useJUnit {
}
jacoco { enabled = false }
beforeTest { descr ->
logger.info("[Test ${descr.className} > ${descr.name}]")
}
}
test {
// set heap size for the test JVM(s)
minHeapSize = "256m"
maxHeapSize = "512m"
}
task quickCheck(dependsOn: ['checkstyleMain', 'checkstyleTest']) {}
javadoc {
dependsOn project(':util').compileJava //We need taglets to be compiled
options.author = true
options.version = true
options.tagletPath project(':util').sourceSets.main.output.classesDir
options.setTaglets([ 'taglets.ManualTaglet', 'taglets.ServerReleaseTaglet' ])
options.links 'http://docs.oracle.com/javase/6/docs/api/'
options.links 'http://api.mongodb.org/java/3.0/'
title "Morphia ${majorVersion} API"
options.encoding = 'UTF-8'
options.charSet 'UTF-8'
options.docEncoding 'UTF-8'
}
}
task clirrRootReport(type: org.kordamp.gradle.clirr.ClirrReportTask) << {
dependsOn = subprojects.tasks.clirr
reports = files((subprojects.findAll { it.clirr.enabled == true }).tasks.clirr.xmlReport)
}
def buildingWith(n) {
project.hasProperty(n)
}
def gitVersion() {
def stdOut = new ByteArrayOutputStream()
exec {
commandLine git, "rev-parse", "--abbrev-ref", "HEAD"
standardOutput = stdOut
ignoreExitValue = true
}
return stdOut.toString().trim()
}
def find(executable) {
def list = ['/usr/local/bin/', '/usr/bin/']
list.findResult {
def exec = file(it + executable)
if(exec.exists()) {
exec.absolutePath
}
}
}
apply from: 'gradle/osgi-compatibility.gradle'
apply from: 'gradle/release-process.gradle'
apply from: 'gradle/docs.gradle'