-
Notifications
You must be signed in to change notification settings - Fork 43
/
build.gradle
97 lines (78 loc) · 3.2 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
import java.util.function.Function
import java.util.stream.Collectors
apply plugin: 'application'
apply plugin: 'com.palantir.external-publish-jar'
mainClassName = 'com.palantir.javaformat.java.Main'
description = 'Palantir Java Format'
dependencies {
api project(':palantir-java-format-spi')
api 'com.google.guava:guava'
implementation 'org.functionaljava:functionaljava'
implementation 'com.fasterxml.jackson.core:jackson-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
implementation 'com.fasterxml.jackson.module:jackson-module-parameter-names'
testImplementation 'com.google.guava:guava-testlib'
testImplementation 'com.google.truth:truth'
testImplementation 'com.google.testing.compile:compile-testing'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter-migrationsupport'
testImplementation 'org.junit.jupiter:junit-jupiter'
compileOnly 'com.google.auto.service:auto-service'
annotationProcessor 'com.google.auto.service:auto-service'
compileOnly "org.immutables:value::annotations"
annotationProcessor "org.immutables:value"
compileOnly 'org.derive4j:derive4j-annotation'
annotationProcessor 'org.derive4j:derive4j'
}
def exports = [
'jdk.compiler/com.sun.tools.javac.file',
'jdk.compiler/com.sun.tools.javac.main',
'jdk.compiler/com.sun.tools.javac.parser',
'jdk.compiler/com.sun.tools.javac.tree',
'jdk.compiler/com.sun.tools.javac.util',
'jdk.compiler/com.sun.tools.javac.code',
'jdk.compiler/com.sun.tools.javac.api'
]
def jvmArgList = exports.stream().map(new Function<String, String>() {
@Override
String apply(String value) {
return "--add-exports=${value}=ALL-UNNAMED"
}
}).collect(Collectors.toList())
tasks.withType(JavaCompile).configureEach {
options.errorprone.disable 'StrictUnusedVariable'
// Allow access to internal javac apis
options.compilerArgs += jvmArgList
if (JavaVersion.current() < JavaVersion.VERSION_14) {
excludes = ['**/Java14InputAstVisitor.java']
}
}
tasks.withType(Test).configureEach {
jvmArgs = jvmArgList
}
tasks.withType(Javadoc).configureEach {
// Allow access to internal javac apis
options.optionFiles << file('../gradle/javadoc.options')
if (JavaVersion.current() < JavaVersion.VERSION_14) {
exclude '**/Java14InputAstVisitor.java'
}
}
// false positives due to org.junit.runners.* in the test cases
tasks.checkJUnitDependencies.enabled = false
tasks.test {
// Run all classes and tests in parallel
// https://junit.org/junit5/docs/current/user-guide/#writing-tests-parallel-execution
systemProperty 'junit.jupiter.execution.parallel.mode.default', 'concurrent'
}
// necessary to compile Java14InputAstVisitor
idea {
module.languageLevel = new org.gradle.plugins.ide.idea.model.IdeaLanguageLevel(14)
}
// This block may be replaced by BaselineExportsExtension exports
// once https://github.com/gradle/gradle/issues/18824 is resolved.
jar {
manifest {
attributes('Add-Exports': exports.stream().collect(Collectors.joining(' ')))
}
}