xref: /aosp_15_r20/external/ktfmt/ktfmt_idea_plugin/DEVELOPING.md (revision 5be3f65c8cf0e6db0a7e312df5006e8e93cdf9ec)
1*5be3f65cSAndroid Build Coastguard Worker## Meaning of Versions
2*5be3f65cSAndroid Build Coastguard Worker
3*5be3f65cSAndroid Build Coastguard WorkerVersions are defined in `build.gradle.kts`.
4*5be3f65cSAndroid Build Coastguard Worker
5*5be3f65cSAndroid Build Coastguard Worker`intellij.version` is used for -
6*5be3f65cSAndroid Build Coastguard Worker1. Building the plugin, so the source code needs to be compatible with it.
7*5be3f65cSAndroid Build Coastguard Worker2. Determining the _maximum_ supported version. This means that it needs to be updated every time a new IntelliJ _Branch_ version is released. For example, 2021.1, 2021.2, etc.
8*5be3f65cSAndroid Build Coastguard Worker
9*5be3f65cSAndroid Build Coastguard Worker`tasks.patchPluginXml.sinceBuild` is used for -
10*5be3f65cSAndroid Build Coastguard Worker1. Determinig the _minimum_ supported version, so the code must not reference classes not introduced yet.
11*5be3f65cSAndroid Build Coastguard Worker
12*5be3f65cSAndroid Build Coastguard Worker
13*5be3f65cSAndroid Build Coastguard Worker## Testing
14*5be3f65cSAndroid Build Coastguard Worker
15*5be3f65cSAndroid Build Coastguard Worker* Use Gradle to run the plugin.
16*5be3f65cSAndroid Build Coastguard Worker* _Don't_ use IntelliJ to run the plugin.
17*5be3f65cSAndroid Build Coastguard Worker
18*5be3f65cSAndroid Build Coastguard Worker```
19*5be3f65cSAndroid Build Coastguard Workerktfmt/ktfmt_idea_plugin $ ./gradlew runIde
20*5be3f65cSAndroid Build Coastguard Worker```
21*5be3f65cSAndroid Build Coastguard Worker
22*5be3f65cSAndroid Build Coastguard WorkerPoint `intellij.alternativeIdePath` in `build.gradle.kts` to a local installation of IntelliJ / Android Studio to test the plugin with it. Don't forget to enable the plugin. Easiest way: Cmd-shift-A, type 'ktfmt', look for Preferences.
23*5be3f65cSAndroid Build Coastguard Worker
24*5be3f65cSAndroid Build Coastguard WorkerAnother way: change `intellij.version` and comment out `alternativeIdePath`. This will run the plugin on whatever version you put - it'll be downloaded through Gradle.
25