Remove dependency on Newtonsoft

This commit is contained in:
Caelan Sayler
2024-03-10 23:26:47 +00:00
parent dd94b60be3
commit c59a970e16
2 changed files with 5 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
using System.Runtime.Versioning;
using System.Security;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Velopack.Json;
namespace Velopack.Packaging.Unix;
@@ -76,7 +76,7 @@ public class OsxBuildTools
throw new ArgumentException("Source directory does not exist: " + source);
}
Log.Debug($"Copying '{source}' to '{dest}' (preserving symlinks)");
// copy the contents of the folder, not the folder itself.
var src = source.TrimEnd('/') + "/.";
var des = dest.TrimEnd('/') + "/";
@@ -196,7 +196,7 @@ exit 0
// try to catch any notarization errors. if we have a submission id, retrieve notary logs.
try {
var ntresult = JsonConvert.DeserializeObject<NotaryToolResult>(ntresultjson.StdOutput);
var ntresult = SimpleJson.DeserializeObject<NotaryToolResult>(ntresultjson.StdOutput);
if (ntresult?.status != "Accepted" || ntresultjson.ExitCode != 0) {
if (ntresult?.id != null) {
var logargs = new List<string> {
@@ -212,8 +212,8 @@ exit 0
throw new Exception("Notarization failed: " + ntresultjson.StdOutput);
}
} catch (JsonReaderException) {
throw new Exception("Notarization failed: " + ntresultjson.StdOutput);
} catch (Exception ex) {
throw new Exception("Notarization failed: " + ntresultjson.StdOutput + Environment.NewLine + ex.Message);
}
Log.Info("Notarization completed successfully");

View File

@@ -8,7 +8,6 @@
<ItemGroup>
<PackageReference Include="ELFSharp" Version="2.17.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>