generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add ProjectRunService interface and extension point
Add ProjectRunService interface for running projects and corresponding extension point for dynamic implementations.
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
core/src/main/kotlin/com/phodal/shirecore/provider/ProjectRunService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters