Building and Running the plugin
Use this to get started with developing the plugin.
This plugin is built using Gradle. As this project includes the Gradle wrapper, developers don’t need to install Gradle. They need to install Java and make it available in the path or set environment variable JAVA_HOME the folder where they installed it. When building or running for the first time, the build script downloads the community edition of IntelliJ automatically.
To build this plugin, run:
./gradlew -Dfile.encoding=UTF-8 buildPlugin
The ZIP file with plugin to distribute will be located in
To run the plugin for development, run
./gradlew -Dfile.encoding=UTF-8 runIde
To run all tests and the CheckStyle validations, run
./gradlew -Dfile.encoding=UTF-8 check
You most likely want to do this for fast turnaround times when running single tests, and debugging both tests and the plugin itself. Please use IntelliJ IDEA as an IDE for developing on this plugin.
You can use the most recent version of the IDE.
build.gradle file specifies the minimum version for all users of the plugin, but when developing you are free to use a more recent version.
Checkout the GitHub project and import it as a gradle project.
Ensure to install the following plugins (your IDE should recommend installing them once you open the project):
Helps with highlighting and code completion in Grammar files (*.flex).
Helps to analyze the PSI (abstract syntax tree) created from the plugin in the IDE.
This project contains a ready-to-go CheckStyle configuration that will work both in the IDE and in gradle.
choose “Amazon Corretto 11” as Project JDK
(use Add JDK and Download JDK… if not already present)
Running tests from the IDE might produce the error message “jarFiles is not set for PluginDescriptor”. To avoid this error message, set the following system properties when running tests from the IDE. When running tests from Gradle, this is added automatically:
Still, when running via the IDE, the tests in AsciiDocGrammarInspectionTest fail with an ExceptionInInitializerError when loading language tool classes. Please run these tests using the CLI command gradlew check as described above.
Perform these tasks to ensure that your setup is ready for development.
Run the test cases from
AsciiDocLexerTest.javato see that running tests works in your setup.
There are two ready-to-go run configurations checked in to git that you can run:
building the plugin as a ZIP-file that you can then install locally into your IDE
runs an IntelliJ community edition with the AsciiDoc plugin enabled. You can choose to run it in the debug mode.