-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
174 lines (147 loc) · 5.59 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
plugins {
id 'java'
id 'application'
// To create a fat jar build/libs/...-all.jar, run: ./gradlew shadowJar
id 'com.github.johnrengelman.shadow' version '8.1.0'
// Code formatting; defines targets "spotlessApply" and "spotlessCheck"
// Version 6.14 and later requires JDK 11 or higher; the plugin crashes under JDK 8.
id 'com.diffplug.spotless' version '6.13.0'
// Error Prone linter
id('net.ltgt.errorprone') version '3.0.1'
// Checker Framework pluggable type-checking
id 'org.checkerframework' version '0.6.28'
}
repositories {
mavenCentral()
maven {
// for org.jenkins-ci artifacts
url 'https://repo.jenkins-ci.org/releases/'
}
}
// In this section you declare the dependencies for your production and test code
dependencies {
implementation 'org.plumelib:plume-util:1.8.1'
// https://mvnrepository.com/artifact/com.opencsv/opencsv
implementation group: 'com.opencsv', name: 'opencsv', version: '5.7.1'
// https://mvnrepository.com/artifact/org.pacesys.openstack4j.connectors/openstack4j-okhttp
implementation group: 'org.pacesys.openstack4j.connectors', name: 'openstack4j-okhttp', version: '3.2.0'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-simple
implementation 'org.slf4j:slf4j-log4j12:1.7.25'
// https://mvnrepository.com/artifact/org.kohsuke/github-api
implementation group: 'org.kohsuke', name: 'github-api', version: '1.314'
// These are required by github-api
compileOnly 'com.google.code.findbugs:annotations:3.0.0'
compileOnly 'com.google.code.findbugs:jsr305:3.0.0'
compileOnly group: 'com.infradna.tool', name: 'bridge-method-injector', version: '1.24'
compileOnly group: 'org.jenkins-ci', name: 'annotation-indexer', version: '1.15'
// https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit
// JGit 6.0 and later requires Java 11 to run. JGit 5.13 contains a bug in `loadConfiguration()`.
implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '6.7.0.202309050840-r'
}
application {
mainClass = 'astmergeevaluation.FindMergeCommits'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
java {
targetExclude('**/WeakIdentityHashMap.java')
googleJavaFormat()
formatAnnotations()
}
groovyGradle {
target '**/*.gradle'
greclipse() // which formatter Spotless should use to format .gradle files.
indentWithSpaces(2)
trimTrailingWhitespace()
// endWithNewline() // Don't want to end empty files with a newline
}
}
/// Error Prone linter
dependencies {
errorprone('com.google.errorprone:error_prone_core:2.19.1')
}
tasks.withType(JavaCompile).configureEach {
// "-processing" avoids javac warning "No processor claimed any of these annotations".
options.compilerArgs << '-Xlint:all,-processing' << '-Werror'
options.errorprone {
enabled = JavaVersion.current() != JavaVersion.VERSION_1_8
// disable('ReferenceEquality') // Use Interning Checker instead.
}
}
/// Checker Framework pluggable type-checking
apply plugin: 'org.checkerframework'
checkerFramework {
checkers = [
// No need to run CalledMethodsChecker, because ResourceLeakChecker does so.
// 'org.checkerframework.checker.calledmethods.CalledMethodsChecker',
'org.checkerframework.checker.formatter.FormatterChecker',
'org.checkerframework.checker.index.IndexChecker',
'org.checkerframework.checker.interning.InterningChecker',
'org.checkerframework.checker.lock.LockChecker',
'org.checkerframework.checker.nullness.NullnessChecker',
'org.checkerframework.checker.regex.RegexChecker',
'org.checkerframework.checker.resourceleak.ResourceLeakChecker',
'org.checkerframework.checker.signature.SignatureChecker',
'org.checkerframework.checker.signedness.SignednessChecker',
'org.checkerframework.common.initializedfields.InitializedFieldsChecker',
]
extraJavacArgs = [
'-Werror',
'-AcheckPurityAnnotations',
'-ArequirePrefixInWarningSuppressions',
'-AwarnUnneededSuppressions',
]
}
// To use a locally-built Checker Framework, run gradle with "-PcfLocal".
if (project.hasProperty('cfLocal')) {
def cfHome = String.valueOf(System.getenv('CHECKERFRAMEWORK'))
dependencies {
compileOnly files(cfHome + '/checker/dist/checker-qual.jar')
testCompileOnly files(cfHome + '/checker/dist/checker-qual.jar')
checkerFramework files(cfHome + '/checker/dist/checker.jar')
}
}
/// Javadoc
// Turn Javadoc warnings into errors.
javadoc {
options.addStringOption('Xwerror', '-Xdoclint:all')
options.addStringOption('private', '-quiet')
if (JavaVersion.current().compareTo(org.gradle.api.JavaVersion.VERSION_1_9) >= 0) {
options.addStringOption('source', '8')
}
doLast {
ant.replaceregexp(match:"@import url\\('resources/fonts/dejavu.css'\\);\\s*", replace:'',
flags:'g', byline:true) {
fileset(dir: destinationDir)
}
}
}
check.dependsOn javadoc
configurations {
requireJavadoc
}
dependencies {
requireJavadoc 'org.plumelib:require-javadoc:1.0.6'
}
task requireJavadoc(type: JavaExec) {
description = 'Ensures that Javadoc documentation exists.'
mainClass = 'org.plumelib.javadoc.RequireJavadoc'
classpath = configurations.requireJavadoc
args 'src/main/java'
}
check.dependsOn requireJavadoc
/// Emacs support
/* Make Emacs TAGS table */
task tags(type: Exec) {
description 'Run etags to create an Emacs TAGS table'
commandLine 'bash', '-c', "find src/ -name '*.java' | sort | xargs etags"
}