This repository is a Gradle-based IntelliJ/Android Studio plugin, not a Flutter app. Main plugin code lives in src/main/java/com/crzsc/plugin/ and is organized by responsibility: actions/, listener/, provider/, cache/, and utils/. Plugin metadata and UI resources live in src/main/resources/, especially META-INF/plugin.xml and messages/MessagesBundle.properties. Tests are under src/test/kotlin/. Supporting docs, release notes, and design notes live in doc/.
Use the Gradle wrapper from the repo root:
./gradlew buildbuilds the plugin and runs tests../gradlew testruns the JUnit test suite only../gradlew runIdelaunches a sandbox IDE for manual plugin testing../gradlew patchPluginXmlregenerates plugin metadata from the plugin description block inREADME.mdanddoc/CHANGELOG.md.
Run commands from the repository root so Gradle picks up gradle.properties and plugin settings correctly.
Source files are Kotlin (.kt) stored under src/main/java/; keep package names under com.crzsc.plugin. Follow existing Kotlin style: 4-space indentation, expressive method names, UpperCamelCase for classes, lowerCamelCase for functions and properties, and one top-level responsibility per file where practical. Prefer small utility methods over deeply nested logic. Use IntelliJ’s formatter before submitting; there is no dedicated ktlint or detekt configuration in this repo.
Tests use JUnit 4 with Mockito. Add new tests in src/test/kotlin/ and name them *Test.kt. Match existing patterns by covering edge cases in code generation, config parsing, and regression scenarios. Run ./gradlew test before opening a PR; changes to generation or config parsing should include regression coverage.
Recent history uses short, imperative subjects in either English or Chinese, for example chore: release 3.2.0 and 修复兼容性问题. Keep the first line concise and scoped to one change. PRs should describe the user-facing effect, list validation steps, and note any IntelliJ/Flutter compatibility impact. Include screenshots or GIFs when changing actions, notifications, or editor UI. If behavior or release messaging changes, update README.md, doc/CHANGELOG.md, and other relevant files in doc/. Keep release docs aligned with actual defaults in SetupProjectAction, especially enable: true, output_dir: generated/, and name_style: camel.
When updating the release version or plugin description, keep the following in sync:
- Update
pluginVersioningradle.properties. - Move the current release notes from
doc/CHANGELOG.mdUnreleasedinto a concrete version section such as## [3.2.0]. - Verify
build.gradlepatchPluginXml.changeNotesresolves by currentpluginVersion, for examplechangelog.getOrNull(properties("pluginVersion"))?.toHTML() ?: changelog.getUnreleased().toHTML(). Do not pin it to an old fixed version such as3.0.0, or the built plugin will keep embedding stale change notes even whendoc/CHANGELOG.mdhas newer content. - Keep
README.mdanddoc/TECHNICAL_DESIGN.mdaligned with the current release number when they mention a specific version. - Keep documentation examples aligned with actual code defaults from
SetupProjectAction, especiallyenable: true,output_dir: generated/,style: robust, andname_style: camel. - Maintain the plugin marketplace description inside
README.mdbetween<!-- Plugin description -->and<!-- Plugin description end -->. Keep this block English-first and marketplace-safe; avoid README-only navigation, bilingual anchors, or sections that render poorly in plugin metadata. - If plugin marketplace description or change notes changed, run
./gradlew patchPluginXml. - After running
./gradlew patchPluginXmlor./gradlew build, inspectbuild/patchedPluginXmlFiles/plugin.xmland confirm both<description>and<change-notes>contain the expected latest release content. - Before release, verify there are no stale examples such as
lib/generated/if the code now writesgenerated/.