build obj per target

This commit is contained in:
Robert Muehsig
2017-10-19 21:31:32 +02:00
parent a564f88407
commit cc7905a326

View File

@@ -34,11 +34,6 @@ namespace ElectronNET.CLI.Commands
}
string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "obj", "desktop");
Console.WriteLine("Executing dotnet publish in this directory: " + tempPath);
string tempBinPath = Path.Combine(tempPath, "bin");
string netCorePublishRid = string.Empty;
string electronPackerPlatform = string.Empty;
@@ -60,16 +55,19 @@ namespace ElectronNET.CLI.Commands
default:
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
desiredPlatform = "win";
netCorePublishRid = "win10-x64";
electronPackerPlatform = "win32";
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
desiredPlatform = "osx";
netCorePublishRid = "osx-x64";
electronPackerPlatform = "darwin";
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
desiredPlatform = "linux";
netCorePublishRid = "ubuntu-x64";
electronPackerPlatform = "linux";
}
@@ -77,6 +75,13 @@ namespace ElectronNET.CLI.Commands
break;
}
string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "obj", "desktop", desiredPlatform);
Console.WriteLine("Executing dotnet publish in this directory: " + tempPath);
string tempBinPath = Path.Combine(tempPath, "bin");
Console.WriteLine($"Build ASP.NET Core App for {netCorePublishRid}...");
ProcessHelper.CmdExecute($"dotnet publish -r {netCorePublishRid} --output \"{tempBinPath}\"", Directory.GetCurrentDirectory());
@@ -122,7 +127,7 @@ namespace ElectronNET.CLI.Commands
}
Console.WriteLine("Build Electron Desktop Application...");
string buildPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "desktop");
Console.WriteLine("Executing electron magic in this directory: " + buildPath);
// ToDo: Need a solution for --asar support