Skip to content

biuld/change-classes-logger

Repository files navigation

change-classes-logger

A plugin that helps you manually hot-reload modified class files in IntelliJ IDEA.

Plugin Screenshot

中文文档

Rationale

This plugin enables selective hot-swapping of classes, addressing a common limitation in IntelliJ IDEA's built-in hot-reload mechanism:

Necessity

IntelliJ IDEA's default hot-reload mechanism automatically reloads all modified classes in the classpath. While this works well in most scenarios, it becomes problematic when incremental compilation fails and incorrectly recompiles unnecessary classes. This plugin provides manual control over which classes to hot-reload, effectively solving this issue.

Feasibility

When only modifying method implementations, reloading the current class is sufficient. Even when adding or removing class members and methods, we can determine which classes have changed by checking git status, allowing targeted hot-swapping using this tool. This implementation approach is both simple and reliable, meeting the needs of most development scenarios.

Features

  • Display all class files with color-coded status indicators:
    • Blue: Modified files
    • Green: Added files
    • Purple: Files newer than debug session
    • Default: Unchanged files
  • Manual selection for hot-reloading
  • Real-time class count display
  • File search filtering
  • Support for multiple source file types (.java, .kt, .scala, .groovy)
  • Enhanced hot-reloading capabilities when combined with HotSwapHelper

System Requirements

Build Requirements

  • JDK 21 or higher
  • Gradle 8.0 or higher

Target IDE Version

  • IntelliJ IDEA 2025.1 or higher
  • Supports Java and Kotlin projects

Installation

Method 1: Download from Release (Recommended)

  1. Visit the GitHub Releases page
  2. Download the latest version of changed-classes-logger-*.zip file
  3. Install the plugin in IntelliJ IDEA
    • Open IntelliJ IDEA
    • Go to Settings/Preferences -> Plugins
    • Click the gear icon and select "Install Plugin from Disk..."
    • Select the downloaded zip file
    • Restart the IDE

Method 2: Build from Source

  1. Clone the repository
git clone https://github.com/biuld/change-classes-logger.git
cd change-classes-logger
  1. Build the plugin
./gradlew buildPlugin

After building, the plugin file will be located at build/distributions/change-classes-logger-1.1-SNAPSHOT.zip

  1. Install the plugin in IntelliJ IDEA
    • Open IntelliJ IDEA
    • Go to Settings/Preferences -> Plugins
    • Click the gear icon and select "Install Plugin from Disk..."
    • Select the change-classes-logger-1.1-SNAPSHOT.zip file
    • Restart the IDE

Usage

  1. Start a debug session
  2. Modify source code files
  3. Build the project

    Recommended to run Gradle's class task: ./gradlew classes

  4. Find the "Changed Classes" tab in the IDE's right toolbar
  5. Click the refresh button to update the list of files
  6. The files will be displayed with different colors indicating their status:
    • Blue: Files that have been modified
    • Green: Newly added files
    • Purple: Files that are newer than the debug session
    • Default color: Unchanged files
  7. Select the files you want to hot-reload in the right panel
  8. Right-click the selected files and choose "HotSwap" to perform hot-reloading

Development

This project is built using Kotlin and Gradle.

# Clone the project
git clone https://github.com/biuld/change-classes-logger.git

# Build the plugin
./gradlew buildPlugin

# Run tests
./gradlew test

License

This project is released under the GNU General Public License v3.0. See the LICENSE file for details.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

About

A tool to help you manually hotswap changed classes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages