Skip to content

Build from source

Download

git clone https://github.com/obiscr/ChatGPT.git

Development tools

Install Gradle

Refer here to install Gradle.

Install IntelliJ IDEA

Download IntelliJ IDEA (Ultimate Edition) from JetBrains Website, The recommended version >= 2022.1.

Start building

Configure Gradle JVM

First open the ChatGPT project in IDEA. If there is no problem with the Gradle configuration, after the project is opened, Gradle will automatically download the required dependencies.

Open in idea

After the Gradle task finishes running, we open File - Settings, Select Build, Execution, Development - Build Tools - Gradle

Open gradle

Need to set Gradle JVM

Open gradle

Select the combobox to check if there is corretto-17, if so, just select it.

Open gradle

If not, select Download JDK..., then

  • Version:Select 17
  • Vendor:Select Amazon Corretto 17.x.x
  • Location: Location customization

Open gradle

After waiting for the download to complete, the value of Gradle JVM is selected as the Corretto JDK just downloaded. Finally, save the settings.

Build the plugin

First open the Gradle window in the tool window on the far right of the IDE, and then click 按钮 to refresh the project.

Open gradle

Wait for the sync to complete, select Tasks - intellij - buildPlugin

Build plugin

At this point, the plug-in package starts. After the package is completed, you can find the packaged files under the build/distributions directory of the project.

Build plugin finished

Install the Plugin

Open File > Settings/Preferences > Plugins > ⚙️ > Install plugin from disk... Select the packaged file just now to install it.

How to Debug

In the run configuration of the menu bar, select Run Plugin, then click the Debug button to start another built-in IDE, which has built-in our plug-in, You can debug with breakpoints.

Open gradle

Note

Note that if there is no Run Plugin, Then first open the Gradle window in the tool window on the far right of the IDE, Click Tasks - intellij - runIde. Run it first, and then you can find the Run Plugin in the running configuration.

Open gradle

Success

If you encounter some difficult problems, you can also seek help in the following channels.