Giter Site home page Giter Site logo

jetbrains / gradle-grammar-kit-plugin Goto Github PK

View Code? Open in Web Editor NEW
87.0 42.0 18.0 799 KB

Gradle plugin for generating lexers (with JFlex) and BNF parsers (with Grammar-Kit) for IntelliJ language plugins

License: Apache License 2.0

Kotlin 94.46% Lex 5.54%
intellij bnf jflex gradle-plugin

gradle-grammar-kit-plugin's Introduction

official JetBrains project Gradle Plugin Portal Build Status X Follow Slack

Gradle Grammar-Kit Plugin

This Gradle plugin automates generating lexers and parsers to support building custom language plugins for IntelliJ-based IDEs when using Grammar-Kit.

Documentation

The documentation of the Gradle Grammar-Kit Plugin has moved to the IntelliJ Platform Plugin SDK Documentation: https://plugins.jetbrains.com/docs/intellij/tools-gradle-grammar-kit-plugin.html

Changelog

All releases are available in the Releases section. The latest available version is:

Gradle Plugin Portal

Contributing

Please see CONTRIBUTING on how to submit feedback and contribute to this project.

License

Licensed under the Apache License, Version 2.0 (the "License"), see LICENCE.

gradle-grammar-kit-plugin's People

Contributors

3flex avatar actions-user avatar chris-laplante avatar dependabot[bot] avatar exidex avatar garyttierney avatar hfhbd avatar hsz avatar hurricup avatar maciejg604 avatar matklad avatar mfilippov avatar serceman avatar trubitsyn avatar undin avatar yanncebron avatar yorlov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradle-grammar-kit-plugin's Issues

Failed to create directory property 'targetDir'

Hi,

I'm trying to upgrade to the latest version of this plugin but I get this error:

Execution failed for task ':generateLexer'.
> Failed to create directory 'C:\Users\lukas\Development\Torque3D\IDEA\task ':generateLexer' property 'targetDir''

This looks to me like somewhere is missing a call to .get.

I have attached my build.gradle.kts file.

I tried looking through the code in master, but couldn't find any obvious mistake, I'm probably missing something.

build.gradle.kts.txt

PicoContainer not on classpath

Exception in thread "main" java.lang.NoClassDefFoundError: org/picocontainer/ComponentAdapter
	at org.intellij.grammar.LightPsi$MyParsing.<init>(LightPsi.java:191)
	at org.intellij.grammar.LightPsi.<clinit>(LightPsi.java:93)
	at org.intellij.grammar.Main.main(Main.java:49)
Caused by: java.lang.ClassNotFoundException: org.picocontainer.ComponentAdapter
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 3 more

happens when trying to generate the parser. Looks like theres a reference from here: https://github.com/JetBrains/Grammar-Kit/blob/master/src/org/intellij/grammar/LightPsi.java#L73

and the main grammar kit project just has it included as a jar in the libs/ directory.

Exception in thread "main" java.lang.NoClassDefFoundError: it/unimi/dsi/fastutil/Hash$Strategy while generating parser

Hi

I happened to see this build failure when I switch to use new JetBrain sdk release 2020.2, (before it was fine).

it failed to build because the exception:

> Task :pegasusplugin:generatePdlParser FAILED
Exception in thread "main" java.lang.NoClassDefFoundError: it/unimi/dsi/fastutil/Hash$Strategy
        at com.intellij.core.CoreFileTypeRegistry.<init>(CoreFileTypeRegistry.java:23)
        at com.intellij.core.CoreApplicationEnvironment.<init>(CoreApplicationEnvironment.java:83)
        at com.intellij.core.CoreApplicationEnvironment.<init>(CoreApplicationEnvironment.java:74)
        at org.intellij.grammar.LightPsi$MyParsing.<init>(LightPsi.java:166)
        at org.intellij.grammar.LightPsi.<clinit>(LightPsi.java:65)
        at org.intellij.grammar.Main.main(Main.java:49)
Caused by: java.lang.ClassNotFoundException: it.unimi.dsi.fastutil.Hash$Strategy
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 6 more

After I switch back to use 2020.1, it builds fine.

How should I solve this problem? Will it be necessary to have changes from JetBrain ?

This is happening while generate parse gradle task is running

Republishing needed GrammarKit and IntelliJ dependencies as shadow Jar on MavenCentral

Is your feature request related to a problem? Please describe.
The code generation needs GrammarKit and some IntelliJ dependencies. These dependencies are only published on internal repos.
These repos are added by this plugin under the hood, if you don't use the new dependency resolution management #73 and #106.
If you use the new dependency resolution management, you have to add the IntelliJ repos too.

Describe the solution you'd like
Create a uber/fat/shadow jar containing all needed dependencies for the lexer and the parser and publish these dependencies at mavenCentral. Ideally, these dependencies are fine-tuned to only included needed deps, but no IntelliJ overhead (eg UI).

Describe alternatives you've considered
Keep the current state by also depending on the internal repos.

Additional context
We already did this in sqldelight, a sql compiler using the IntelliJ compiler apis, which makes the consumer usage way nicer: cashapp/sqldelight#4079
Additionally, the Kotlin compiler uses this technique too, except it contains the shaded deps directly in the jar, this is the reason for the size of 56MB.

If you accept such change, I am open to create a PR.

Include required libs on the task classpath

Currently the Generate tasks pull their dependencies off of the compile classpath, in my downstream project I manually add maven dependencies to the classpath of the task like this:

  dependencies {
    maven { url 'https://www.jetbrains.com/intellij-repository/releases' }
    maven { url "https://cache-redirector.jetbrains.com/intellij-dependencies" }
  }

  configurations {
    grammar
  }

  dependencies {
    grammar "com.jetbrains.intellij.platform:indexing-impl:$ideaVersion"
    grammar "com.jetbrains.intellij.platform:analysis-impl:$ideaVersion"
    grammar "org.jetbrains.intellij.deps:asm-all:7.0.1"
  }

  tasks.withType(GenerateParser).configureEach {
    classpath = configurations.grammar + configurations.compileOnly
  }

Which I'm okay doing, but I wonder if there would be any interest in upstreaming this behavior now that the dependencies are all proper maven coordinates? I'd be happy to contribute such a change if it makes sense, but wanted to check in case its undesirable

Can I customize repositories?

Hello:

image

Can I customize repositories?

I cannot access this address. We have built an internal Maven repository. Can I customize the Maven repository address?

"Could not find or load main class org.intellij.grammar.Main" after update from 2021.1.3 to 2021.2

I have updated the plugin from 2021.1.3 to 2021.2 and updated the use of the lazy properties.
However, I get an error Could not find or load main class org.intellij.grammar.Main now.
Are there more steps needed for the update?

Full error:

> Task :generateParser
classpath='[/home/runner/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.rider/riderRD/2021.2.1/115c8942017ccf1e021d73d149c94c8d98d6884b/riderRD-2021.2.1/lib/3rd-party.jar, /home/runner/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.rider/riderRD/2021.2.1/115c8942017ccf1e021d73d149c94c8d98d6884b/riderRD-2021.2.1/lib/annotations-20.1.0.jar, /home/runner/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.rider/riderRD/2021.2.1/115c8942017ccf1e021d73d149c94c8d98d6884b/riderRD-2021.2.1/lib/annotations-java5.jar, /home/runner/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.rider/riderRD/2021.2.1/115c8942017ccf1e021d73d149c94c8d98d6884b/riderRD-2021.2.1/lib/openapi.jar, /home/runner/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.rider/riderRD/2021.2.1/115c8942017ccf1e021d73d149c94c8d98d6884b/riderRD-2021.2.1/lib/platform-api.jar, /home/runner/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.rider/riderRD/2021.2.1/115c8942017ccf1e021d73d149c94c8d98d6884b/riderRD-2021.2.1/lib/platform-impl.jar, /home/runner/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.rider/riderRD/2021.2.1/115c8942017ccf1e021d73d149c94c8d98d6884b/riderRD-2021.2.1/lib/util.jar, /home/runner/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/22.0.0/fb9bebc90794c7602e73d6ed0cb165a0c650be62/annotations-22.0.0.jar]'
Error: Could not find or load main class org.intellij.grammar.Main
Caused by: java.lang.ClassNotFoundException: org.intellij.grammar.Main

