-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
121 lines (96 loc) · 3.5 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
plugins {
id 'java'
id 'application'
id 'org.graalvm.buildtools.native' version '0.9.28'
id 'com.diffplug.spotless' version "6.20.0"
id 'jacoco'
}
group 'ai.mender'
version '0.0.1-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation project(':shared')
implementation project(':antlr-engine')
implementation project(':clang-engine')
implementation project(':javaparser-engine')
implementation "org.antlr:antlr4-runtime:${property('antlr.version')}"
implementation 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3'
implementation "com.fasterxml.jackson.core:jackson-core:${property('jackson.version')}"
implementation "com.fasterxml.jackson.core:jackson-databind:${property('jackson.version')}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${property('jackson.version')}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${property('jackson.version')}"
implementation 'org.slf4j:slf4j-api:2.0.7'
implementation "org.apache.commons:commons-lang3:${property('commons-lang3.version')}"
implementation "com.google.guava:guava:32.1.3-jre"
implementation 'ch.qos.logback:logback-classic:1.4.11'
implementation 'info.picocli:picocli:4.7.5'
annotationProcessor 'info.picocli:picocli-codegen:4.7.5'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.2'
testImplementation 'com.approvaltests:approvaltests:18.7.1'
testImplementation 'com.github.javaparser:javaparser-core:3.25.7'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
}
compileJava {
options.compilerArgs += ["-Aproject=${project.group}/${project.name}"]
}
application {
mainClass = 'ai.mender.Main'
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport // report is always generated after tests run
}
check {
// Run formatting whenever we run check so we don't get behind
dependsOn spotlessApply
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/antlrgen/*'
])
}))
}
}
jacocoTestCoverageVerification {
}
sourceCompatibility = JavaVersion.VERSION_16 // TO THE MOON
targetCompatibility = JavaVersion.VERSION_16 // TO THE MOON
graalvmNative {
binaries.all {
resources.autodetect()
}
binaries.main {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(20)
vendor = JvmVendorSpec.matching("Oracle")
}
}
toolchainDetection = false
}
sourceSets.main.java.srcDirs = ['src/main/java']
spotless {
// optional: limit format enforcement to just the files changed by this feature branch
ratchetFrom 'origin/main'
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
java {
target(['src/main/java', 'src/test/java']) // don't format generated code.
// fix formatting of type annotations
formatAnnotations()
importOrder()
// apply a specific flavor of google-java-format
googleJavaFormat('1.17.0').aosp().reflowLongStrings()
}
}