generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
127 lines (101 loc) · 3.87 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
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
121
122
123
124
125
126
127
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
fun properties(key: String) = project.findProperty(key).toString()
plugins {
idea
kotlin("jvm") version "1.8.0"
id("org.jetbrains.intellij") version "1.11.0"
id("org.jetbrains.grammarkit") version "2021.2.2"
kotlin("plugin.serialization") version "1.8.0"
}
group = properties("pluginGroup")
version = properties("pluginVersion")
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
implementation("net.java.dev.jna:jna:5.12.1")
testImplementation("org.eclipse.jgit:org.eclipse.jgit:6.4.0.202211300538-r")
}
intellij {
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
type.set(properties("platformType"))
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}
sourceSets["main"].java.srcDirs("src/main/gen")
tasks {
// Set the JVM compatibility versions
properties("javaVersion").let {
withType<JavaCompile> {
sourceCompatibility = it
targetCompatibility = it
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = it
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn", "-Xjvm-default=all")
}
}
}
compileKotlin {
dependsOn(generateParser, generateLexer)
}
generateParser {
source.set("src/main/resources/grammar/Jakt.bnf")
// optional, task-specific root for the generated files. Default: none
targetRoot.set("src/main/gen")
// path to a parser file, relative to the targetRoot
pathToParser.set("org/serenityos/jakt/parser/JaktParser.java")
// path to a directory with generated psi files, relative to the targetRoot
pathToPsiRoot.set("org/serenityos/jakt/psi")
// if set, the plugin will remove a parser output file and psi output directory before generating new ones. Default: false
purgeOldFiles.set(true)
}
generateLexer {
// source flex file
source.set("src/main/resources/grammar/Jakt.flex")
// target directory for lexer
targetDir.set("src/main/gen/org/serenityos/jakt/lexer/")
// target classname, target file will be targetDir/targetClass.java
targetClass.set("JaktLexer.java")
skeleton
// if set, plugin will remove a lexer output file before generating new one. Default: false
purgeOldFiles.set(true)
}
wrapper {
gradleVersion = properties("gradleVersion")
}
test {
testLogging {
events = setOf(TestLogEvent.FAILED)
showExceptions = true
exceptionFormat = TestExceptionFormat.FULL
showCauses = true
showStackTraces = true
}
}
patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
untilBuild.set(properties("pluginUntilBuild"))
}
runIdeForUiTests {
systemProperty("robot-server.port", "8082")
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
systemProperty("jb.consents.confirmation.enabled", "false")
jvmArgs("-Didea.ProcessCanceledException=disabled")
jvmArgs("-Dide.show.tips.on.startup.default.value=false")
}
}
grammarKit {
jflexRelease.set("1.7.0-1")
grammarKitRelease.set("2021.1.2")
intellijRelease.set("203.7717.81")
}