> Task :generateParser FAILED

MergeQuery class can not be found with 2020.1

Environment:

  • org.jetbrains.grammarkit: 2019.3
  • intellij.version: IU-201.3803-EAP-CANDIDATE-SNAPSHOT

While parser generationI get the following exception.

stacktrace

java.lang.NoClassDefFoundError: com/intellij/util/MergeQuery
	at com.intellij.psi.search.searches.ReferencesSearch.search(ReferencesSearch.java:173)
	at com.intellij.psi.search.searches.ReferencesSearch.search(ReferencesSearch.java:153)
	at com.intellij.psi.search.searches.ReferencesSearch.search(ReferencesSearch.java:139)
	at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:152)
	at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
	at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:207)
	at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirst(BnfFirstNextAnalyzer.java:90)
	at org.intellij.grammar.generator.ParserGenerator.generateFirstCheck(ParserGenerator.java:1094)
	at org.intellij.grammar.generator.ParserGenerator.generateNode(ParserGenerator.java:899)
	at org.intellij.grammar.generator.ParserGenerator.generateParser(ParserGenerator.java:568)
	at org.intellij.grammar.generator.ParserGenerator.generateParser(ParserGenerator.java:521)
	at org.intellij.grammar.generator.ParserGenerator.generate(ParserGenerator.java:369)
	at org.intellij.grammar.Main.main(Main.java:85)
Caused by: java.lang.ClassNotFoundException: com.intellij.util.MergeQuery
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 13 more

The cause was moved MergeQuery class from platform-api module to platform-concurrency one. Since gradle-grammar-kit-plugin uses a restricted list of jars as classpath of Grammar Kit, it leads to NoClassDefFoundError

ClassNotFoundException: com.intellij.mock.MockProjectEx

Not sure if related to GrammarKit or the gradle-grammar-kit-plugin. Updating to 2019.1 2018.3.1 caused the following error on this project (works fine on 2018.3):

1:42:49 AM: Executing task 'runIde --stacktrace'...

> Task :wrapper

BUILD SUCCESSFUL in 9s
1 actionable task: 1 executed
> Task :Bootstrap_CONDA_'Miniconda2' SKIPPED
> Task :build_condas UP-TO-DATE
> Task :build_conda_envs SKIPPED
> Task :build_pythons SKIPPED
> Task :build_pythons_from_zip SKIPPED
> Task :build_virtual_envs SKIPPED
> Task :build_envs UP-TO-DATE

> Task :generateROSInterfaceLexer
Reading "/home/breandan/IdeaProjects/hatchery/src/main/grammars/ROSInterface.flex"
Constructing NFA : 76 states in NFA
Converting NFA to DFA : 
..........................................
52 states before minimization, 27 states in minimized DFA
Old file "/home/breandan/IdeaProjects/hatchery/src/main/java/edu/umontreal/hatchery/rosinterface/RosInterfaceLexer.java" saved as "/home/breandan/IdeaProjects/hatchery/src/main/java/edu/umontreal/hatchery/rosinterface/RosInterfaceLexer.java~"
Writing code to "/home/breandan/IdeaProjects/hatchery/src/main/java/edu/umontreal/hatchery/rosinterface/RosInterfaceLexer.java"

> Task :generateROSInterfaceParser FAILED
Exception in thread "main" java.lang.NoClassDefFoundError: com/intellij/mock/MockProjectEx
	at org.intellij.grammar.LightPsi$MyParsing.<init>(LightPsi.java:191)
	at org.intellij.grammar.LightPsi.<clinit>(LightPsi.java:93)
	at org.intellij.grammar.Main.main(Main.java:49)
Caused by: java.lang.ClassNotFoundException: com.intellij.mock.MockProjectEx
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 3 more

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateROSInterfaceParser'.
> Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 1

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':generateROSInterfaceParser'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.accept(ExecuteActionsTaskExecuter.java:121)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.accept(ExecuteActionsTaskExecuter.java:117)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:184)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:110)
	at org.gradle.api.internal.tasks.execution.ResolveIncrementalChangesTaskExecuter.execute(ResolveIncrementalChangesTaskExecuter.java:84)
	at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:92)
	at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:110)
	at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
	at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:63)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:46)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 1
	at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:396)
	at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:38)
	at org.gradle.api.tasks.JavaExec.exec(JavaExec.java:81)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:701)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:668)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$4.run(ExecuteActionsTaskExecuter.java:337)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:326)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:311)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:75)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:158)
	at org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:46)
	at org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)
	at org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)
	at org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)
	at org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
	at org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:49)
	at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:42)
	at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:28)
	at org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:136)
	at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:60)
	at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:37)
	at org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)
	at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)
	at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)
	at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:95)
	at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:88)
	at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
	at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
	at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:109)
	... 37 more


* Get more help at https://help.gradle.org

BUILD FAILED in 2s
2 actionable tasks: 2 executed
Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 1
1:43:01 AM: Task execution finished 'runIde --stacktrace'.

Bug: generated lexer doesn't compile

Steps to reproduce:

configure<GrammarKitPluginExtension> {
	jflexRelease = "c779429" // 1.7.0
	grammarKitRelease = "2017.1.2"
}

And you'll see compilation error.
I guess it's because the jflex skeleton is broken but I'm not sure.

Problem with parser generator in ForTea

I have error:

