forked from getodk/javarosa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
115 lines (98 loc) · 2.73 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
plugins {
id 'java'
id 'checkstyle'
id 'jacoco'
id "me.champeau.gradle.jmh" version "0.5.0"
}
repositories {
mavenCentral()
}
sourceSets {
main.java.srcDirs = ['src/main/java']
main.resources.srcDirs = ['src/main/resources']
test.java.srcDirs = ['src/test/java']
test.resources.srcDirs = ['src/test/resources']
}
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
compileJava {
options.compilerArgs << "-Xlint:deprecation"
}
compileTestJava {
options.compilerArgs << "-Xlint:deprecation"
}
targetCompatibility = '1.8'
sourceCompatibility = '1.8'
dependencies {
// Be sure to update dependencies in pom.xml to match
compile group: 'joda-time', name: 'joda-time', version: '2.9.9'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compileOnly group: 'net.sf.kxml', name: 'kxml2', version: '2.3.0'
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'net.sf.kxml', name: 'kxml2', version: '2.3.0'
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
}
jacocoTestReport {
reports {
xml.enabled true
}
}
// Required to use fileExtensions property in checkstyle file
checkstyle {
toolVersion = '7.6.1'
}
jar {
baseName = 'opendatakit-javarosa'
// Be sure to update version in pom.xml to match
// snapshot release = x.x.x-SNAPSHOT
// production release = x.x.x
version = '2.17.0'
archiveName = baseName + '-' + version + '.jar'
manifest {
attributes 'Manifest-Version': "$jar.version"
}
}
// Useful for testing
task explodedJar(type: Copy) {
into "$buildDir/libs/$jar.baseName $jar.version"
with jar
}
// TODO: does not build UML diagrams
javadoc {
failOnError = false
}
jmhJar.doFirst {
new File("build/resources/test").mkdirs()
}
jmh {
exclude = ["(BenchmarkTemplate)"]
threads = 1
fork = 1
timeout = '10s'
warmup = '2s'
warmupIterations = 10
warmupBatchSize = 1
warmupForks = 1
iterations = 20
timeOnIteration = '2s'
timeUnit = 's'
benchmarkMode = ['avgt','ss']
includeTests = true
resultFormat = 'CSV'
forceGC = true
duplicateClassesStrategy = 'warn'
}
/**
* Returns the value of a property of this build if it exists. Otherwise,
* returns the provided devault value.
*
* This method is used as a safe way to get properties that might or might not
* be defined in the gradle.properties file.
*/
String getValue(String key, String defaultValue) {
if (this.hasProperty(key))
return this.getProperty(key)
return defaultValue
}
apply from: 'android-api-level-checker.gradle'