-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
83 lines (68 loc) · 2.09 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val kotlinVersion = "1.6.20"
val publishingToken = System.getenv("PUBLISH_TOKEN")
group = "co.anbora.labs"
version = "2022.1.4"
plugins {
id("java")
kotlin("jvm") version "1.6.20"
id("org.jetbrains.intellij") version "1.5.3"
id("org.jetbrains.grammarkit") version "2021.2.2"
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
testImplementation("junit:junit:4.13.2")
}
apply {
plugin("kotlin")
plugin("org.jetbrains.grammarkit")
plugin("org.jetbrains.intellij")
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version.set("LATEST-EAP-SNAPSHOT")
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
sourceSets {
main {
java.srcDirs("src/main/gen")
}
}
tasks {
patchPluginXml {
sinceBuild.set("203")
changeNotes.set(file("src/main/html/change-notes.html").inputStream().readBytes().toString(Charsets.UTF_8))
pluginDescription.set(file("src/main/html/description.html").inputStream().readBytes().toString(Charsets.UTF_8))
}
generateLexer {
source.set("src/main/grammar/FirebaseRules.flex")
targetDir.set("src/main/gen/co/anbora/labs/firebase/lang/")
targetClass.set("FirebaseRulesLexer")
purgeOldFiles.set(true)
}
generateParser {
source.set("src/main/grammar/FirebaseRules.bnf")
targetRoot.set("src/main/gen")
pathToParser.set("/co/anbora/labs/firebase/lang/core/parser/FirebaseRulesParser.java")
pathToPsiRoot.set("/co/anbora/labs/firebase/lang/core/psi")
purgeOldFiles.set(true)
}
withType<KotlinCompile> {
dependsOn(generateLexer, generateParser)
kotlinOptions {
jvmTarget = "11"
languageVersion = "1.6"
apiVersion = "1.6"
freeCompilerArgs = listOf("-Xjvm-default=all")
}
}
publishPlugin {
token.set(publishingToken)
}
}