11import org.jetbrains.grammarkit.tasks.GenerateLexerTask
22import org.jetbrains.grammarkit.tasks.GenerateParserTask
3+ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
34import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
45
56plugins {
6- id(" org.jetbrains.intellij" ) version " 1.14 .1"
7- id(" org.jetbrains.kotlin.jvm" ) version " 1.8.22 "
8- id(" org.jetbrains.grammarkit" ) version " 2022.3.1 "
7+ id(" org.jetbrains.intellij.platform " ) version " 2.0 .1"
8+ id(" org.jetbrains.kotlin.jvm" ) version " 2.0.20 "
9+ id(" org.jetbrains.grammarkit" ) version " 2022.3.2.2 "
910}
1011
1112repositories {
1213 mavenCentral()
14+ intellijPlatform {
15+ defaultRepositories()
16+ }
1317}
1418
1519// Java target version
@@ -31,6 +35,15 @@ kotlin {
3135}
3236
3337dependencies {
38+ intellijPlatform {
39+ intellijIdeaCommunity(" 2024.2.1" )
40+
41+ bundledPlugins(listOf (" com.intellij.java" ))
42+ instrumentationTools()
43+
44+ testFramework(TestFrameworkType .Platform )
45+ }
46+
3447 // From Kotlin documentation
3548 implementation(" org.jetbrains.kotlin:kotlin-stdlib:1.8.22" )
3649 // just in case, version number specified in buildscript is used by default
@@ -47,24 +60,30 @@ dependencies {
4760
4861// Configure Gradle IntelliJ Plugin
4962// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
50- intellij {
51- version.set(" 2023.1.2" )
52- type.set(" IC" ) // Target IDE Platform
63+ intellijPlatform {
64+ pluginConfiguration {
65+ // ...
66+
67+ version = " 1.4.0.1"
5368
54- plugins.set(listOf (" com.intellij.java" ))
69+ ideaVersion {
70+ sinceBuild = " 242.21829.142"
71+ untilBuild = provider { null }
72+ }
73+ }
5574}
5675
5776project(" :" ) {
5877 val generateLexer = task<GenerateLexerTask >(" generateMyLexer" ) {
5978 sourceFile.set(file(" src/main/grammar/KerboScript.flex" ))
60- targetDir .set(" src/gen/ksp/kos/ideaplugin/parser" )
61- targetClass.set(" KerboScriptLexer" )
79+ targetOutputDir .set(file( " src/gen/ksp/kos/ideaplugin/parser" ) )
80+ // targetClass.set("KerboScriptLexer")
6281 purgeOldFiles.set(true )
6382 }
6483
6584 val generateParser = task<GenerateParserTask >(" generateMyParser" ) {
6685 sourceFile.set(file(" src/main/grammar/KerboScript.bnf" ))
67- targetRoot .set(" src/gen" )
86+ targetRootOutputDir .set(file( " src/gen" ) )
6887 pathToParser.set(" /ksp/kos/ideaplugin/parser/KerboScriptParser.java" )
6988 pathToPsiRoot.set(" /ksp/kos/ideaplugin/psi" )
7089 purgeOldFiles.set(true )
@@ -85,7 +104,7 @@ project(":") {
85104 getByName<KotlinCompile >(it) {
86105 kotlinOptions {
87106 jvmTarget = " 17"
88- freeCompilerArgs = listOf (" -Xjvm-default=enable " )
107+ freeCompilerArgs = listOf (" -Xjvm-default=all " )
89108 }
90109 }
91110 }
@@ -106,7 +125,6 @@ tasks.test {
106125allprojects {
107126 gradle.projectsEvaluated {
108127 tasks.withType<JavaCompile > {
109- options.compilerArgs.add(" -Werror" )
110128 options.compilerArgs.add(" -Xlint:all" )
111129 options.compilerArgs.add(" -Xlint:-serial" )
112130 }
0 commit comments