Skip to content

Commit

Permalink
feat(exts-git): extract and rename git plugin support #183
Browse files Browse the repository at this point in the history
This commit extracts the git plugin support and renames the refactoring implementation, including changes to the package, resource-bundle, and plugin.xml. It also adds a new file cc.unitmesh.git.xml and modifies the build.gradle.kts file to include the Git4Idea plugin.
  • Loading branch information
phodal committed May 8, 2024
1 parent 3970a5f commit eb55792
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 47 deletions.
7 changes: 4 additions & 3 deletions build.gradle.kts
Expand Up @@ -93,7 +93,6 @@ val scalaPlugin = prop("scalaPlugin")
val pluginProjects: List<Project> get() = rootProject.allprojects.toList()
val ideaPlugins =
listOf(
"Git4Idea",
// "org.jetbrains.plugins.terminal",
"com.intellij.java",
"org.jetbrains.plugins.gradle",
Expand Down Expand Up @@ -415,7 +414,6 @@ project(":") {
implementation(libs.kotlinx.serialization.json)

implementation("cc.unitmesh:cocoa-core:0.4.5")
implementation("cc.unitmesh:git-commit-message:0.4.5")

// kanban
implementation(libs.github.api)
Expand Down Expand Up @@ -601,10 +599,12 @@ project(":exts:ext-harmonyos") {
project(":exts:ext-git") {
intellij {
version.set(ideaVersion)
plugins.set(ideaPlugins + "Git4Idea")
}

dependencies {
implementation(project(":"))
implementation("cc.unitmesh:git-commit-message:0.4.5")
}
}

Expand Down Expand Up @@ -645,11 +645,12 @@ project(":exts:devins-lang") {

intellij {
version.set(ideaVersion)
plugins.set((ideaPlugins + "org.intellij.plugins.markdown" + "com.jetbrains.sh"))
plugins.set((ideaPlugins + "org.intellij.plugins.markdown" + "com.jetbrains.sh" + "Git4Idea"))
}

dependencies {
implementation(project(":"))
implementation(project(":exts:ext-git"))
}

tasks {
Expand Down
@@ -1,4 +1,4 @@
package cc.unitmesh.devti.actions.vcs
package cc.unitmesh.git.actions.vcs

import cc.unitmesh.devti.AutoDevBundle
import cc.unitmesh.devti.AutoDevNotifications
Expand Down
@@ -1,4 +1,4 @@
package cc.unitmesh.devti.actions.vcs
package cc.unitmesh.git.actions.vcs

import cc.unitmesh.devti.AutoDevBundle
import cc.unitmesh.devti.vcs.VcsPrompting
Expand Down
27 changes: 27 additions & 0 deletions exts/ext-git/src/main/resources/cc.unitmesh.git.xml
@@ -0,0 +1,27 @@
<idea-plugin package="cc.unitmesh.git">
<!--suppress PluginXmlValidity -->
<dependencies>
<plugin id="Git4Idea"/>
</dependencies>

<extensions defaultExtensionNs="cc.unitmesh">
<action id="autodev.Vcs.CodeReview"
class="cc.unitmesh.git.actions.vcs.CodeReviewAction"
icon="cc.unitmesh.devti.AutoDevIcons.AI_COPILOT"
description="Ask AI to review code">

<add-to-group group-id="Vcs.Log.ChangesBrowser.Popup" relative-to-action="Vcs.RepositoryChangesBrowserMenu"
anchor="after"/>
<add-to-group group-id="Vcs.Log.ContextMenu" relative-to-action="Vcs.ShowDiffWithLocal" anchor="after"/>
</action>

<action id="autodev.Vcs.PrepushReview"
class="cc.unitmesh.git.actions.vcs.PrepushReviewAction"
icon="cc.unitmesh.devti.AutoDevIcons.AI_COPILOT"
description="Ask AI to review code">

<add-to-group group-id="ChangesViewToolbar" anchor="last"/>
<add-to-group group-id="ChangesViewPopupMenu" relative-to-action="ChangesView.Revert" anchor="after"/>
</action>
</extensions>
</idea-plugin>
1 change: 1 addition & 0 deletions plugin/src/main/resources/META-INF/plugin.xml
Expand Up @@ -37,6 +37,7 @@
<module name="cc.unitmesh.android"/>
<module name="cc.unitmesh.harmonyos"/>
<module name="cc.unitmesh.terminal"/>
<module name="cc.unitmesh.git"/>
<module name="cc.unitmesh.devti.language"/>
</content>
</idea-plugin>
21 changes: 0 additions & 21 deletions src/222/main/resources/META-INF/autodev-core.xml
Expand Up @@ -2,7 +2,6 @@
<resource-bundle>messages.AutoDevBundle</resource-bundle>

<depends>com.intellij.modules.platform</depends>
<depends>Git4Idea</depends>

<extensions defaultExtensionNs="com.intellij">
<notificationGroup id="AutoDev.notification.group" displayType="STICKY_BALLOON" bundle="messages.AutoDevBundle"
Expand Down Expand Up @@ -310,26 +309,6 @@
<add-to-group group-id="Vcs.Log.ContextMenu" relative-to-action="Vcs.ShowDiffWithLocal" anchor="after"/>
</action>

<action id="autodev.Vcs.CodeReview"
class="cc.unitmesh.devti.actions.vcs.CodeReviewAction"
icon="cc.unitmesh.devti.AutoDevIcons.AI_COPILOT"
description="Ask AI to review code">

<add-to-group group-id="Vcs.Log.ChangesBrowser.Popup" relative-to-action="Vcs.RepositoryChangesBrowserMenu"
anchor="after"/>
<add-to-group group-id="Vcs.Log.ContextMenu" relative-to-action="Vcs.ShowDiffWithLocal" anchor="after"/>
</action>

<action id="autodev.Vcs.PrepushReview"
class="cc.unitmesh.devti.actions.vcs.PrepushReviewAction"
icon="cc.unitmesh.devti.AutoDevIcons.AI_COPILOT"
description="Ask AI to review code">

<add-to-group group-id="ChangesViewToolbar" anchor="last"/>
<add-to-group group-id="ChangesViewPopupMenu" relative-to-action="ChangesView.Revert" anchor="after"/>

</action>

<action id="cc.unitmesh.devti.actions.chat.CodeCompleteChatAction"
class="cc.unitmesh.devti.actions.chat.CodeCompleteChatAction"
description="Ask AI about this code">
Expand Down
21 changes: 0 additions & 21 deletions src/233/main/resources/META-INF/autodev-core.xml
Expand Up @@ -2,7 +2,6 @@
<resource-bundle>messages.AutoDevBundle</resource-bundle>

<depends>com.intellij.modules.platform</depends>
<depends>Git4Idea</depends>

<extensions defaultExtensionNs="com.intellij">
<notificationGroup id="AutoDev.notification.group" displayType="STICKY_BALLOON" bundle="messages.AutoDevBundle"
Expand Down Expand Up @@ -318,26 +317,6 @@
<add-to-group group-id="Vcs.Log.ContextMenu" relative-to-action="Vcs.ShowDiffWithLocal" anchor="after"/>
</action>

<action id="autodev.Vcs.CodeReview"
class="cc.unitmesh.devti.actions.vcs.CodeReviewAction"
icon="cc.unitmesh.devti.AutoDevIcons.AI_COPILOT"
description="Ask AI to review code">

<add-to-group group-id="Vcs.Log.ChangesBrowser.Popup" relative-to-action="Vcs.RepositoryChangesBrowserMenu"
anchor="after"/>
<add-to-group group-id="Vcs.Log.ContextMenu" relative-to-action="Vcs.ShowDiffWithLocal" anchor="after"/>
</action>

<action id="autodev.Vcs.PrepushReview"
class="cc.unitmesh.devti.actions.vcs.PrepushReviewAction"
icon="cc.unitmesh.devti.AutoDevIcons.AI_COPILOT"
description="Ask AI to review code">

<add-to-group group-id="ChangesViewToolbar" anchor="last"/>
<add-to-group group-id="ChangesViewPopupMenu" relative-to-action="ChangesView.Revert" anchor="after"/>

</action>

<action id="cc.unitmesh.devti.actions.chat.CodeCompleteChatAction"
class="cc.unitmesh.devti.actions.chat.CodeCompleteChatAction"
description="Ask AI about this code">
Expand Down

0 comments on commit eb55792

Please sign in to comment.