-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
88 lines (73 loc) · 2.12 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "1.9.23"
id("org.jetbrains.intellij") version "1.17.3"
id("org.jetbrains.grammarkit") version "2022.3.2.2"
id("com.diffplug.spotless") version "6.25.0"
}
group = "fgd"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
sourceSets["main"].java.srcDirs("src/main/gen/lexer", "src/main/gen/parser")
intellij {
version.set("2023.3.3")
type.set("IC")
plugins.set(listOf())
}
spotless {
isEnforceCheck = false
kotlin {
targetExclude("**/build/**")
ktlint("1.2.1")
.setEditorConfigPath("$projectDir/.editorconfig")
.editorConfigOverride(
mapOf(
"ktlint_standard_no-wildcard-imports" to "disabled",
),
)
isEnforceCheck = "true" == System.getProperty("CI")
}
}
tasks {
generateLexer {
sourceFile = file("src/main/grammar/Fgd.flex")
targetOutputDir = file("src/main/gen/lexer/org/intellij/sdk/language")
purgeOldFiles = true
}
generateParser {
sourceFile = file("src/main/grammar/Fgd.bnf")
targetRootOutputDir = file("src/main/gen/parser")
pathToParser = "org/org/intellij/sdk/language/parser/FgdParser.java"
pathToPsiRoot = "org/intellij/sdk/language/psi"
purgeOldFiles = true
}
withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
// Unfortunately not compatible with two pass generation which is needed for mixins
dependsOn(generateLexer, generateParser)
}
patchPluginXml {
sinceBuild.set("233")
untilBuild.set("241.*")
}
signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
token.set(System.getenv("PUBLISH_TOKEN"))
}
wrapper {
gradleVersion = "8.7"
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-bin.zip"
distributionSha256Sum = "544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d"
}
}