Build from source¶
Download¶
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.
After the Gradle task finishes running, we open File - Settings, Select Build, Execution, Development - Build Tools - Gradle
Need to set Gradle JVM
Select the combobox to check if there is corretto-17, if so, just select it.
If not, select Download JDK..., then
- Version:Select 17
- Vendor:Select Amazon Corretto 17.x.x
- Location: Location customization
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.
Wait for the sync to complete, select Tasks - intellij - buildPlugin
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.
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.
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.
Useful Links¶
Success
If you encounter some difficult problems, you can also seek help in the following channels.