Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

This IntelliJ IDEA plugin runs the native "Convert Java File To Kotlin File" action and preserves files VCS history by committing the rename step in VCS.

License

Notifications You must be signed in to change notification settings

denis-colliot/vcs-kotlin-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ Deprecated plugin no longer maintained ⚠️

Latest versions of IntelliJ IDEA & Android Studio now provide this feature natively through the commit dialog of their builtin git support.

See related post blog: https://medvector.github.io/kotlin/converting-to-Kotlin/

For this reason, this plugin comes to its end and is no longer maintained.

Long live Kotlin!

Introduction

The VCS Kotlin Converter IntelliJ IDEA plugin runs the native Convert Java File To Kotlin File action and preserves files VCS history by committing the rename step in VCS.

Indeed, the native action renames and transforms content of the files to convert which may result in loosing the entire file VCS history (e.g. git history).
This plugin helps solving this annoying issue.

How to install?

The plugin is published under the JetBrains Plugins Repository (see here) and can be installed following these simple steps:

  1. Open Settings menu (Ctrl Alt S).
  2. Access Plugins section.
  3. Click Brows repositories... button.
  4. Search for VCS Kotlin Converter and click Install button.

How does it work?

This plugin adds a new Convert Java File To Kotlin File in VCS menu action right after Convert Java File To Kotlin File native menu (under Code menu).
The new menu overrides the default native menu keymap Ctrl Alt Shift K, but may be configured in IDE settings.

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 commit message
  • Rename file back to Java extension

Once all renaming operations are done, the plugin invokes the native Convert Java File To Kotlin File action on the selected Java files.

Developers

Plugin manual tests

Run the following gradle command:

./gradlew runIde

Company Proxy

When running gradle command runIde, IntelliJ IDEA downloads (and launches) an IDEA version from dl.bintray.com.

If you are behind a company proxy, it may be necessary to configure proxy in the following files:

<idea_installation_path>/bin/idea.vmoptions
<idea_installation_path>/bin/idea64.vmoptions

By adding and configuring the following lines:

-Dhttps.proxyHost=<proxy_host>
-Dhttps.proxyPort=<proxy_port>
-Dhttp.proxyUser=<proxy_username> 
-Dhttp.proxyPassword=<proxy_password>

Publish plugin

The plugin can be automatically published to JetBrains Plugins Repository using the following gradle command:

./gradlew publishPlugin

This command relies on publish plugin configuration declared in build.gradle :

publishPlugin {
    token project.properties['jetbrains.publish.token']
}

The publish token should be defined in local gradle.properties under key jetbrains.publish.token but should never be indexed in git!

About

This IntelliJ IDEA plugin runs the native "Convert Java File To Kotlin File" action and preserves files VCS history by committing the rename step in VCS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages