mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-20 15:46:15 +00:00
Merge pull request #19 from ElectronNET/obj-desktop-per-target
Travis CI Build and one build to build everything...
This commit is contained in:
7
.travis.yml
Normal file
7
.travis.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
language: csharp
|
||||
mono: none
|
||||
dotnet: 2.0.0
|
||||
before_script:
|
||||
- npm install electron-packager --global
|
||||
script:
|
||||
- ./buildAll.sh
|
||||
@@ -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());
|
||||
@@ -116,7 +121,7 @@ namespace ElectronNET.CLI.Commands
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
// Works proper on Windows...
|
||||
// Works proper on Windows...
|
||||
ProcessHelper.CmdExecute("npm install electron-packager --global", tempPath);
|
||||
}
|
||||
else
|
||||
@@ -128,6 +133,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
|
||||
|
||||
17
buildAll.sh
17
buildAll.sh
@@ -1,17 +1,26 @@
|
||||
dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||
echo "Start building Electron.NET dev stack..."
|
||||
echo "Restore & Build API"
|
||||
cd ElectronNet.API
|
||||
cd $dir/ElectronNET.API
|
||||
dotnet restore
|
||||
dotnet build
|
||||
cd ..
|
||||
echo "Restore & Build API"
|
||||
cd ElectronNet.CLI
|
||||
cd $dir/ElectronNET.CLI
|
||||
dotnet restore
|
||||
dotnet build
|
||||
cd ..
|
||||
echo "Restore & Build WebApp Demo"
|
||||
cd ElectronNet.WebApp
|
||||
cd $dir/ElectronNET.WebApp
|
||||
dotnet restore
|
||||
dotnet build
|
||||
|
||||
echo "Invoke electronize build in WebApp Demo"
|
||||
dotnet electronize build
|
||||
echo "-- win"
|
||||
dotnet electronize build win
|
||||
|
||||
echo "-- linux"
|
||||
dotnet electronize build linux
|
||||
|
||||
echo "-- osx"
|
||||
dotnet electronize build osx
|
||||
|
||||
Reference in New Issue
Block a user