Skip to content

Commit

Permalink
feat(core): add ProjectRunService interface and extension point
Browse files Browse the repository at this point in the history
Add ProjectRunService interface for running projects and corresponding extension point for dynamic implementations.
  • Loading branch information
phodal committed Jun 8, 2024
1 parent 2110eb6 commit 71d02e1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.phodal.shirecore.provider

import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.openapi.project.Project

interface ProjectRunService {
fun run(project: Project)

companion object {
val EP_NAME = ExtensionPointName<ProjectRunService>("com.phodal.shireRunProjectService")

fun runProject(project: Project) {
val projectRunServices = EP_NAME.extensionList
for (provider in projectRunServices) {
try {
provider.run(project)
} catch (e: Exception) {
e.printStackTrace()
}
}
}
}
}
6 changes: 5 additions & 1 deletion core/src/main/resources/com.phodal.shirecore.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
</extensions>

<extensionPoints>
<extensionPoint qualifiedName="com.phodal.shireRunService"
<extensionPoint qualifiedName="com.phodal.shireFileRunService"
interface="com.phodal.shirecore.provider.FileRunService"
dynamic="true"/>

<extensionPoint qualifiedName="com.phodal.shireRunProjectService"
interface="com.phodal.shirecore.provider.ProjectRunService"
dynamic="true"/>

<extensionPoint qualifiedName="com.phodal.shireSymbolProvider"
interface="com.phodal.shirecore.provider.ShireSymbolProvider"
dynamic="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
</dependencies>

<extensions defaultExtensionNs="com.phodal">
<shireRunService implementation="com.phodal.shire.httpclient.HttpClientFileRunService"/>
<shireFileRunService implementation="com.phodal.shire.httpclient.HttpClientFileRunService"/>
</extensions>
</idea-plugin>

0 comments on commit 71d02e1

Please sign in to comment.