-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
91 lines (71 loc) · 2.25 KB
/
build.gradle.kts
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
import org.jetbrains.grammarkit.tasks.GenerateLexer
import org.jetbrains.grammarkit.tasks.GenerateParser
import org.jetbrains.intellij.mainSourceSet
plugins {
kotlin("jvm") version "1.5.10"
id("java")
id("idea")
id("org.jetbrains.intellij") version "1.4.0"
id("org.jetbrains.grammarkit") version "2021.1.2"
}
val pluginVersion: String by project
val pluginGroup: String by project
val kotlinVersion: String by project
val junitVersion: String by project
val ideaVersion: String by project
val ideaPlugins: String by project
val ideaDownloadSources: String by project
val ideaUpdateSinceUntilBuild: String by project
val genPath: String by project
val flexPath: String by project
val genLexerPath: String by project
val genLexerClassName: String by project
val genLexerPurgeOldFiles: String by project
val bnfPath: String by project
val genParserClassPath: String by project
val genPsiPath: String by project
val genParserPurgeOldFiles: String by project
group = pluginGroup
version = pluginVersion
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}
intellij {
version.set(ideaVersion)
plugins.set(ideaPlugins.split(","))
downloadSources.set(ideaDownloadSources.toBoolean())
updateSinceUntilBuild.set(ideaUpdateSinceUntilBuild.toBoolean())
}
sourceSets {
mainSourceSet(project).java.srcDir(genPath)
}
tasks {
val generateFregeLexer by registering(GenerateLexer::class) {
source = flexPath
targetDir = genLexerPath
targetClass = genLexerClassName
purgeOldFiles = genLexerPurgeOldFiles.toBoolean()
}
val generateFregeParser by registering(GenerateParser::class) {
dependsOn(generateFregeLexer)
source = bnfPath
targetRoot = genPath
pathToParser = genParserClassPath
pathToPsiRoot = genPsiPath
purgeOldFiles = genParserPurgeOldFiles.toBoolean()
}
compileKotlin {
dependsOn(generateFregeParser)
}
compileJava {
dependsOn(generateFregeParser)
}
test {
useJUnitPlatform()
}
}