This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
70 lines (56 loc) · 1.69 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
// SPDX-License-Identifier: Apache-2.0
fun lookupProperty(key: String) = project.findProperty(key).toString()
val javaVersion by lazy {
JavaLanguageVersion.of(lookupProperty("javaVersion"))
}
plugins {
id("org.jetbrains.kotlin.jvm") version "1.6.21"
id("org.jetbrains.intellij") version "1.5.3"
id("org.jetbrains.grammarkit") version "2021.2.2"
java
}
repositories {
mavenCentral()
}
version = lookupProperty("pluginVersion")
intellij {
version.set(lookupProperty("ideaVersion"))
pluginName.set("sleigh-idea")
downloadSources.set(true)
updateSinceUntilBuild.set(false)
plugins.set(lookupProperty("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}
java.toolchain.languageVersion.set(javaVersion)
kotlin {
jvmToolchain {
version = javaVersion
}
}
sourceSets["main"].java.srcDirs("src/main/kotlin", "src/main/gen")
apply(plugin="org.jetbrains.grammarkit")
tasks {
wrapper {
gradleVersion = lookupProperty("gradleVersion")
}
generateLexer {
source.set("src/main/grammar/SleighLexer.flex")
targetDir.set("src/main/gen/it/frob/sleighidea/lexer")
targetClass.set("SleighLexer")
purgeOldFiles.set(true)
}
generateParser {
source.set("src/main/grammar/SleighGrammar.bnf")
targetRoot.set("src/main/gen")
pathToParser.set("it/frob/sleighidea/parser/SleighParser.java")
pathToPsiRoot.set("it/frob/sleighidea/psi")
purgeOldFiles.set(true)
}
compileJava {
dependsOn.add(generateLexer)
dependsOn.add(generateParser)
}
compileKotlin {
dependsOn.add(generateLexer)
dependsOn.add(generateParser)
}
}