-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
84 lines (70 loc) · 2.08 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
plugins {
id 'idea'
id 'jacoco'
id 'org.jetbrains.intellij' version '1.3.1'
id 'org.jetbrains.changelog' version '1.3.1'
id 'org.jetbrains.grammarkit' version '2021.1.3'
id 'org.jetbrains.kotlin.jvm' version '1.7.22'
}
apply plugin: 'org.jetbrains.changelog'
group 'software.amazon.smithy'
version '2.0.19'
repositories {
mavenCentral()
}
sourceSets {
main.java.srcDirs 'src/main/gen'
}
test.finalizedBy jacocoTestReport
jacocoTestReport {
dependsOn test
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/psi/impl/**'])
}))
}
doLast {
println("Coverage Report: file://${reports.html.outputLocation.file("index.html").get()}")
}
}
idea {
module {
generatedSourceDirs += file('src/main/gen')
}
}
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'software.amazon.smithy:smithy-model:1.49.0'
}
intellij {
version = '2021.3.2'
updateSinceUntilBuild = false
}
patchPluginXml {
sinceBuild = '213'
changeNotes = provider { changelog.getLatest().toHTML() }
}
import org.jetbrains.grammarkit.tasks.GenerateLexer
import org.jetbrains.grammarkit.tasks.GenerateParser
task generateSmithyLexer(type: GenerateLexer) {
source 'src/main/grammar/Smithy.flex'
targetDir 'src/main/gen/software/amazon/smithy/intellij/'
targetClass '_SmithyLexer'
purgeOldFiles true
outputs.upToDateWhen { false }
}
task generateSmithyParser(type: GenerateParser, dependsOn: generateSmithyLexer) {
source 'src/main/grammar/Smithy.bnf'
targetRoot 'src/main/gen/'
pathToParser 'SmithyParser'
pathToPsiRoot 'psi/'
purgeOldFiles true
outputs.upToDateWhen { false }
}
compileKotlin {
dependsOn generateSmithyParser
kotlinOptions.freeCompilerArgs += ["-Xjvm-default=all-compatibility"]
}