generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
107 additions
and
6 deletions.
There are no files selected for viewing
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
16 changes: 16 additions & 0 deletions
16
src/dotnet/aspire-plugin/RunnableProject/AspireProjectPropertyRequest.cs
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,16 @@ | ||
using System.Collections.Generic; | ||
using JetBrains.ProjectModel; | ||
using JetBrains.ProjectModel.Properties; | ||
|
||
namespace AspirePlugin.RunnableProject; | ||
|
||
[SolutionComponent] | ||
public class AspireProjectPropertyRequest : IProjectPropertiesRequest | ||
{ | ||
public const string IsAspireHost = "IsAspireHost"; | ||
|
||
public IEnumerable<string> RequestedProperties => new[] | ||
{ | ||
IsAspireHost | ||
}; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/dotnet/aspire-plugin/RunnableProject/AspireRunnableProjectKinds.cs
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,8 @@ | ||
using JetBrains.Rider.Model; | ||
|
||
namespace AspirePlugin.RunnableProject; | ||
|
||
public static class AspireRunnableProjectKinds | ||
{ | ||
public static readonly RunnableProjectKind AspireHost = new("AspireHost"); | ||
} |
35 changes: 35 additions & 0 deletions
35
src/dotnet/aspire-plugin/RunnableProject/AspireRunnableProjectProvider.cs
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,35 @@ | ||
using System.Collections.Generic; | ||
using JetBrains.ProjectModel; | ||
using JetBrains.ProjectModel.Properties; | ||
using JetBrains.ReSharper.Features.Running; | ||
using JetBrains.Rider.Model; | ||
using JetBrains.Util; | ||
using static AspirePlugin.RunnableProject.AspireProjectPropertyRequest; | ||
|
||
namespace AspirePlugin.RunnableProject; | ||
|
||
[SolutionComponent] | ||
public class AspireRunnableProjectProvider : IRunnableProjectProvider | ||
{ | ||
public JetBrains.Rider.Model.RunnableProject? CreateRunnableProject(IProject project, string name, string fullName, IconModel? icon) | ||
{ | ||
System.Diagnostics.Debugger.Launch(); | ||
if (!project.IsDotNetCoreProject()) return null; | ||
|
||
var isAspireHost = project.GetUniqueRequestedProjectProperty(IsAspireHost); | ||
if (isAspireHost.IsNullOrEmpty() || isAspireHost != "true") return null; | ||
|
||
return new JetBrains.Rider.Model.RunnableProject( | ||
name, | ||
fullName, | ||
project.ProjectFileLocation.NormalizeSeparators(FileSystemPathEx.SeparatorStyle.Unix), | ||
AspireRunnableProjectKinds.AspireHost, | ||
[], | ||
[], | ||
null, | ||
[] | ||
); | ||
} | ||
|
||
public IEnumerable<RunnableProjectKind> HiddenRunnableProjectKinds => EmptyList<RunnableProjectKind>.Instance; | ||
} |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
using JetBrains.Application.BuildScript.Application.Zones; | ||
using JetBrains.ProjectModel; | ||
using JetBrains.ReSharper.Psi.CSharp; | ||
|
||
namespace AspirePlugin; | ||
|
||
[ZoneMarker] | ||
public class ZoneMarker : IRequire<IProjectModelZone>; | ||
public class ZoneMarker : IRequire<ILanguageCSharpZone>, IRequire<IProjectModelZone>; |
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
27 changes: 27 additions & 0 deletions
27
src/main/kotlin/com/github/rafaelldi/aspireplugin/run/AspireHostRunConfigurationGenerator.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.github.rafaelldi.aspireplugin.run | ||
|
||
import com.intellij.execution.RunManager | ||
import com.intellij.execution.RunnerAndConfigurationSettings | ||
import com.intellij.openapi.diagnostic.logger | ||
import com.intellij.openapi.project.Project | ||
import com.jetbrains.rider.model.RunnableProject | ||
import com.jetbrains.rider.run.AutoGeneratedRunConfigurationManager | ||
import com.jetbrains.rider.run.ExternalRunConfigurationGeneratorExtension | ||
|
||
class AspireHostRunConfigurationGenerator(private val project: Project) : ExternalRunConfigurationGeneratorExtension { | ||
companion object { | ||
private val LOG = logger<AspireHostRunConfigurationGenerator>() | ||
} | ||
|
||
override fun generateConfigurations( | ||
runnableProjects: List<RunnableProject>, | ||
autoGeneratedRunConfigurationManager: AutoGeneratedRunConfigurationManager, | ||
runManager: RunManager | ||
): List<Pair<RunnableProject, RunnerAndConfigurationSettings>> { | ||
val applicableProjects = runnableProjects.filter { | ||
it.kind == AspireRunnableProjectKinds.AspireHost | ||
} | ||
|
||
return emptyList() | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/com/github/rafaelldi/aspireplugin/run/AspireRunnableProjectKinds.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,7 @@ | ||
package com.github.rafaelldi.aspireplugin.run | ||
|
||
import com.jetbrains.rider.model.RunnableProjectKind | ||
|
||
object AspireRunnableProjectKinds { | ||
val AspireHost = RunnableProjectKind("AspireHost") | ||
} |
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