-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (98 loc) · 3.53 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
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.9"
}
}
plugins {
id 'com.palantir.git-version' version '0.11.0'
id 'com.adarshr.test-logger' version '1.6.0'
id 'net.ltgt.errorprone' version '0.6'
id 'java'
id 'eclipse'
id 'maven-publish'
}
apply from: 'config/errorprone.gradle'
apply from: 'config/checkstyle.gradle'
apply from: 'config/findbugs.gradle'
apply from: 'config/jacoco.gradle'
apply from: 'config/spotbugs.gradle'
repositories {
mavenCentral()
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.encoding = 'UTF-8'
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.encoding = 'UTF-8'
options.compilerArgs += "-parameters"
}
project.version = gitVersion()
dependencies {
// Annotations
compile group: 'net.jcip', name: 'jcip-annotations', version: '+'
compile group: 'org.jetbrains', name: 'annotations', version: '15.+'
compile group: 'com.google.errorprone', name: 'error_prone_annotations', version: '+'
// Jackson dependencies
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.+'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.+'
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.9.+'
// Unit Test Dependencies
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.3.+'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.+'
// Google Compile Testing Dependencies
testCompile group: 'com.google.testing.compile', name: 'compile-testing', version: '+'
testCompile group: 'com.google.truth', name: 'truth', version: '+'
// What is this?
// Turns out there is some weirdness with gradle and versioning of Java.
// Gradle will not explicit load some libraries by default. And since we are dealing with some complex compile time testing, our tests break
// However, if you add the tools.jar to the test compile it works great!
// But it does require that gradle know about the JAVA_HOME environment variable
// See:
// 1. https://github.com/google/compile-testing/issues/102
// 2. https://github.com/google/compile-testing/issues/28#issuecomment-69204681
// 3. https://stackoverflow.com/questions/11345193/gradle-does-not-find-tools-jar
// 4. https://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/
//testCompile files(System.getenv("JAVA_HOME") + "/lib/tools.jar")
// testCompile files(org.gradle.internal.jvm.Jvm.current().toolsJar)
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'io.breakfastcoders'
artifactId = 'davinci'
version = gitVersion()
from components.java
}
}
}
test {
testLogging {
events "skipped", "failed"
exceptionFormat "full"
}
testlogger {
theme 'standard'
showExceptions true
slowThreshold 1000
showSummary true
showStandardStreams true
}
}
tasks.withType(com.github.spotbugs.SpotBugsTask) {
reports {
xml.enabled = false
html.enabled = true
}
}
wrapper {
gradleVersion = '4.10.3'
}