MSBuild, csproj and props package reference editor.
Перейти к файлу
Wiesław Šoltés 32822e8f0a Use CommunityToolkit.Mvvm 2022-08-20 23:30:03 +02:00
.github Add web version 2022-02-06 21:18:38 +01:00
.nuke Update to .NET 6 2021-11-08 23:31:58 +01:00
build Use CommunityToolkit.Mvvm 2022-08-20 23:30:03 +02:00
demo Update build.cake 2018-12-10 18:25:25 +01:00
images Update Avalonia.png 2021-01-23 14:52:38 +01:00
src Use CommunityToolkit.Mvvm 2022-08-20 23:30:03 +02:00
tests/PackageReferenceEditor.UnitTests Update to .NET 6 2021-11-08 23:31:58 +01:00
.editorconfig Update .editorconfig 2021-07-18 14:16:08 +02:00
.gitattributes Added .gitattributes & .gitignore files 2017-11-09 19:42:13 +01:00
.gitignore Updated gitignore 2017-11-14 18:40:32 +01:00
LICENSE.TXT Updated version 2019-04-04 07:07:17 +00:00
NuGet.Config Update NuGet.Config 2020-11-23 15:47:19 +01:00
PackageReferenceEditor.sln Use CommunityToolkit.Mvvm 2022-08-20 23:30:03 +02:00
README.md Update README.md 2021-10-17 22:13:52 +02:00
_config.yml Set theme jekyll-theme-cayman 2017-11-17 12:04:13 +01:00
azure-pipelines.yml Refactor 2022-02-04 22:46:11 +01:00
build.cmd Update to .NET 6 2021-11-08 23:31:58 +01:00
build.ps1 Update to .NET 6 2021-11-08 23:31:58 +01:00
build.sh Update to .NET 6 2021-11-08 23:31:58 +01:00
global.json Update to .NET 6 2021-11-08 23:31:58 +01:00

README.md

PackageReferenceEditor

Build Status CI

NuGet NuGet MyGet

Github All Releases GitHub release Github Releases

MSBuild, csproj and props package reference editor.

Screenshots

NuGet

PackageReferenceEditor is delivered as a NuGet package.

You can find the packages here NuGet and install the package like this:

Install-Package PackageReferenceEditor

Package Sources

Example Usage with Cake build scripts

Same code can be used in C# programs by removing #addin directive and installing package from NuGet.

Print package versions

#addin "nuget:?package=PackageReferenceEditor"

using PackageReferenceEditor;

Updater.FindReferences("./build", "*.props", new string[] { }).PrintVersions();
Updater.FindReferences("./", "*.csproj", new string[] { }).PrintVersions();	

Validate package versions

#addin "nuget:?package=PackageReferenceEditor"

using PackageReferenceEditor;

Updater.FindReferences("./build", "*.props", new string[] { }).ValidateVersions();
Updater.FindReferences("./", "*.csproj", new string[] { }).ValidateVersions();

Update package version

#addin "nuget:?package=PackageReferenceEditor"

using PackageReferenceEditor;

Updater.FindReferences("./build", "*.props", new string[] { }).UpdateVersions("Newtonsoft.Json", "10.0.3");

Get installed package versions

#addin "nuget:?package=PackageReferenceEditor"

using PackageReferenceEditor;

var result = Updater.FindReferences("./build", "*.props", new string[] { });
result.ValidateVersions();
var version = result.GroupedReferences["Newtonsoft.Json"].FirstOrDefault().Version;
Information("Newtonsoft.Json package version: {0}", version);

Get available package versions

#addin "nuget:?package=PackageReferenceEditor"

using PackageReferenceEditor;
using System.Linq;

var versions = NuGetApi.GetPackageVersions("https://api.nuget.org/v3/index.json", "Newtonsoft.Json").Result;
var latestVersion = versions.Reverse().FirstOrDefault();
Information("Newtonsoft.Json package latest version: {0}", latestVersion);

Resources

License

PackageReferenceEditor is licensed under the MIT license.