tools_gradle_grammar_kit_plugin.md: updates

This commit is contained in:
Yann Cébron 2024-01-09 13:28:50 +01:00
parent b0ffb462d7
commit 581f47ed38

View File

@ -1,4 +1,4 @@
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# Gradle Grammar-Kit Plugin
@ -16,6 +16,12 @@ The [Gradle Grammar-Kit Plugin](https://github.com/JetBrains/gradle-grammar-kit-
> The plugin does not support two-pass generation. Therefore, it does not support method mixins.
>
>
{style="note" title="Known Limitations"}
> Please see [CONTRIBUTING](https://github.com/JetBrains/gradle-grammar-kit-plugin/blob/master/CONTRIBUTING.md) on how to submit feedback and contribute to this project.
>
> Before visiting the [Issue Tracker](https://github.com/JetBrains/gradle-grammar-kit-plugin/issues), update both plugin and Gradle to the latest versions.
## Usage
To enable this plugin in your Gradle-based project, register the plugin in the Gradle build script's `plugins` section:
@ -41,28 +47,21 @@ plugins {
</tab>
</tabs>
> This project requires `Gradle 7.4` or newer, however it is recommended to use the latest Gradle available.
> Update it with:
> ```Bash
> ./gradlew wrapper --gradle-version=VERSION
> ```
>
> See also: [Gradle Installation](https://gradle.org/install/) guide.
>
> Please see [CONTRIBUTING](https://github.com/JetBrains/gradle-grammar-kit-plugin/blob/master/CONTRIBUTING.md) on how to submit feedback and contribute to this project.
>
> Before visiting the [Issue Tracker](https://github.com/JetBrains/gradle-grammar-kit-plugin/issues), update both plugin and Gradle to the latest versions.
> This project requires Gradle 7.4 or newer, however, it is recommended to use the latest Gradle available.
> See [Gradle Installation](https://gradle.org/install/) guide.
>
{title="Minimum Gradle Version"}
## Configuration
See also [](#usage-examples) below.
### Grammar-Kit Extension
After the Gradle Grammar-Kit Plugin is applied, the `grammarKit` extension can be used to configure the plugin and common settings of the provided tasks.
In most cases, explicit configuration can be omitted.
**Example:**
<tabs group="languages">
<tab title="Kotlin" group-key="kotlin">
@ -99,7 +98,7 @@ Type
: `String`
Default value
: `2022.3.1`
: `2022.3.2`
#### jflexRelease
@ -112,7 +111,7 @@ Type
: `String`
Default value
: `1.7.0-1`
: `1.9.2`
#### intellijRelease
@ -136,7 +135,7 @@ Default value
{#generatelexer-task}
The `generateLexer` task generates a lexer for the given grammar.
The task is configured using common [`grammarKit`](#grammar-kit-extension) extension.
The task is configured using common the [`grammarKit`](#grammar-kit-extension) extension.
#### sourceFile
@ -210,7 +209,7 @@ Default
{#generateparser-task}
The `generateParser` task generates a parser for the given grammar.
The task is configured using common [`grammarKit`](#grammar-kit-extension) extension.
The task is configured using the common [`grammarKit`](#grammar-kit-extension) extension.
#### sourceFile
@ -278,14 +277,14 @@ Default
: `false`
## Useful Resources
* [Grammar-Kit](https://github.com/JetBrains/Grammar-Kit)
* [IntelliJ-patched JFlex Sources](https://github.com/JetBrains/intellij-deps-jflex)
* [IntelliJ-patched JFlex](https://cache-redirector.jetbrains.com/intellij-dependencies/org/jetbrains/intellij/deps/jflex/jflex/)
### Usage Examples
## Usage Examples
* [Perl5 plugin](https://github.com/Camelcade/Perl5-IDEA/blob/master/build.gradle.kts)
* [Rust plugin](https://github.com/intellij-rust/intellij-rust/blob/master/build.gradle.kts)
* [Bamboo Soy plugin](https://github.com/google/bamboo-soy/blob/master/build.gradle)
## Links
* [Grammar-Kit](https://github.com/JetBrains/Grammar-Kit)
* [IntelliJ-patched JFlex Sources](https://github.com/JetBrains/intellij-deps-jflex)
* [IntelliJ-patched JFlex](https://cache-redirector.jetbrains.com/intellij-dependencies/org/jetbrains/intellij/deps/jflex/jflex/)