@@ -3,16 +3,15 @@ import org.jetbrains.grammarkit.tasks.GenerateLexerTask
33import org.jetbrains.grammarkit.tasks.GenerateParserTask
44import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
55import org.jetbrains.intellij.platform.gradle.TestFrameworkType
6- import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
76import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
87
98plugins {
109 id(" java" )
1110 id(" maven-publish" )
1211 id(" org.jetbrains.kotlin.jvm" ) version " 2.3.0"
1312 id(" com.github.blueboxware.tocme" ) version " 1.8"
14- id(" org.jetbrains.intellij.platform" ) version " 2.10.5 "
15- id(" org.jetbrains.grammarkit" ) version " 2023 .3.0.1 "
13+ id(" org.jetbrains.intellij.platform" ) version " 2.11.0 "
14+ id(" org.jetbrains.grammarkit" ) version " 2022 .3.2.2 "
1615}
1716
1817group = providers.gradleProperty(" pluginGroup" ).get()
@@ -28,7 +27,7 @@ repositories {
2827
2928dependencies {
3029 intellijPlatform {
31- intellijIdeaCommunity (providers.gradleProperty(" platformVersion" )) {
30+ intellijIdea (providers.gradleProperty(" platformVersion" )) {
3231 useInstaller = false
3332 }
3433 bundledPlugins(providers.gradleProperty(" platformBundledPlugins" ).map { it.split(' ,' ) })
@@ -55,9 +54,9 @@ intellijPlatform {
5554 }
5655 pluginVerification {
5756 ides {
58- // create(IntelliJPlatformType.IntellijIdeaCommunity, "253-EAP-SNAPSHOT" )
59- create(IntelliJPlatformType .IntellijIdeaCommunity , providers.gradleProperty( " platformVersion " ).get() )
60- recommended()
57+ create(IntelliJPlatformType .IntellijIdea , providers.gradleProperty( " platformVersion " ).get() )
58+ // create(IntelliJPlatformType.IntellijIdea, "LATEST-EAP-SNAPSHOT" )
59+ // recommended()
6160 }
6261 }
6362}
@@ -100,7 +99,7 @@ tasks {
10099 systemProperties = mapOf (
101100 " idea.ProcessCanceledException" to " disabled" ,
102101 " idea.is.internal" to " true" ,
103- " idea.kotlin.plugin.use.k2 " to " true "
102+ " idea.kotlin.plugin.use.k1 " to " false "
104103 )
105104 }
106105
@@ -120,7 +119,7 @@ tasks {
120119 include(" com/gmail/blueboxware/libgdxplugin/ShowInfo.class" )
121120 exclude(" **/*$*.class" )
122121 jvmArgumentProviders + = CommandLineArgumentProvider {
123- listOf (" -Didea.kotlin.plugin.use.k2=true " )
122+ listOf (" -Didea.kotlin.plugin.use.k1=false " )
124123 }
125124 }
126125
@@ -140,36 +139,21 @@ tasks {
140139 archiveVersion.set(providers.gradleProperty(" pluginVersion" ))
141140 }
142141
143- withType<PrepareSandboxTask > {
144- doLast {
145- val trustedPathsFile = sandboxConfigDirectory.file(" options/trusted-paths.xml" ).get().asFile
146-
147- trustedPathsFile.writeText(
148- """
149- <application>
150- <component name="Trusted.Paths.Settings">
151- <option name="TRUSTED_PATHS">
152- <list>
153- <option value="${' $' } USER_HOME$/projects" />
154- </list>
155- </option>
156- </component>
157- <component name="Trusted.Paths.Settings">
158- <option name="TRUSTED_PATHS">
159- <list>
160- <option value="${' $' } USER_HOME$/temp" />
161- </list>
162- </option>
163- </component>
164- </application>
165- """ .trimIndent()
166- )
167- }
168- }
169-
170142 fun generateParserTask (path : String , lexer : String , parser : String ) {
143+
171144 val name = path.uppercaseFirstChar()
172145 val bnfTask = register<GenerateParserTask >(" generate${name} Parser" ) {
146+
147+ // TODO: Remove
148+ // https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/223
149+ // https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/225
150+ val platformLibs = intellijPlatform.platformPath.resolve(" lib" )
151+ classpath + = fileTree(platformLibs) {
152+ include(" *.jar" )
153+ }
154+ // /TODO
155+
156+
173157 sourceFile = file(" src/main/kotlin/com/gmail/blueboxware/libgdxplugin/filetypes/$path /$parser .bnf" )
174158 targetRootOutputDir = file(" gen" )
175159 pathToParser = " gen/com/gmail/blueboxware/libgdxplugin/filetypes/$path "
0 commit comments