Starting process 'command 'C:\Users\mfilippov\.jdks\corretto-11.0.12\bin\java.exe''. Working directory: C:\Work\GitHub\ForTea\Frontend Command: C:\Users\mfilippov\.jdks\corretto-11.0.12\bin\java.exe -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\mfilippov\.gradle\caches\modules-2\files-2.1\com.github.JetBrains\Grammar-Kit\f36763f5826e82a510362031e49863aaf5a27311\3d5cd65d3347ac81d7fa8c917a67784d2a0d47d4\Grammar-Kit-f36763f5826e82a510362031e49863aaf5a27311.jar;C:\Work\GitHub\ForTea\Frontend\build\rider\lib\3rd-party-rt.jar;C:\Work\GitHub\ForTea\Frontend\build\rider\lib\annotations-java5.jar;C:\Work\GitHub\ForTea\Frontend\build\rider\lib\openapi.jar;C:\Work\GitHub\ForTea\Frontend\build\rider\lib\platform-api.jar;C:\Work\GitHub\ForTea\Frontend\build\rider\lib\platform-impl.jar;C:\Work\GitHub\ForTea\Frontend\build\rider\lib\util.jar;C:\Users\mfilippov\.gradle\caches\modules-2\files-2.1\org.jetbrains\annotations\21.0.0\d5170074fe1d4a26ae19da3b1b2c0d102b0b8a41\annotations-21.0.0.jar org.intellij.grammar.Main C:\Work\GitHub\ForTea\Frontend\src\main\java C:\Work\GitHub\ForTea\Frontend\src\main\kotlin\com\jetbrains\fortea\parser\T4.bnf
Successfully started process 'command 'C:\Users\mfilippov\.jdks\corretto-11.0.12\bin\java.exe''
:generateT4Parser (Thread[Execution worker for ':',5,main]) completed. Took 0.796 secs.
WARN: Attempt to load key 'psi.incremental.reparse.depth.limit' for not yet loaded registry
java.lang.NoClassDefFoundError: com/intellij/psi/PsiModifierListOwner
	at org.intellij.grammar.java.JavaHelper$AsmHelper$MySignatureVisitor.visitFormalTypeParameter(JavaHelper.java:829)
	at org.jetbrains.org.objectweb.asm.signature.SignatureReader.accept(SignatureReader.java:79)
	at org.intellij.grammar.java.JavaHelper$AsmHelper.getMethodInfo(JavaHelper.java:607)
	at org.intellij.grammar.java.JavaHelper$AsmHelper$MyClassVisitor.visitMethod(JavaHelper.java:673)
	at org.jetbrains.org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1331)
	at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:722)
	at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:402)
	at org.intellij.grammar.java.JavaHelper$AsmHelper.getClassInfo(JavaHelper.java:596)
	at org.intellij.grammar.java.JavaHelper$AsmHelper.findClassSafe(JavaHelper.java:585)
	at org.intellij.grammar.java.JavaHelper$AsmHelper.getSuperClassName(JavaHelper.java:496)
	at org.intellij.grammar.generator.ParserGenerator.lambda$calcRealSuperClasses$2(ParserGenerator.java:285)
	at com.intellij.util.containers.FilteredTraverserBase$Meta.childrenImpl(FilteredTraverserBase.java:436)
	at com.intellij.util.containers.FilteredTraverserBase$Meta.children(FilteredTraverserBase.java:422)
	at com.intellij.util.containers.FilteredTraverserBase.children(FilteredTraverserBase.java:303)
	at com.intellij.util.containers.TreeTraversal$2$1WrappedTree.fun(TreeTraversal.java:121)
	at com.intellij.util.containers.TreeTraversal$2$1WrappedTree.fun(TreeTraversal.java:108)
	at com.intellij.util.containers.TreeTraversal$P.iterable(TreeTraversal.java:805)
	at com.intellij.util.containers.TreeTraversal$P.iterator(TreeTraversal.java:799)
	at com.intellij.util.containers.TreeTraversal$BiOrderIt.nextImpl(TreeTraversal.java:540)
	at com.intellij.util.containers.JBIterator.peekNext(JBIterator.java:150)
	at com.intellij.util.containers.JBIterator.hasNext(JBIterator.java:110)
	at com.intellij.util.containers.JBIterable$FlattenFun$FlattenIt.nextImpl(JBIterable.java:469)
	at com.intellij.util.containers.JBIterator.peekNext(JBIterator.java:150)
	at com.intellij.util.containers.JBIterator.hasNext(JBIterator.java:110)
	at com.intellij.util.containers.JBIterable.first(JBIterable.java:546)

