mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-04-27 00:20:24 +00:00
Merge branch 'cli-etc' into develop
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' == 'Windows_NT'">
|
||||
<Exec Command="$(ProjectDir)devCleanup.cmd" IgnoreExitCode="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' != 'Windows_NT'">
|
||||
<Exec Command="$(ProjectDir)devCleanup.sh" IgnoreExitCode="true" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
1
ElectronNET.API/devCleanup.sh
Executable file
1
ElectronNET.API/devCleanup.sh
Executable file
@@ -0,0 +1 @@
|
||||
rm -rf ~/.nuget/packages/electronnet.api
|
||||
@@ -51,9 +51,9 @@ namespace ElectronNET.CLI.Commands
|
||||
Directory.CreateDirectory(tempPath);
|
||||
}
|
||||
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "main.js", "ElectronHost.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package.json", "ElectronHost.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package-lock.json", "ElectronHost.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "main.js");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package.json");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package-lock.json");
|
||||
|
||||
string hostApiFolder = Path.Combine(tempPath, "api");
|
||||
if (Directory.Exists(hostApiFolder) == false)
|
||||
@@ -82,7 +82,7 @@ namespace ElectronNET.CLI.Commands
|
||||
{
|
||||
// ToDo: find another solution or document it proper
|
||||
// GH Issue https://github.com/electron-userland/electron-prebuilt/issues/48
|
||||
Console.WriteLine("Electron Packager - make sure you invoke 'sudo npm install electron - packager--global' at " + tempPath + " manually. Sry.");
|
||||
Console.WriteLine("Electron Packager - make sure you invoke 'sudo npm install electron-packager --global' at " + tempPath + " manually. Sry.");
|
||||
}
|
||||
|
||||
Console.WriteLine("Build Electron Desktop Application...");
|
||||
@@ -96,8 +96,8 @@ namespace ElectronNET.CLI.Commands
|
||||
|
||||
ProcessHelper.CmdExecute($"electron-packager . --platform=win32 --arch=x64 --out=\"{buildPath}\" --overwrite", tempPath);
|
||||
}
|
||||
|
||||
if(RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
Console.WriteLine("Package Electron App for OSX...");
|
||||
|
||||
@@ -111,6 +111,8 @@ namespace ElectronNET.CLI.Commands
|
||||
ProcessHelper.CmdExecute($"electron-packager . --platform=linux --arch=x64 --out=\"{buildPath}\" --overwrite", tempPath);
|
||||
}
|
||||
|
||||
Console.WriteLine("... done");
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace ElectronNET.CLI.Commands
|
||||
public const string COMMAND_ARGUMENTS = "<Path> from ASP.NET Core Project.";
|
||||
public static IList<CommandOption> CommandOptions { get; set; } = new List<CommandOption>();
|
||||
|
||||
private const string ConfigName = "electronnet.json";
|
||||
private const string ConfigName = "electron.manifest.json";
|
||||
|
||||
public Task<bool> ExecuteAsync()
|
||||
{
|
||||
|
||||
@@ -49,9 +49,9 @@ namespace ElectronNET.CLI.Commands
|
||||
string tempBinPath = Path.Combine(tempPath, "bin");
|
||||
ProcessHelper.CmdExecute($"dotnet publish -r win10-x64 --output \"{tempBinPath}\"", aspCoreProjectPath);
|
||||
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "main.js", "ElectronHost.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package.json", "ElectronHost.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package-lock.json", "ElectronHost.");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "main.js");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package.json");
|
||||
EmbeddedFileHelper.DeployEmbeddedFile(tempPath, "package-lock.json");
|
||||
|
||||
string hostApiFolder = Path.Combine(tempPath, "api");
|
||||
if (Directory.Exists(hostApiFolder) == false)
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
<ItemGroup>
|
||||
<None Remove="ElectronHost\package-lock.json" />
|
||||
<None Remove="ElectronHost\package.json" />
|
||||
<None Remove="electronnet.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\electron.manifest.json" Link="ElectronHost\electron.manifest.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -25,7 +28,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\ElectronNET.Host\main.js" Link="ElectronHost\main.js" />
|
||||
<EmbeddedResource Include="electronnet.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -50,5 +52,7 @@
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' == 'Windows_NT'">
|
||||
<Exec Command="$(ProjectDir)devCleanup.cmd" IgnoreExitCode="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' != 'Windows_NT'">
|
||||
<Exec Command="$(ProjectDir)devCleanup.sh" IgnoreExitCode="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
@@ -15,11 +15,17 @@ namespace ElectronNET.CLI
|
||||
|
||||
return asm.GetManifestResourceStream(resource);
|
||||
}
|
||||
|
||||
public static void DeployEmbeddedFile(string targetPath, string file, string namespacePath = "")
|
||||
{
|
||||
using (var fileStream = File.Create(Path.Combine(targetPath, file)))
|
||||
{
|
||||
var streamFromEmbeddedFile = GetTestResourceFileStream(namespacePath + file);
|
||||
var streamFromEmbeddedFile = GetTestResourceFileStream("ElectronHost." + namespacePath + file);
|
||||
if (streamFromEmbeddedFile == null)
|
||||
{
|
||||
Console.WriteLine("Error: Couldn't find embedded file: " + file);
|
||||
}
|
||||
|
||||
streamFromEmbeddedFile.CopyTo(fileStream);
|
||||
}
|
||||
}
|
||||
|
||||
1
ElectronNET.CLI/devCleanup.sh
Executable file
1
ElectronNET.CLI/devCleanup.sh
Executable file
@@ -0,0 +1 @@
|
||||
rm -rf ~/.nuget/packages/electronnet.cli
|
||||
@@ -33,7 +33,7 @@ function startAspCoreBackend(electronPort) {
|
||||
loadURL = `http://localhost:${electronWebPort}`
|
||||
const parameters = [`/electronPort=${electronPort}`, `/electronWebPort=${electronWebPort}`];
|
||||
|
||||
const manifestFile = require("./bin/electronnet.json");
|
||||
const manifestFile = require("./bin/electron.manifest.json");
|
||||
let binaryFile = manifestFile.executable;
|
||||
|
||||
const os = require("os");
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
<ItemGroup>
|
||||
<DotNetCliToolReference Include="ElectronNET.CLI" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Assets\electron.ico">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
@@ -32,8 +31,8 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Update="electronnet.json">
|
||||
<Content Update="electron.manifest.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -1,4 +1,5 @@
|
||||
# Electron.NET
|
||||
# Electron.NET [](https://ci.appveyor.com/project/robertmuehsig/electron-net/branch/cli-etc)
|
||||
|
||||
Build cross platform desktop apps with .NET Core and ASP.NET NET Core.
|
||||
|
||||
## Dev Notes:
|
||||
|
||||
10
appveyor.yml
Normal file
10
appveyor.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
version: 1.0.{build}
|
||||
branches:
|
||||
only:
|
||||
- cli-etc
|
||||
image: Visual Studio 2017
|
||||
build_script:
|
||||
- cmd: buildAll.cmd
|
||||
artifacts:
|
||||
- path: ElectronNET.WebApp\bin\desktop
|
||||
name: Desktop
|
||||
17
buildAll.cmd
Executable file
17
buildAll.cmd
Executable file
@@ -0,0 +1,17 @@
|
||||
echo "Start building Electron.NET dev stack..."
|
||||
echo "Restore & Build API"
|
||||
cd ElectronNet.API
|
||||
dotnet restore
|
||||
dotnet build
|
||||
cd ..
|
||||
echo "Restore & Build API"
|
||||
cd ElectronNet.CLI
|
||||
dotnet restore
|
||||
dotnet build
|
||||
cd ..
|
||||
echo "Restore & Build WebApp Demo"
|
||||
cd ElectronNet.WebApp
|
||||
dotnet restore
|
||||
dotnet build
|
||||
echo "Invoke electronize build in WebApp Demo"
|
||||
dotnet electronize build
|
||||
17
buildAll.sh
Executable file
17
buildAll.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
echo "Start building Electron.NET dev stack..."
|
||||
echo "Restore & Build API"
|
||||
cd ElectronNet.API
|
||||
dotnet restore
|
||||
dotnet build
|
||||
cd ..
|
||||
echo "Restore & Build API"
|
||||
cd ElectronNet.CLI
|
||||
dotnet restore
|
||||
dotnet build
|
||||
cd ..
|
||||
echo "Restore & Build WebApp Demo"
|
||||
cd ElectronNet.WebApp
|
||||
dotnet restore
|
||||
dotnet build
|
||||
echo "Invoke electronize build in WebApp Demo"
|
||||
dotnet electronize build
|
||||
Reference in New Issue
Block a user