Skip to content

Phault/proto-dotnet-plugin

Repository files navigation

proto .NET plugin

.NET WASM plugin for proto.

Installation

This is a community plugin and is thus not built-in to proto. In order to use it, add the following to .prototools:

[plugins]
dotnet = "source:https://github.com/Phault/proto-dotnet-plugin/releases/latest/download/dotnet_plugin.wasm"

Or preferably pin a specific version, to avoid nasty surprises if we mess up a release:

[plugins]
dotnet = "source:https://github.com/Phault/proto-dotnet-plugin/releases/download/vX.Y.Z/dotnet_plugin.wasm"

This plugin relies on two assumptions:

  • As the SDKs will be installed to the location your DOTNET_ROOT environment variable points to, it must be a user-writable location. This is usually ~/.dotnet which is also the default location if the variable is not defined.
  • The location for your DOTNET_ROOT must be in your PATH, as we do not shim or symlink it like other proto plugins.

Usage

# install latest SDK
proto install dotnet

# install latest long-term-support release
proto install dotnet lts

# install a specific version
proto install dotnet 8.0.101

Caveats

global.json detection

The plugin will try to respect any global.json it finds, but it is done in a best effort manner.

proto will always prefer the highest version you allow it, so the major, minor, feature and patch options for the rollForward field, will instead act like latestMajor, latestMinor, latestFeature and latestPatch respectively.

The allowPrerelease field is simply ignored. Due to limitations in proto, or rather it's supporting semver library, this would be troublesome to implement in a faithful way. You may still specify a prerelease in the version field however, but how this works together with rollForward hasn't been tested.

Configuration

.NET plugin does not support configuration.

Hooks

.NET plugin does not support hooks.

Contributing

Build the plugin:

cargo build --target wasm32-wasi

Test the plugin by running proto commands.

proto install dotnet-test
proto list-remote dotnet-test