fix(nuget): updating deployment and dependencies

This commit is contained in:
Dylan R. E. Moonfire 2021-09-11 14:14:45 -05:00
parent d9218d660c
commit 9b046e99d9
6 changed files with 64 additions and 10 deletions

18
package-lock.json generated
View file

@ -18,7 +18,7 @@
"husky": "^7.0.2",
"semantic-release": "^17.4.7",
"semantic-release-dotnet": "^1.0.0",
"semantic-release-nuget": "^1.1.0"
"semantic-release-nuget": "^1.1.1"
}
},
"node_modules/@babel/code-frame": {
@ -2193,6 +2193,7 @@
"minimist": "^1.2.5",
"neo-async": "^2.6.0",
"source-map": "^0.6.1",
"uglify-js": "^3.1.4",
"wordwrap": "^1.0.0"
},
"bin": {
@ -2592,6 +2593,7 @@
"dev": true,
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.1.6",
"universalify": "^2.0.0"
},
"optionalDependencies": {
@ -3936,6 +3938,7 @@
"inBundle": true,
"license": "MIT",
"dependencies": {
"colors": "^1.1.2",
"object-assign": "^4.1.0",
"string-width": "^4.2.0"
},
@ -4976,6 +4979,7 @@
"inBundle": true,
"license": "MIT",
"dependencies": {
"encoding": "^0.1.12",
"minipass": "^3.1.0",
"minipass-sized": "^1.0.3",
"minizlib": "^2.0.0"
@ -6785,9 +6789,9 @@
}
},
"node_modules/semantic-release-nuget": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/semantic-release-nuget/-/semantic-release-nuget-1.1.0.tgz",
"integrity": "sha512-Eaqb39E+dPTgYgHif0/P6cUj7IxZxI9e2BgmfE+NkRlPArpRPa94UZTi8UFMbEKiKg0IaNnAO79yexUPcZnuHA==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/semantic-release-nuget/-/semantic-release-nuget-1.1.1.tgz",
"integrity": "sha512-FtkGKQKSPLCelMBh3q0eIKRban6mnDiWT3n4vukP11h3dov2lp7Ij36YbsXUX0pKrdlcS/bWPjzpgKrSHQ4hrg==",
"dev": true
},
"node_modules/semantic-release/node_modules/get-stream": {
@ -11943,9 +11947,9 @@
}
},
"semantic-release-nuget": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/semantic-release-nuget/-/semantic-release-nuget-1.1.0.tgz",
"integrity": "sha512-Eaqb39E+dPTgYgHif0/P6cUj7IxZxI9e2BgmfE+NkRlPArpRPa94UZTi8UFMbEKiKg0IaNnAO79yexUPcZnuHA==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/semantic-release-nuget/-/semantic-release-nuget-1.1.1.tgz",
"integrity": "sha512-FtkGKQKSPLCelMBh3q0eIKRban6mnDiWT3n4vukP11h3dov2lp7Ij36YbsXUX0pKrdlcS/bWPjzpgKrSHQ4hrg==",
"dev": true
},
"semver": {

View file

@ -16,6 +16,6 @@
"husky": "^7.0.2",
"semantic-release": "^17.4.7",
"semantic-release-dotnet": "^1.0.0",
"semantic-release-nuget": "^1.1.0"
"semantic-release-nuget": "^1.1.1"
}
}

View file

@ -5,7 +5,12 @@ module.exports = {
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"semantic-release-dotnet",
{
paths: ["src/Directory.Build.props"],
},
],
[
"semantic-release-nuget",
{

View file

@ -2,8 +2,12 @@ using System;
using System.CommandLine;
using System.IO;
using MfGames.IO.Extensions;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
namespace MfGames.ToolBuilder.Globals
{
/// <summary>
@ -109,6 +113,27 @@ namespace MfGames.ToolBuilder.Globals
}
}
/// <summary>
/// Reads the default configuration file and returns it as a
/// deserialized object.
/// </summary>
/// <typeparam name="TType">A type that represents the configuration file.</typeparam>
/// <returns>The resulting file.</returns>
public TType? ReadDefaultConfigFile<TType>()
{
FileInfo? file = this.DefaultConfigFile;
if (!file.Exists)
{
return default;
}
var json = file.ReadAllText();
TType result = JsonConvert.DeserializeObject<TType>(json);
return result;
}
/// <summary>
/// Sets the internal name of the application, used for the
/// configuration path.
@ -122,5 +147,24 @@ namespace MfGames.ToolBuilder.Globals
this.InternalName = internalName;
return this;
}
/// <summary>
/// Writes the given object to the default configuration file.
/// </summary>
/// <typeparam name="TType">A type that represents the configuration file.</typeparam>
public void WriteDefaultConfigFile<TType>(TType value)
{
// Get the file and make sure the directory containing it exists.
FileInfo file = this.DefaultConfigFile;
file.Directory?.CreateIfMissing();
// Write it out.
string json = JsonConvert.SerializeObject(
value,
Formatting.Indented);
file.WriteAllText(json);
}
}
}

View file

@ -14,6 +14,7 @@
<PackageReference Include="FluentResults" Version="2.5.0" />
<PackageReference Include="Glob" Version="1.1.8" />
<PackageReference Include="Humanizer.Core" Version="2.11.10" />
<PackageReference Include="MfGames.IO" Version="1.0.5" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />

View file

@ -11,7 +11,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JunitXml.TestLogger" Version="2.1.81" />
<PackageReference Include="MfGames.TestSetup" Version="1.0.3" />
<PackageReference Include="MfGames.TestSetup" Version="1.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<PackageReference Include="Roslynator.Analyzers" Version="3.2.2">
<PrivateAssets>all</PrivateAssets>