generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #260 from JetBrains/refactor-services
Refactor services
- Loading branch information
Showing
43 changed files
with
835 additions
and
601 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/kotlin/com/jetbrains/rider/aspire/MigrateBuildSolutionTaskActivity.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,27 @@ | ||
package com.jetbrains.rider.aspire | ||
|
||
import com.intellij.execution.RunManager | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.startup.ProjectActivity | ||
import com.jetbrains.rider.build.tasks.BuildProjectBeforeRunTask | ||
import com.jetbrains.rider.build.tasks.BuildSolutionBeforeRunTaskProvider | ||
|
||
class MigrateBuildSolutionTaskActivity : ProjectActivity { | ||
override suspend fun execute(project: Project) { | ||
RunManager.getInstance(project).allSettings.forEach { setting -> | ||
if (setting.type.id == "AspireHostConfiguration") { | ||
val buildSolutionTasks = setting.configuration.beforeRunTasks.filter { | ||
it.providerId == BuildSolutionBeforeRunTaskProvider.providerId | ||
} | ||
if (buildSolutionTasks.isNotEmpty()) { | ||
buildSolutionTasks.forEach { | ||
setting.configuration.beforeRunTasks.remove(it) | ||
} | ||
val buildSolutionTask = BuildProjectBeforeRunTask() | ||
buildSolutionTask.isEnabled = true | ||
setting.configuration.beforeRunTasks.add(0, buildSolutionTask) | ||
} | ||
} | ||
} | ||
} | ||
} |
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
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
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
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/com/jetbrains/rider/aspire/listeners/AspireSessionHostListener.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,17 @@ | ||
package com.jetbrains.rider.aspire.listeners | ||
|
||
import com.intellij.util.messages.Topic | ||
import com.jetbrains.rd.util.lifetime.Lifetime | ||
import com.jetbrains.rider.aspire.generated.AspireSessionHostModel | ||
import com.jetbrains.rider.aspire.run.AspireHostConfig | ||
import java.nio.file.Path | ||
|
||
interface AspireSessionHostListener { | ||
companion object { | ||
@Topic.ProjectLevel | ||
val TOPIC = Topic("AspireSessionHostListener", AspireSessionHostListener::class.java) | ||
} | ||
|
||
fun configCreated(aspireHostProjectPath: Path, config: AspireHostConfig) | ||
fun modelCreated(aspireHostProjectPath: Path, sessionHostModel: AspireSessionHostModel, lifetime: Lifetime) | ||
} |
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
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
Oops, something went wrong.