forked from getodk/javarosa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
152 lines (132 loc) · 3.77 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
buildscript {
repositories {
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "me.champeau.jmh:jmh-gradle-plugin:0.6.7"
}
}
/**
* If `android` is true, the project will be configured as an Android rather than a Java library. This isn't used
* for building archives (such as an APK), but is useful for performing Android checks like lint.
*/
if (!project.hasProperty("android")) {
apply plugin: 'java-library'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply plugin: 'me.champeau.jmh'
apply plugin: 'maven-publish'
} else {
apply plugin: 'com.android.library'
}
repositories {
google()
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'
if (!project.hasProperty("android")) {
// TODO: does not build UML diagrams
javadoc {
failOnError = false
}
jacocoTestReport {
reports {
xml {
enabled false
}
}
}
// Required to use fileExtensions property in checkstyle file
checkstyle {
toolVersion = '7.6.1'
}
jmhJar.doFirst {
new File("build/resources/test").mkdirs()
}
jmh {
excludes = ["(BenchmarkTemplate)"]
threads = 1
fork = 1
warmup = '2s'
warmupIterations = 10
warmupBatchSize = 1
warmupForks = 1
iterations = 20
timeOnIteration = '2s'
timeUnit = 's'
benchmarkMode = ['avgt', 'ss']
includeTests = true
resultFormat = 'CSV'
forceGC = true
duplicateClassesStrategy = DuplicatesStrategy.WARN
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'org.getodk'
artifactId = 'javarosa'
version = 'local'
from components.java
}
}
}
} else {
android {
namespace 'com.example'
compileSdkVersion 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
}
}
}
}
dependencies {
// Be sure to update dependencies in pom.xml to match
api 'joda-time:joda-time:2.10.13'
api 'org.slf4j:slf4j-api:1.7.33'
api 'com.fasterxml.jackson.core:jackson-databind:2.13.1'
api 'org.jetbrains.kotlin:kotlin-stdlib:1.6.10'
api 'org.bouncycastle:bcprov-jdk18on:1.77'
api 'net.sf.kxml:kxml2:2.3.0'
// Upgrade to version higher than 1.4 when Collect minSDK >= 26
api 'org.apache.commons:commons-csv:1.4'
// Upgrade to version higher than 2.5 when Collect minSDK >= 26
api 'commons-io:commons-io:2.5'
testImplementation 'ch.qos.logback:logback-classic:1.2.10'
testImplementation 'junit:junit:4.13.2'
testImplementation 'net.sf.kxml:kxml2:2.3.0'
testImplementation 'org.hamcrest:hamcrest-all:1.3'
}