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
Running the development version locally
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
Running the plugin from with the IDE
Developers most likely want to do this for fast turnaround times when running single tests, and debugging both tests and the plugin itself. Use IntelliJ IDEA as an IDE for developing on this plugin.
Developers 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 they 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 (the IDE should recommend installing them once it opens 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
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. Run these tests using the CLI command gradlew check as described above.
Perform these tasks to ensure that the setup is ready for development:
Run the test cases from
AsciiDocLexerTest.javato see that running tests works in the setup.
There are two ready-to-go run configurations checked in to git that run from the IDE:
building the plugin as a ZIP-file that can then be installed locally into any JetBrains IDE
runs an IntelliJ community edition with the AsciiDoc plugin enabled. This allows for debugging IntelliJ and the plugin.