The Multiple File Kotlin Converter IntelliJ IDEA plugin runs the native Convert Java File To Kotlin File action against a list of files, in sequence allowing bulk conversion. It includes several options for selecting files, including:
- New-line separated list of files
regex
matching (Currently limited to filename)- Line-count based filtering
The regex
and line-count based options include a verification and selection step.
All conversions also include an optional step to perform an in-place renaming of the files from .java
to .kt
so that git
/Version Control
history is maintained.
The plugin is published under the JetBrains Plugins Repository (see here) and can be installed following these simple steps:
- Open Settings menu (
Ctrl Alt S
). - Access Plugins section.
- Click Browse repositories... button.
- Search for Multiple File Kotlin Converter and click Install button.
This plugin adds a new Convert Multiple Files To Kotlin... menu action right after Convert Java File To Kotlin File native menu (under Code menu).
When running this new action menu, the following steps are applied to each selected Java file:
- Rename Java file with Kotlin extension
- Commit renaming step to VCS with standard or custom commit message
- Rename file back to Java extension
The plugin invokes the native Convert Java File To Kotlin File action on all selected Java files.