This project builds on the IntelliJ Platform Plugin Template that uses Gradle as its build system, GitHub Actions for the CI/CD pipeline, and Java 17.
Install Java JDK 17 and configure the project to use that JDK if not automatically configured.
To start development, just clone this repository to your machine, import the project, let it build, and you should be good to go.
There are predefined run configurations coming from the platform plugin template you can use to build, test and run the plugin.
the following plugins are recommended to help with the plugin development:
- PsiViewer for inspecting the syntax tree (PSI) of files,
- Concise AssertJ Optimizing Nitpicker (Cajon) for working with AssertJ assertions.
There are a few base classes that can be used to implement the different plugin features:
- MockitoolsBaseInspection for inspections (not all inspections use this as base class)
- MigrationAidBase for migration aids inspections
Functionality is organized into DSL specific classes:
- classes in the
com.picimako.mockitools.dsl
package - StubbingApproach
- VerificationApproach
- StubType
Most messages that appear on the UI, in settings, in inspection messages, are stored in a message bundle called MockitoolsBundle.properties
.
Some messages, like inspection titles are not yet included, and simply are in the plugin.xml.
The following markers are placed on extension point implementations and more important types, to help identify certain aspects of the code:
@since <version number>
in javadocs@HasSonarLintAlternative
annotation if an inspection has an alternative in SonarLint
For CI/CD, GitHub Actions is integrated, and workflows are available in the .github/workflows
folder.
Functional tests build mostly on JUnit3-based platform test classes. For assertions, either the IntelliJ platform's underlying logic is used, or AssertJ where applicable.
Mockitools base test classes:
- MockitoolsTestBase as the common base test class
- MockitoolsInspectionTestBase for inspections
- MockitoolsIntentionTestBase for intention actions
- MockitoolsCodeCompletionTestBase for completion contributors
Other resources: IntelliJ Platform Plugin SDK - Testing Overview
Java file based tests require either a mock or a real JDK to be available. This project is configured to always use a real JDK,
so that modification of the
idea.home.path
system property
is not necessary for running tests locally. And, using the JAVA_HOME based JDK also works on GitHub Actions.
The src/test/testData
folder is used to store test data. They can be configured as project roots when setting the test data path in functional tests.