Set of tools for storing similar git-branches in a single branch by moving files that have changes to bunch-files, files with additional special extension.
plugin.xml
plugin.xml.172 <-- Bunch file for Idea 2017.2
SomeAction.java
SomeAction.java.181 <-- Bunch file for Idea 2018.1
Such fake branches have several advantages for plugin development over classic approach when each IDEA version is stored in a separate branch:
The main disadvantages are:
This approach works well when number of bunch-files is reasonable small or they never change.
The best practice is to have bunch files only for solving API compatibility issues, and maintain
same source for all supported IDEA-versions in other files.
This tool set is used in Kotlin project.
The latest release can be obtained from:
https://github.com/JetBrains/bunches/releases
macOS users can install it via brew:
brew tap jetbrains/utils
brew install bunches
--ext=<suffix>
option can be passed to clean bunch files with the specific extension.173 // Base branch
// Switch rules
172
as31
as32_181
181
182_181
Each line from switch rules section describes how to switch to the branch mentioned at the beginning of the line.
For example for Android Studio 3.2, rule as32_181_173
will be applied (base 173
branch is added implicitly).
Switch tool will do following steps when it gets as32_181_173
as input for each base file in repository:
as32
bunch-file is present, replace base file with it and continue to other file;181
bunch file is present, replace base file with it and continue to other file;173
branch) and continue to other file;