Looks like we need com.intellij.psi.PsiModifierListOwner which part of module: "intellij.java.psi" which part of:

      [
        "intellij.java.compiler",
        "intellij.java.debugger",
        "intellij.java.execution",
        "intellij.java.remoteServers",
        "intellij.java.analysis",
        "intellij.jvm.analysis",
        "intellij.java.indexing",
        "intellij.java.psi",
        "intellij.java",
        "intellij.jsp",
        "intellij.platform.uast"
      ].each {
        withModule(it, "java-api.jar")
        ```

Could not find dev.thiagosouto:plugin:1.3.4 with `org.jetbrains.grammarkit` 2021.2.1

In IntelliJ Rust plugin we have a task to resolve all gradle configurations. We use it to separate downloading of dependencies from compilation on CI.
But with org.jetbrains.grammarkit 2021.2.1, the task starts failing with the following message

Execution failed for task ':resolveDependencies'.
> Could not resolve all files for configuration ':bomConfiguration'.
   > Could not find dev.thiagosouto:plugin:1.3.4.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/dev/thiagosouto/plugin/1.3.4/plugin-1.3.4.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/dev/thiagosouto/plugin/1.3.4/plugin-1.3.4.pom
       - https://repo.maven.apache.org/maven2/dev/thiagosouto/plugin/1.3.4/plugin-1.3.4.pom

gradle dependencies task also fails to resolve bomConfiguration

So, the question is: do you really need dev.thiagosouto:plugin plugin? And if yes, how is it supposed to be resolved?

Problem with unavailable dependencies

I'm trying to update the dependencies of my plugin but cannot get it to work. On my latest attempt I get the following bug.

Describe the bug
Some dependencies cannot be resolved by the plugin for the grammarKitClassPath configuration:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':generateLexer'.
> Could not resolve all files for configuration ':grammarKitClassPath'.
   > Could not find com.jetbrains.infra:download-pgp-verifier:1.0.2.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/com/jetbrains/infra/download-pgp-verifier/1.0.2/download-pgp-verifier-1.0.2.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/com/jetbrains/infra/download-pgp-verifier/1.0.2/download-pgp-verifier-1.0.2.pom
       - https://repo.maven.apache.org/maven2/com/jetbrains/infra/download-pgp-verifier/1.0.2/download-pgp-verifier-1.0.2.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/com.jetbrains.infra/download-pgp-verifier/1.0.2/ivy-1.0.2.xml
       - file:$CWD/deps/ideaIC-231.9011.34/download-pgp-verifier-1.0.2-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.remoteDev:remote-dev-util:231.9011.34
   > Could not find ai.grazie.spell:gec-spell-engine-local-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/spell/gec-spell-engine-local-jvm/0.2.112/gec-spell-engine-local-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/spell/gec-spell-engine-local-jvm/0.2.112/gec-spell-engine-local-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/spell/gec-spell-engine-local-jvm/0.2.112/gec-spell-engine-local-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.spell/gec-spell-engine-local-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/gec-spell-engine-local-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.utils:utils-common-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/utils/utils-common-jvm/0.2.112/utils-common-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/utils/utils-common-jvm/0.2.112/utils-common-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/utils/utils-common-jvm/0.2.112/utils-common-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.utils/utils-common-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/utils-common-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.nlp:nlp-common-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/nlp/nlp-common-jvm/0.2.112/nlp-common-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/nlp/nlp-common-jvm/0.2.112/nlp-common-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/nlp/nlp-common-jvm/0.2.112/nlp-common-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.nlp/nlp-common-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/nlp-common-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.nlp:nlp-tokenizer-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/nlp/nlp-tokenizer-jvm/0.2.112/nlp-tokenizer-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/nlp/nlp-tokenizer-jvm/0.2.112/nlp-tokenizer-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/nlp/nlp-tokenizer-jvm/0.2.112/nlp-tokenizer-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.nlp/nlp-tokenizer-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/nlp-tokenizer-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.nlp:nlp-langs-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/nlp/nlp-langs-jvm/0.2.112/nlp-langs-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/nlp/nlp-langs-jvm/0.2.112/nlp-langs-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/nlp/nlp-langs-jvm/0.2.112/nlp-langs-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.nlp/nlp-langs-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/nlp-langs-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.nlp:nlp-similarity-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/nlp/nlp-similarity-jvm/0.2.112/nlp-similarity-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/nlp/nlp-similarity-jvm/0.2.112/nlp-similarity-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/nlp/nlp-similarity-jvm/0.2.112/nlp-similarity-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.nlp/nlp-similarity-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/nlp-similarity-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.nlp:nlp-patterns-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/nlp/nlp-patterns-jvm/0.2.112/nlp-patterns-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/nlp/nlp-patterns-jvm/0.2.112/nlp-patterns-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/nlp/nlp-patterns-jvm/0.2.112/nlp-patterns-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.nlp/nlp-patterns-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/nlp-patterns-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.nlp:nlp-phonetics-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/nlp/nlp-phonetics-jvm/0.2.112/nlp-phonetics-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/nlp/nlp-phonetics-jvm/0.2.112/nlp-phonetics-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/nlp/nlp-phonetics-jvm/0.2.112/nlp-phonetics-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.nlp/nlp-phonetics-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/nlp-phonetics-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.nlp:nlp-detect-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/nlp/nlp-detect-jvm/0.2.112/nlp-detect-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/nlp/nlp-detect-jvm/0.2.112/nlp-detect-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/nlp/nlp-detect-jvm/0.2.112/nlp-detect-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.nlp/nlp-detect-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/nlp-detect-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.spell:hunspell-en-jvm:0.2.16.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/spell/hunspell-en-jvm/0.2.16/hunspell-en-jvm-0.2.16.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/spell/hunspell-en-jvm/0.2.16/hunspell-en-jvm-0.2.16.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/spell/hunspell-en-jvm/0.2.16/hunspell-en-jvm-0.2.16.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.spell/hunspell-en-jvm/0.2.16/ivy-0.2.16.xml
       - file:$CWD/deps/ideaIC-231.9011.34/hunspell-en-jvm-0.2.16-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.nlp:nlp-stemmer-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/nlp/nlp-stemmer-jvm/0.2.112/nlp-stemmer-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/nlp/nlp-stemmer-jvm/0.2.112/nlp-stemmer-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/nlp/nlp-stemmer-jvm/0.2.112/nlp-stemmer-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.nlp/nlp-stemmer-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/nlp-stemmer-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.model:model-gec-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/model/model-gec-jvm/0.2.112/model-gec-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/model/model-gec-jvm/0.2.112/model-gec-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/model/model-gec-jvm/0.2.112/model-gec-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.model/model-gec-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/model-gec-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.model:model-text-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/model/model-text-jvm/0.2.112/model-text-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/model/model-text-jvm/0.2.112/model-text-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/model/model-text-jvm/0.2.112/model-text-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.model/model-text-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/model-text-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34
   > Could not find ai.grazie.model:model-common-jvm:0.2.112.
     Searched in the following locations:
       - https://cache-redirector.jetbrains.com/intellij-dependencies/ai/grazie/model/model-common-jvm/0.2.112/model-common-jvm-0.2.112.pom
       - https://cache-redirector.jetbrains.com/intellij-repository/releases/ai/grazie/model/model-common-jvm/0.2.112/model-common-jvm-0.2.112.pom
       - https://repo.maven.apache.org/maven2/ai/grazie/model/model-common-jvm/0.2.112/model-common-jvm-0.2.112.pom
       - file:$HOME/.gradle/daemon/8.1.1/deps/ideaIC-231.9011.34/ai.grazie.model/model-common-jvm/0.2.112/ivy-0.2.112.xml
       - file:$CWD/deps/ideaIC-231.9011.34/model-common-jvm-0.2.112-2-withSources.xml
     Required by:
         project : > com.jetbrains.intellij.platform:lang-impl:231.9011.34 > com.jetbrains.intellij.platform:ide-impl:231.9011.34 > com.jetbrains.intellij.platform:statistics-devkit:231.9011.34 > com.jetbrains.intellij.json:json:231.9011.34 > com.jetbrains.intellij.spellchecker:spellchecker:231.9011.34

These appear to be irrelevant to GrammarKit but they still fail the build.

To Reproduce
https://github.com/oowekyala/intellij-javacc/blob/deps-update/build.gradle.kts

git clone --branch deps-update [email protected]:oowekyala/intellij-javacc.git
cd intellij-javacc
./gradlew build

Expected behavior
A clear and concise description of what you expected to happen.

Environment:

  • OS: Ubuntu 22.04
  • Gradle Grammar-Kit Plugin Version 2022.3.1
  • Gradle Version 8.1.1

Additional context
Add any other context about the problem here.

Infinite analysis in BNF file in IDEA

If I open the Rust grammar in IDEA with Grammar Kit plugin, the analysis never completes and one thread uses 100% of the core (thread dump attached).

Grammar Kit plugin version: 2019.3
BNF file: https://github.com/intellij-rust/intellij-rust/blob/master/src/main/grammars/RustParser.bnf

IntelliJ IDEA 2019.3.3 (Ultimate Edition)
Build #IU-193.6494.35, built on February 11, 2020
Licensed to JetBrains Team

Runtime version: 11.0.5+10-b520.38 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.3.0-40-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 2014M
Cores: 4
Registry: ide.tooltip.initialDelay=400
Non-Bundled Plugins: Key Promoter X, PsiViewer, com.intellij.sisyphus, org.intellij.scala, org.jetbrains.kotlin, org.toml.lang, tanvd.grazi, org.rust.lang, com.jetbrains.edu, com.jetbrains.hackathon.indices.viewer, com.jetbrains.intellij.api.watcher, org.jetbrains.idea.grammar

Thread dump
"JobScheduler FJ pool 5/3" #337 daemon prio=4 os_prio=0 cpu=41941,88ms elapsed=1527,89s tid=0x00007fbdf934b800 nid=0x8df runnable  [0x00007fbd927f5000]
 java.lang.Thread.State: RUNNABLE
  at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor$ASTTreeGuide.getParent(RecursiveTreeElementWalkingVisitor.java:53)
  at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor$ASTTreeGuide.getParent(RecursiveTreeElementWalkingVisitor.java:35)
  at com.intellij.util.WalkingState.walkChildren(WalkingState.java:67)
  at com.intellij.util.WalkingState.elementStarted(WalkingState.java:52)
  at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor.visitNode(RecursiveTreeElementWalkingVisitor.java:86)
  at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor.visitComposite(RecursiveTreeElementWalkingVisitor.java:81)
  at com.intellij.psi.impl.source.tree.AstBufferUtil$BufferVisitor.visitComposite(AstBufferUtil.java:115)
  at com.intellij.psi.impl.source.tree.CompositeElement.acceptTree(CompositeElement.java:130)
  at com.intellij.psi.impl.source.tree.AstBufferUtil.toBuffer(AstBufferUtil.java:40)
  at com.intellij.psi.impl.source.tree.AstBufferUtil.toBuffer(AstBufferUtil.java:35)
  at com.intellij.psi.impl.source.tree.CompositeElement.textToCharArray(CompositeElement.java:244)
  at com.intellij.psi.impl.source.tree.CompositeElement.getText(CompositeElement.java:225)
  at org.intellij.grammar.generator.ParserGeneratorUtil.getTokenName(ParserGeneratorUtil.java:633)
  at org.intellij.grammar.generator.ParserGeneratorUtil.getTokenNames(ParserGeneratorUtil.java:621)
  at org.intellij.grammar.generator.ParserGeneratorUtil.getTokenNames(ParserGeneratorUtil.java:614)
  at org.intellij.grammar.generator.ParserGeneratorUtil.isTokenSequence(ParserGeneratorUtil.java:649)
  at org.intellij.grammar.psi.impl.GrammarUtil.processExpressionNames(GrammarUtil.java:143)
  at org.intellij.grammar.psi.impl.GrammarUtil.processExpressionNames(GrammarUtil.java:145)
  at org.intellij.grammar.psi.impl.GrammarUtil.processPinnedExpressions(GrammarUtil.java:155)
  at org.intellij.grammar.psi.impl.GrammarUtil.processPinnedExpressions(GrammarUtil.java:151)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:183)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:252)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:243)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:252)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:243)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:252)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:243)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:252)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:243)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:252)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:243)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:252)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:243)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcSequenceFirstInner(BnfFirstNextAnalyzer.java:198)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcNextInner(BnfFirstNextAnalyzer.java:129)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:318)
  at org.intellij.grammar.analysis.BnfFirstNextAnalyzer.calcFirstInner(BnfFirstNextAnalyzer.java:207)
  at org.intellij.grammar.inspection.BnfUnreachableChoiceBranchInspection.checkChoice(BnfUnreachableChoiceBranchInspection.java:60)
  at org.intellij.grammar.inspection.BnfUnreachableChoiceBranchInspection.access$000(BnfUnreachableChoiceBranchInspection.java:40)
  at org.intellij.grammar.inspection.BnfUnreachableChoiceBranchInspection$1.visitChoice(BnfUnreachableChoiceBranchInspection.java:47)
  at org.intellij.grammar.inspection.BnfUnreachableChoiceBranchInspection$1.visitChoice(BnfUnreachableChoiceBranchInspection.java:44)
  at org.intellij.grammar.psi.impl.BnfChoiceImpl.accept(BnfChoiceImpl.java:35)
  at org.intellij.grammar.psi.impl.BnfChoiceImpl.accept(BnfChoiceImpl.java:39)
  at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:77)
  at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$null$6(LocalInspectionsPass.java:332)
  at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$$Lambda$4072/0x0000000102c01440.run(Unknown Source)
  at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:167)
  at com.intellij.util.AstLoadingFilter$$Lambda$2248/0x0000000101c58440.compute(Unknown Source)
  at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:125)
  at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:114)
  at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:109)
  at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:331)
  at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$$Lambda$4071/0x0000000102c01040.process(Unknown Source)
  at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:148)
  at com.intellij.concurrency.ApplierCompleter.tryToExecAllList(ApplierCompleter.java:227)
  at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:155)
  at com.intellij.concurrency.ApplierCompleter.tryToExecAllList(ApplierCompleter.java:227)
  at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:155)
  at com.intellij.concurrency.ApplierCompleter$$Lambda$4012/0x0000000102b5a440.run(Unknown Source)
  at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:997)
  at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
  at com.intellij.concurrency.ApplierCompleter$$Lambda$4013/0x0000000102b59840.run(Unknown Source)
  at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
  at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
  at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
  at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:116)
  at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
  at com.intellij.concurrency.ApplierCompleter$$Lambda$4011/0x0000000102b5a040.run(Unknown Source)
  at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
  at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:157)
  at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
  at java.util.concurrent.CountedCompleter.exec([email protected]/CountedCompleter.java:746)
  at java.util.concurrent.ForkJoinTask.doExec([email protected]/ForkJoinTask.java:290)
  at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec([email protected]/ForkJoinPool.java:1020)
  at java.util.concurrent.ForkJoinPool.scan([email protected]/ForkJoinPool.java:1656)
  at java.util.concurrent.ForkJoinPool.runWorker([email protected]/ForkJoinPool.java:1594)
  at java.util.concurrent.ForkJoinWorkerThread.run([email protected]/ForkJoinWorkerThread.java:177)

Plugin does not work as documented with Kotlin DSL

I have set up a new IntelliJ plugin project from the JetBrains/intellij-platform-plugin-template. When I try to add the GrammarKit plugin to my build.gradle.kts as described in README.md, I get the following output from Gradle:

* What went wrong:
Script compilation errors:

  Line 57:     jflexRelease.set("1.7.0-1")
                            ^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
                                public inline operator fun kotlin.text.StringBuilder /* = java.lang.StringBuilder */.set(index: Int, value: Char): Unit defined in kotlin.text

  Line 60:     grammarKitRelease.set("2021.1.2")
                                 ^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
                                     public inline operator fun kotlin.text.StringBuilder /* = java.lang.StringBuilder */.set(index: Int, value: Char): Unit defined in kotlin.text

  Line 63:     intellijRelease.set("203.7717.81")
                               ^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
                                   public inline operator fun kotlin.text.StringBuilder /* = java.lang.StringBuilder */.set(index: Int, value: Char): Unit defined in kotlin.text

3 errors

I have added the following to my build.gradle.kts:

plugins {
    // ... the other plugins from the plugin project template ...
    id("org.jetbrains.grammarkit") version "2021.1.3"
}

grammarKit {
    // Version of IntelliJ patched JFlex (see the link below), Default is 1.7.0-1
    jflexRelease.set("1.7.0-1")

    // Release version, tag, or short commit hash of Grammar-Kit to use (see link below). By default, the latest available is used.
    grammarKitRelease.set("2021.1.2")

    // Optionally provide an IntelliJ version to build the classpath for GenerateParser/GenerateLexer tasks
    intellijRelease.set("203.7717.81")
}

IntelliJ also highlights the calls to the set() method as errors. If I navigate to the source code of jflexRelease in IntelliJ, it shows me some Groovy code:

package org.jetbrains.grammarkit

class GrammarKitPluginExtension {
    def grammarKitRelease = '2020.3.1'
    def jflexRelease = '1.7.0-1'
    String intellijRelease = null
}

Since the current version of the plugin is implemented in Kotlin, this is definitely confusing. I have checked the contents of org.jetbrains.grammarkit:gradle-grammarkit-plugin:2021.1.3 from Maven Central. It definitely looks like it was compiled from Groovy code.

Has the plugin actually been published incorrectly?

Both `GenerateLexer` and `GenerateParser` are executed even if no actual changes in the sources

I have several tasks extending GenerateLexer and GenerateParser ones. Not sure, but after switching to Intellij IDEA 2021.1.3 these tasks started being executed without any changes to the sources. It's pretty annoying :(

It worked correctly before, but now:

  • subsequent executions of ./gradlew build doesn't trigger the execution of the tasks,
  • but if I execute a single test in IntelliJ IDEA, it executes the tasks although there are no changes in the sources at all.

Any idea?

The build.gradle:

plugins {
  ...
  id 'org.jetbrains.grammarkit' version '2021.1.3'
  ...
}

...

task generateSPARQLLexer(type: GenerateLexer) {
    // source flex file
    source = "src/main/grammar/SPARQL.flex"

    // target directory for lexer
    targetDir = "src/main/gen/com/sharedvocabs/plugins/rdfandsparql/sparql/parsing/"

    // target classname, target file will be targetDir/targetClass.java
    targetClass = "SPARQLLexer"

    // optional, path to the task-specific skeleton file. Default: none
    skeleton = 'src/main/grammar/idea-flex.skeleton'

    // if set, plugin will remove a lexer output file before generating new one. Default: false
    purgeOldFiles = true
}

task generateSPARQLParser(type: GenerateParser) {
    // source bnf file
    source = "src/main/grammar/SPARQL.bnf"

    // optional, task-specific root for the generated files. Default: none
    targetRoot = 'src/main/gen'

    // path to a parser file, relative to the targetRoot
    pathToParser = '/com/sharedvocabs/plugins/rdfandsparql/sparql/parsing/SPARQLParser.java'

    // path to a directory with generated psi files, relative to the targetRoot
    pathToPsiRoot = '/com/sharedvocabs/plugins/rdfandsparql/sparql/psi'

    // if set, plugin will remove a parser output file and psi output directory before generating new ones. Default: false
    purgeOldFiles = true
}

Environment:

  • Intellij IDEA 2021.1.3 (211.7628.21)
  • Gradle 7.0.2

Java 8 compatibility

I'm trying to create a new plugin for intellij using grammar kit. When I try to build with gradle I get the following error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/intellij/lang/LanguageBraceMatching has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

With the task defined as

task generatePdlParser(type: GenerateParser) {
  source = "${grammarPath}/Pdl.bnf"
  targetRoot = "${generatedGrammarJavaPath}"
  pathToParser = "/${basePackagePath}/parser/Parser.java"
  pathToPsiRoot = "/${basePackagePath}/psi"
  purgeOldFiles = true
}

Using grammar kit 2020.2.1 and intellij plugin 0.5.0.

All I can tell here is that this a Java 8 vs 11 issue. I'm not sure if this means I have to upgrade my entire project to 11 or if it is something locally on my machine I need to fix. Either way, help is appreciated.

Rely on `product-info.json` when building a calsspath for tasks

With IJ 241.9959.31, plugin fails to load all necessary classes:

Execution failed for task ':plugin:core:generatePerl5Parser'.
> Exception in thread "main" java.lang.NoClassDefFoundError: io/opentelemetry/api/trace/Tracer
  	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
  	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
  	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
  	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
  	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
  	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
  	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
  	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
  	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
  	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
  	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
  	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
  	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
  	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
  	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
  	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
  	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
  	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
  	at com.intellij.platform.diagnostic.telemetry.NoopTelemetryManager.getTracer(TelemetryManager.kt:137)
  	at com.intellij.openapi.progress.impl.CoreProgressManager.<clinit>(CoreProgressManager.java:49)
  	at com.intellij.core.CoreApplicationEnvironment.createProgressIndicatorProvider(CoreApplicationEnvironment.java:142)
  	at com.intellij.core.CoreApplicationEnvironment.<init>(CoreApplicationEnvironment.java:109)
  	at com.intellij.core.CoreApplicationEnvironment.<init>(CoreApplicationEnvironment.java:72)
  	at org.intellij.grammar.LightPsi$MyParsing.<init>(LightPsi.java:152)
  	at org.intellij.grammar.LightPsi.<clinit>(LightPsi.java:55)
  	at org.intellij.grammar.Main.main(Main.java:38)
  Caused by: java.lang.ClassNotFoundException: io.opentelemetry.api.trace.Tracer
  	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
  	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
  	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
  	... 26 more

This is because some classes were moved to a new opentelemetry.jar library, which is not listed in requiredLibs:

val requiredLibs = listOf(
"app", "lib", "jdom", "trove4j", "junit", "guava", "asm-all", "automaton", "platform-api", "platform-impl",
"util", "util_rt", "annotations", "picocontainer", "extensions", "idea", "openapi", "grammar-kit",
"platform-util-ui", "platform-concurrency", "intellij-deps-fastutil",
// CLion unlike IDEA contains `MockProjectEx` in `testFramework.jar` instead of `idea.jar`
// so this jar should be in `requiredLibs` list to avoid `NoClassDefFoundError` exception
// while parser generation with CLion distribution
"testFramework", "3rd-party",
)

Use the data from the product-info.json file delivered with IJ dependency to avoid such problems.
The missing jar is present in:

launch[].bootClassPathJarNames, so it'll be necessary to discover the proper OS and architecture, like it's done in IntelliJ Platform Gradle Plugin 2.0

`grammarKitRelease` option doesn't work for 2021 versions

Setting grammarKitRelease to any of the following versions works: 2019.3, 2020.1, 2020.3.1

Setting grammarKitRelease to any of the following versions does not work: 2020.3, 2021.1, 2021.1.1

Gradle error: "Could not find com.github.JetBrains:Grammar-Kit:2021.1.1."

id("org.jetbrains.grammarkit") version "2021.1.3"
Gradle 7.1
AdoptOpenJDK-11.0.11+9
macOS 11.4

Gradle 6.2.1 deprecation

> Task :generateArendLexer UP-TO-DATE
Property 'purgeOldFiles' is not annotated with an input or output annotation. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. See https://docs.gradle.org/6.2.1/userguide/more_about_tasks.html#sec:up_to_date_checks for more details.
Property 'skeleton' is not annotated with an input or output annotation. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. See https://docs.gradle.org/6.2.1/userguide/more_about_tasks.html#sec:up_to_date_checks for more details.

This message comes from the lexer generation task.

Does not work with Gradle 7.0

plugin: id "org.jetbrains.grammarkit" version '2020.3.2'

> Resolving dependency configuration 'compileOnly' is not allowed as it is defined as 'canBeResolved=false'.
  Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'compileOnly' should be resolved.

task setup

apply plugin: 'org.jetbrains.grammarkit'
import org.jetbrains.grammarkit.tasks.GenerateLexer

grammarKit {
  jflexRelease = '1.7.0-2'
}

task generateM68KLexer(type: GenerateLexer) {
  source = "src/grammar/_M68kLexer.flex"
  skeleton = "src/grammar/idea-flex.skeleton"
  targetDir = "gen/com/yanncebron/m68kplugin/lexer/"
  targetClass = "_M68kLexer"
  purgeOldFiles = true
}


WARN: registry accessed but not loaded yet

I get the following warnings:

> Task :generateArendParser
WARN: The registry key 'psi.track.invalidation' accessed, but not loaded yet
WARN: The registry key 'psi.incremental.reparse.depth.limit' accessed, but not loaded yet
BNF_RULE:letExpr: unexpected cardinality OPTIONAL of expr, treating as ATOM
BNF_RULE:lamExpr: unexpected cardinality OPTIONAL of expr, treating as ATOM
BNF_RULE:piExpr: unexpected cardinality OPTIONAL of expr, treating as ATOM
WARN: The registry key 'platform.random.idempotence.check.rate' accessed, but not loaded yet

Repo: https://github.com/JetBrains/intellij-arend/tree/eb029f2377cb81d62ec5159f064f383f590bd9b1

ImplUtil class not found

When the README says NB: plugin does not support two-pass generation, therefore does not suport method mixins. does this also mean that such constructions:

{  
  ...
  psiImplUtilClass="package.name.SomePsiImplUtil"
}

sql_statement ::= SQL_TOKEN  { methods=[isValidHost updateText createLiteralTextEscaper] implements="com.intellij.psi.PsiLanguageInjectionHost" }

are also not possible to use with a Gradle plugin? if yes, is it possible to provide more extensive explanation in the README? and are there plans/possibilities to support such functionality in the future?

Support Centralized Repository Declaration

Is your feature request related to a problem? Please describe.
Gradle adds incubating support to declare your repositories in your settings gradle file to secure your dependencies supply chain by only downloading dependencies from your declared repositories.

https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:centralized-repository-declaration

// settings.gradle.kts
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)

    repositories {
        mavenCentral()
        maven(url = "https://www.jetbrains.com/intellij-repository/releases")
        maven(url = "https://cache-redirector.jetbrains.com/intellij-dependencies")
        maven(url = "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies/")
        maven(url = "https://maven.pkg.jetbrains.space/public/p/ktor/eap")
    }
}

Describe the solution you'd like
Add a check to not include custom repositories if FAIL_ON_PROJECT_REPOS is set

Describe alternatives you've considered
Forking and removing the code adding the repositories

Additional context

Make `pathToParser` and `pathToPsiRoot` optional

Is your feature request related to a problem? Please describe.

When applying this plugin, you have to configure the tasks. The GenerateParserTask has the following two mandatory properties.

  • pathToParser
  • pathToPsiRoot

I was wondering why these properties are needed, and it seems that they are used only if the optional property purgeOldFiles is set to true. As the value of these properties seems to be unused in all other scenarios, I would like to not have to specify them. Also note that these properties duplicate information which is already specified in the *.bnf file. Therefore, having to specify these properties is not only unnecessary, but also opens up the possibility for inconsistent configurations.

Describe the solution you'd like

  • Mark pathToParser as optional
  • Mark pathToPsiRoot as optional

Describe alternatives you've considered

A maybe better but more elaborate change would be to remove/deprecate GenerateParserTask.purgeOldFiles, GenerateLexerTask.purgeOldFiles and the two options mentioned above. We should always delete the whole directory specified by GenerateParserTask.targetRootOutputDir and GenerateLexerTask.targetOutputDir. The selective deletion implemented right now is quite prone to misconfiguration anyway. It is also only relevant when sharing output directories between multiple tasks, which is not recommended because it can cause issues with caching.

To make the transition easier for people who are currently using a shared output directory for generateLexer and generateParser, we can provide proper defaults for GenerateParserTask.targetRootOutputDir and GenerateLexerTask.targetOutputDir. After this has been done, the only options which still need to be configured by the user are GenerateLexerTask.sourceFile and GenerateParserTask.sourceFile. To make the configuration more convenient, we can provide a property for these options in GrammarKitPluginExtension. With all these changes, the user only needs to make the following configuration for a working build:

grammarKit {
    lexerSource = layout.projectDirectory.file("src/main/lang/Nix.flex")
    parserSource = layout.projectDirectory.file("src/main/lang/Nix.bnf")
}

Right now, the minimal configuration looks like the following, and it is not even working properly when a public parser rule is removed, as the generated file will not be deleted:

val lexerSource = layout.buildDirectory.dir("generated/sources/lexer/java/main")

sourceSets {
    main {
        java {
            srcDir(lexerSource)
            srcDir(tasks.generateParser)
        }
    }
}

tasks {
    generateLexer {
        sourceFile = layout.projectDirectory.file("src/main/lang/Nix.flex")
        targetOutputDir = lexerSource.map { it.dir("org/nixos/idea/lang") }
    }

    generateParser {
        sourceFile = layout.projectDirectory.file("src/main/lang/Nix.bnf")
        targetRootOutputDir = layout.buildDirectory.dir("generated/sources/parser/java/main")
        pathToParser = "org/nixos/idea/lang/NixParser.java"
        pathToPsiRoot = "org/nixos/idea/psi"
    }

    compileJava {
        dependsOn(generateLexer)
    }
}

PS: I would be willing to prepare a PR with either of the two solutions.

Skeleton is no longer optional -- can we make it optional again?

FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':generateArendLexer' (type 'GenerateLexer').
> No value has been specified for property 'skeleton'.
* Try:
Run with --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':generateArendLexer' (type 'GenerateLexer').
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:71)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
	at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
	at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
	at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:192)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
	at org.gradle.execution.plan.DefaultPlanExecutor.process(DefaultPlanExecutor.java:72)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.executeWithServices(DefaultTaskExecutionGraph.java:189)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.execute(DefaultTaskExecutionGraph.java:166)
	at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:41)
	at org.gradle.execution.DefaultBuildWorkExecutor.execute(DefaultBuildWorkExecutor.java:40)
	at org.gradle.execution.DefaultBuildWorkExecutor.access$000(DefaultBuildWorkExecutor.java:24)
	at org.gradle.execution.DefaultBuildWorkExecutor$1.proceed(DefaultBuildWorkExecutor.java:48)
	at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:49)
	at org.gradle.execution.DefaultBuildWorkExecutor.execute(DefaultBuildWorkExecutor.java:40)
	at org.gradle.execution.DefaultBuildWorkExecutor.execute(DefaultBuildWorkExecutor.java:33)
	at org.gradle.execution.IncludedBuildLifecycleBuildWorkExecutor.execute(IncludedBuildLifecycleBuildWorkExecutor.java:36)
	at org.gradle.execution.DeprecateUndefinedBuildWorkExecutor.execute(DeprecateUndefinedBuildWorkExecutor.java:41)
	at org.gradle.execution.BuildOperationFiringBuildWorkerExecutor$ExecuteTasks.run(BuildOperationFiringBuildWorkerExecutor.java:57)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.execution.BuildOperationFiringBuildWorkerExecutor.execute(BuildOperationFiringBuildWorkerExecutor.java:42)
	at org.gradle.initialization.DefaultGradleLauncher.runWork(DefaultGradleLauncher.java:255)
	at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:164)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
	at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:120)
	at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:74)
	at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
	at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
	at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:31)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
	at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
	at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:80)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:60)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:38)
	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
	at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:56)
	at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:212)
	at org.gradle.launcher.cli.DefaultCommandLineActionFactory$ParseAndBuildAction.execute(DefaultCommandLineActionFactory.java:404)
	at org.gradle.launcher.cli.DefaultCommandLineActionFactory$ParseAndBuildAction.execute(DefaultCommandLineActionFactory.java:376)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:38)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:23)
	at org.gradle.launcher.cli.DefaultCommandLineActionFactory$WithLogging.execute(DefaultCommandLineActionFactory.java:369)
	at org.gradle.launcher.Main.doAction(Main.java:35)
	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:31)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:31)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
Caused by: org.gradle.api.InvalidUserDataException: No value has been specified for property 'skeleton'.
	... 126 more

After upgrading to 2020.1.1

Gradle tasks spuriously failing when building against 2022.3 EAP due to Java 11/17 discrepancy

Describe the bug

Error: Unable to initialize main class org.intellij.grammar.Main
Caused by: java.lang.UnsupportedClassVersionError: com/intellij/lang/LanguageBraceMatching has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Unable to initialize main class org.intellij.grammar.Main


Caused by: java.lang.UnsupportedClassVersionError: com/intellij/lang/LanguageBraceMatching has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

To reproduce

The error is somewhat spurious in the sense that it depends on the JDK/Gradle setup on a specific machine (although if it happens on a given machine, then it happens deterministically). We don't know the exact combination of factors; killing Gradle processes and/or clearing up ~/.gradle/ seems to have helped on some machines.

Might be reproduced on latest develop of git-machete-intellij-plugin... but again, depends on a specific machine. Having java point to Java 11 (rather than 17) might increase the chances (although the issue was observed even with java pointing to Java 17).

Additional context

I believe this is caused by the following circumstances:

  1. Since 2022.3, classes of IntelliJ (like com/intellij/lang/LanguageBraceMatching) are compiled for Java 17 (classfiles version 17+44=61).
  2. JDK version for Java compilation can be set up in Gradle via java { toolchain { ... } }; this, however, apparently does not affect the Java version used for execOperations.javaexec in GenerateLexerTask
  3. If GenerateLexerTask, for whatever reason, still runs under Java 11, then an attempt to load org.intellij.grammar.Main (itself a Java 11 class) fails since Java 11 cannot load Java 17 classes from IntelliJ 2022.3.

Suggested remedy

Maybe make the Java version used for .javaexec configurable in both GenerateLexerTask and GenerateParserTask? As suggested in Gradle docs

Environment:

  • OS: macOS
  • Gradle Grammar-Kit Plugin Version: 2021.2.2
  • Gradle Version: 7.5.1

...although as stated, it's more about IntelliJ/Java version in this case.

CC
@LukaszKontowski, @MaciejG604

ClassNotFoundException with IntelliJ 192

I got this exception:

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
java.lang.NoClassDefFoundError: com/intellij/ui/JBColor
        at com.intellij.util.CachedValueLeakChecker.checkProvider(CachedValueLeakChecker.java:51)
        at com.intellij.util.CachedValuesManagerImpl.freshCachedValue(CachedValuesManagerImpl.java:94)
        at com.intellij.util.CachedValuesManagerImpl.getCachedValueFromExHolder(CachedValuesManagerImpl.java:70)
        at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:45)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:147)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:129)
        at org.intellij.grammar.generator.RuleGraphHelper.getTokenTextToNameMap(RuleGraphHelper.java:209)
        at org.intellij.grammar.generator.ParserGenerator.<init>(ParserGenerator.java:194)
        at org.intellij.grammar.Main.main(Main.java:85)
Caused by: java.lang.ClassNotFoundException: com.intellij.ui.JBColor
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 9 more

I'm using IC-192.4488.21
JetBrains/Grammar-Kit#214

Update JFlex to latest version

I'm encountering some issues (e.g. jflex/#216) while searching for this, I recognized, that the issue was already fixed.
Than I remembered about the patched jflex thing.
So I'm not quite sure if this is the right place to ask, but would it possible to get a up-to-date jflex-patch?
Also I don't know the reasons for the 'custom patched version' but maybe it's worth to check if it is still required with the latest official jflex version.

plugin-version: 2021.1.3
gradle-version: 7.2
os: Win 11

GenerateLexer up-to-date checks don't work

I have written a GenerateLexer task like so:

// Create lexer/parser generator tasks
task generateLexer(type: GenerateLexer) {
    source 'src/main/kotlin/com/flatbuffers/plugin/psi/FlatbuffersLexer.flex'

    targetDir 'src/main/gen/com/flatbuffers/plugin/psi'
    targetClass 'FlexLexer'

    purgeOldFiles true
}

But when delete the generated class and re-run, it doesn't notice that there is no output, and it reports "UP-TO-DATE" (and then I don't have a lexer and compilation fails)

How to implement PsiElement.getReference?

Issue #23 means you can't use psiImplUtilClass to generate your method overrides in the PsiElement implementation.

Then how am I supposed to add support for references in my PsiElements?

Let's try to bridge the gap between https://plugins.jetbrains.com/docs/intellij/references-and-resolve.html and https://github.com/JetBrains/Grammar-Kit/blob/master/HOWTO.md:

  • The former says you need to implement getReference() in your PsiElement
  • the latter talks about "III. HOWTO: Generated PSI Classes Hierarchy" but is not explicit about how to do what the former says.

I guess my underlying wish here is to improve a little bit the documentation. For a new comer to grammar kit (I've done plugin dev before but without grammar), it's hard to understand.

For example it took me a while to understand the psiImplUtilClass trick, i.e you implement your PsiElement interface in a static class then grammarkit will call your static helpers from within the XxxPsiElementImpl. This magic trick should be made explicit in the doc.

Another thing that in my opinion is not made clear is the difference between extends and mixin, these seem to do the same thing.

PS, I think the grammar kit doc is great in general and just need a few gaps filled to become 100% new-user-friendly.

Move conventions of the task inputs to the tasks

Is your feature request related to a problem? Please describe.
https://github.com/AlecStrong/Grammar-Kit-Composer uses the tasks of this plugin. Updating to the latest version fails because the conventions inputs are not set, only the required inputs.
At the moment you need to apply this plugin to get the conventions of the required task's input. Instead, you should move the conventions into the tasks to only reuse the tasks.

Describe the solution you'd like
Move almost all logic to the task to prevent applying the plugin or copying the conventions.

Describe alternatives you've considered
Copying the convention task inputs

Additional context

Configuration with name 'compileOnly' not found.

I get the following error on gradle 4.5.1. Any idea on how to fix this?

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'ballerina-idea-plugin'.
> Configuration with name 'compileOnly' not found.

Code generation isn't equal with Grammar-Kit

I am trying to run the generateParser task. But the generated code isn't the same than if I run the action within context menu.

Versions
jflexRelease = '1.7.0'
grammarKitRelease = '1.5.2'
idea = '2017.2'

Gradle

task generateParser(type: GenerateParser) {
    source = "src/main/java/plugin/lang/grammar/PluginParser.bnf"
    targetRoot = 'src/main/gen/'
    pathToParser = '/plugin/lang/parser/PluginParser.java'
    pathToPsiRoot = '/plugin/lang/psi'
}

PluginParser.bnf File

{
    [..]
    // used to attach custom methods into the classes
    psiImplUtilClass            = "plugin.impl.PluginPsiImplUtil"
    psiTreeUtilClass            = "plugin.lang.parser.PluginTreeUtil"

    // if true, generated PsiElement has a get method to get the specified Token
    generateTokenAccessors      = true
    [..]
}

[..]
Block  ::= BodyBlock | CodeBlock {methods=[processDeclarations]}
[..]

Generated Block interface

// This is a generated file. Not intended for manual editing.
package plugin.lang.psi;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;

public interface PluginBlock extends PluginCompositeElement {

  @Nullable
  PluginBlock getBlock();

  @Nullable
  PsiElement getEnd();

  //WARNING: processDeclarations(...) is skipped
  //matching processDeclarations(PluginBlock, ...)
  //methods are not found in PluginPsiImplUtil
}

Generated Block interface with Grammar-Kit

// This is a generated file. Not intended for manual editing.
package plugin.lang.psi;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;
import com.intellij.psi.ResolveState;
import com.intellij.psi.scope.PsiScopeProcessor;

public interface PluginBlock extends PluginCompositeElement {

  @Nullable
  PluginBlock getBlock();

  @Nullable
  PsiElement getEnd();

  boolean processDeclarations(PsiScopeProcessor processor, ResolveState state, PsiElement lastParent, PsiElement place);

}

UtilClass

public static boolean processDeclarations(@NotNull PluginCompositeElement element,
                                              @NotNull PsiScopeProcessor processor,
                                              @NotNull ResolveState state,
                                              PsiElement lastParent,
                                              @NotNull PsiElement place) {
    return true;
}

Would it make sense to make `GenerateParserTask` and `GenerateLexerTask` outputs cacheable?

Is your feature request related to a problem? Please describe.

In --info mode, Gradle reports that both tasks have caching disabled :/

Describe the solution you'd like

Just mark the tasks as @CacheableTask?

Describe alternatives you've considered

Currently I'm doing sth like:

task generateMacheteParser(type: GenerateParserTask) {
  outputs.cacheIf { true }

  // ...
}

task generateMacheteLexer(type: GenerateLexerTask) {
  outputs.cacheIf { true }

  dependsOn generateMacheteParser

  // ...
}

ClassCastException: MockApplication cannot be cast to ApplicationEx

Project/Commit: carymrobbins/intellij-haskforce@183363f

When attempting to invoke grammar-kit via my generateHaskellParser task, I get the following exception and stack trace. Issue #17 sounds somewhat related, but I'm not entirely sure.

java.lang.ClassCastException: com.intellij.mock.MockApplication cannot be cast to com.intellij.openapi.application.ex.ApplicationEx                                                                                                      
        at com.intellij.concurrency.JobLauncher.invokeConcurrentlyUnderProgress(JobLauncher.java:59)
        at com.intellij.psi.impl.search.PsiSearchHelperImpl.bulkProcessElementsWithWord(PsiSearchHelperImpl.java:200)                                                                                                                    
        at com.intellij.psi.impl.search.PsiSearchHelperImpl.processSingleRequest(PsiSearchHelperImpl.java:938)
        at com.intellij.psi.impl.search.PsiSearchHelperImpl.processRequests(PsiSearchHelperImpl.java:604)
        at com.intellij.psi.search.SearchRequestQuery.processResults(SearchRequestQuery.java:24)
        at com.intellij.util.AbstractQuery.doProcessResults(AbstractQuery.java:91)
        at com.intellij.util.AbstractQuery.delegateProcessResults(AbstractQuery.java:114)
        at com.intellij.util.MergeQuery.processResults(MergeQuery.java:26)
        at com.intellij.util.AbstractQuery.doProcessResults(AbstractQuery.java:91)
        at com.intellij.util.AbstractQuery.delegateProcessResults(AbstractQuery.java:114)
        at com.intellij.util.UniqueResultsQuery.processResults(UniqueResultsQuery.java:40)
        at com.intellij.util.AbstractQuery.doProcessResults(AbstractQuery.java:91)
        at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:83)
        at org.intellij.grammar.generator.ParserGeneratorUtil.isUsedAsArgument(ParserGeneratorUtil.java:757)
        at org.intellij.grammar.generator.ParserGenerator.generateNode(ParserGenerator.java:850)
        at org.intellij.grammar.generator.ParserGenerator.generateParser(ParserGenerator.java:571)
        at org.intellij.grammar.generator.ParserGenerator.generateParser(ParserGenerator.java:524)
        at org.intellij.grammar.generator.ParserGenerator.generate(ParserGenerator.java:372)
        at org.intellij.grammar.Main.main(Main.java:85)

Unable to migrate to 2022.3

Tried to migrate and failed.
https://github.com/Camelcade/Perl5-IDEA/blob/master/plugin/core/build.gradle#L25

Shows

Some problems were found with the configuration of task ':plugin:core:generatePerl5Parser' (type 'GenerateParserTask').
  - In plugin 'org.jetbrains.grammarkit' type 'org.jetbrains.grammarkit.tasks.GenerateParserTask' property 'parserFile' doesn't have a configured value.

Tried to add (btw, feels like it should be a default value)

  targetRoot.set('gen')

Didn't help, same result.
Works fine with previous version

build fails without skeleton value

according to the readme skeleton is optional but when not specified the build fails with: > No value has been specified for property 'skeleton'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.