MSBuild, csproj and props package reference editor.
Перейти к файлу
Wiesław Šoltés 1d52e8bbb6
Update README.md
2021-10-17 22:13:52 +02:00
.github Update build.yml 2021-10-03 22:40:39 +02:00
build Update to 0.10.7 2021-08-17 20:02:45 +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 Update to 0.10.7 2021-08-17 20:02:45 +02:00
tests/PackageReferenceEditor.UnitTests Updated to 0.10.0 2021-01-23 14:51:19 +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
.nuke Updated nuke 2019-03-24 13:23:18 +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 Update to 0.10.7 2021-08-17 20:02:45 +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 Set up CI with Azure Pipelines 2021-10-17 12:47:06 -07:00
build.ps1 Added nuke build 2018-12-08 15:41:18 +01:00
build.sh Added nuke build 2018-12-08 15:41:18 +01:00
global.json Update global.json 2021-10-03 22:17:28 +02: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.