Pass dotnet publsh /p: arguments to the publish command

use '/p:propertyName=value' or '/property:propertyName=value' to pass in dotnet build property overrides.

fixes #523
https://github.com/ElectronNET/Electron.NET/issues/523
This commit is contained in:
Daniel Gidman
2021-01-25 12:13:44 -06:00
parent 5d907864d8
commit dd5bfd3961
2 changed files with 66 additions and 21 deletions

View File

@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
namespace ElectronNET.CLI
{
@@ -29,10 +31,24 @@ namespace ElectronNET.CLI
}
if (currentName != "")
Arguments[currentName] = values.ToArray();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine($"Arguments: \n\t{string.Join("\n\t",Arguments.Keys.Select(i => $"{i} = {string.Join(" ", Arguments[i])}"))}");
Console.ResetColor();
}
public bool Contains(string name)
{
return Arguments.ContainsKey(name);
}
internal bool TryGet(string key, out string[] value)
{
value = null;
if (!Contains(key)) {
return false;
}
value = Arguments[key];
return true;
}
}
}