JaneySprings / DotNet.Meteor

A VSCode extension that can run and debug .NET apps (Xamarin, MAUI, Avalonia)
https://marketplace.visualstudio.com/items?itemName=nromanov.dotnet-meteor
MIT License
269 stars 10 forks source link

Add support for custom project configurations #81

Closed AlphaNERD- closed 7 months ago

AlphaNERD- commented 7 months ago

Hello,

so as the title says, i would like to suggest to add support for custom configurations listed under in the csproj file. Perhaps we could go further by adding a configuration option for the launch configurations just like with the official .NET MAUI launch configurations.

JaneySprings commented 7 months ago

Hi @AlphaNERD- ! Thank you for your issue. You can customize a default build task in the tasks.json file. Please, check the following wiki: https://github.com/JaneySprings/DotNet.Meteor/wiki/Predefined-task-customization

For example: You can create any custom target in the csproj file:

<Target Name="MyCustomTarget">
    <Message Text="Hello from MyCustomTarget" Importance="high" />
</Target>

and create tasks.json file in the .vscode folder with the following content:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "dotnet-meteor.task",
            "target": "build",
            "problemMatcher": [
                "$dotnet-meteor.problemMatcher"
            ],
            "label": "dotnet-meteor: Build",
            "args": [
                "-t:MyCustomTarget"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

You can see that your custom target had executed:

image