This guide is intended for developers who want to contribute to this project. It covers the setup process, build system, grammar files, available Gradle tasks, and releasing the plugin.
Before you start, please read the guidelines found in CONTRIBUTING.md.
Prerequisites
- Java Version 21 or later
- A JetBrains IDE (CLion, IntelliJ IDEA, etc.) -> not needed for development per se since testing will download and run the IDE plugin, but helpful for manual testing
Helpful, but not required, IDE plugins:
This project uses Gradle (Groovy DSL) to build the plugin with extensions to streamline the development and release process.
It is available in this repository already under gradlew so no installation is required.
Setup:
- Versions for plugins and libraries (such as JUnit and GrammarKit) are defined in libs.versions.toml.
- Various properties are defined in gradle.properties.
- The build configuration is defined in build.gradle.
- A small amount of additional configuration is defined in settings.gradle.
To update the version used:
- Find the version under Gradle Releases
- Update the version in gradle.properties under the
gradleVersionproperty. - Find the sha256 checksum under Gradle Checksums under the
Binary-onlysection - Run the following command twice to update the Gradle wrapper. The first time will download the wrapper, the second time will update it:
Linux/MacOS:
./gradlew :wrapper --gradle-distribution-sha256-sum=<checksum>Windows:
gradlew.bat :wrapper --gradle-distribution-sha256-sum=<checksum>Replace <checksum> with the checksum you found in step 3.
This project defines grammar files using JFlex (lexer) and GrammarKit (parser) which are used to generate the lexer and parser code.
You will need to regenerate the lexer and parser code whenever you make changes to the grammar files.
The generated code is placed in the src/main/gen directory.
The following tasks are useful when developing the plugin
Generate a lexer using JFlex from the Vala.flex file.
Linux/MacOS:
./gradlew generateLexerWindows:
gradlew.bat generateLexerSee generateLexer for more details.
Generate the parser and PSI using GrammarKit from the Vala.bnf file.
Linux/MacOS:
./gradlew generateParserWindows:
gradlew.bat generateParserSee generateParser for more details.
Build the plugin and prepare a ZIP archive for testing and distribution. It will be placed in the build/distributions directory.
Linux/MacOS:
./gradlew buildPluginWindows:
gradlew.bat buildPluginSee buildPlugin for more details.
Runs a fresh IDE instance with the plugin installed and ready to test with the version and product specified in
the gradle.properties file under the IntelliJ Platform Properties section.
Linux/MacOS:
./gradlew runIdeWindows:
gradlew.bat runIdeSee runIde for more details.
Verify the plugin for binary compatibility before publishing to the Marketplace using IntelliJ Plugin Verifier CLI to ensure that the plugin is compatible and adheres to the standards set by JetBrains in order to be approved.
Linux/MacOS:
./gradlew verifyPluginWindows:
gradlew.bat verifyPluginSee verifyPlugin for more details.
Publishes the plugin to the marketplace via gradle task. You can also upload the plugin's ZIP manually to the marketplace if you have access to the community plugin management page.
You will need to have the following environment variables set to publish the plugin:
PUBLISH_TOKEN- the authorization token used for publishingCERTIFICATE_CHAIN- the certificate chain used for signingPRIVATE_KEY- the private key used for signingPRIVATE_KEY_PASSWORD- the password for the private key used for signing
Linux/MacOS:
./gradlew publishPluginWindows:
gradlew.bat publishPluginSee publishPlugin for more details.
In order to release a new version of the plugin:
- Update the version in gradle.properties, following Semantic Versioning guidelines
- Update the changelog to include the latest changes in CHANGELOG.md following Keep a Changelog guidelines
- Update the draft release details in GitHub Releases with the changes and publish the release.
CI/CD via GitHub Actions will automatically build and publish the plugin to the JetBrains Marketplace when a new release is created, and likely will be available within 48 hours, pending approval by the JetBrains team.
The description for the plugin on the Marketplace is written in MarketplaceDescription.md.
It is written in Markdown and is converted to HTML by JetBrains KT Extension Kit in build.gradle
under the intellijPlatform, pluginConfiguration, description property.