diff --git a/ElectronNET.API/ElectronNET.API.csproj b/ElectronNET.API/ElectronNET.API.csproj
index eeb858f..20547f3 100755
--- a/ElectronNET.API/ElectronNET.API.csproj
+++ b/ElectronNET.API/ElectronNET.API.csproj
@@ -1,7 +1,6 @@
- net5.0
true
..\artifacts
ElectronNET.API
@@ -9,10 +8,12 @@
Electron.NET
MIT
- https://github.com/ElectronNet/Electron.NET/
- Building cross platform electron based desktop apps with .NET Core and ASP.NET Core.
-This package contains the API to access the "native" electron API.
- https://github.com/ElectronNet/Electron.NET/
+ https://github.com/ElectronNET/Electron.NET/
+
+ Building cross platform electron based desktop apps with .NET Core and ASP.NET Core.
+ This package contains the API to access the "native" electron API.
+
+ https://github.com/ElectronNET/Electron.NET/
git
true
electron aspnetcore
@@ -20,6 +21,7 @@ This package contains the API to access the "native" electron API.
PackageIcon.png
99.0.0.0
true
+ net5.0;net6.0
@@ -33,17 +35,18 @@ This package contains the API to access the "native" electron API.
-
-
+
+
-
+
all
runtime; build; native; contentfiles; analyzers
-
+
+
diff --git a/ElectronNET.API/runtimeconfig.json b/ElectronNET.API/runtimeconfig.json
new file mode 100755
index 0000000..0439511
--- /dev/null
+++ b/ElectronNET.API/runtimeconfig.json
@@ -0,0 +1,7 @@
+{
+ "runtimeOptions": {
+ "configProperties": {
+ "System.Drawing.EnableUnixSupport": true
+ }
+ }
+}
\ No newline at end of file
diff --git a/ElectronNET.CLI/Commands/BuildCommand.cs b/ElectronNET.CLI/Commands/BuildCommand.cs
index eb0f6a6..991c68e 100644
--- a/ElectronNET.CLI/Commands/BuildCommand.cs
+++ b/ElectronNET.CLI/Commands/BuildCommand.cs
@@ -14,6 +14,7 @@ namespace ElectronNET.CLI.Commands
public static string COMMAND_ARGUMENTS = "Needed: '/target' with params 'win/osx/linux' to build for a typical app or use 'custom' and specify .NET Core build config & electron build config" + Environment.NewLine +
" for custom target, check .NET Core RID Catalog and Electron build target/" + Environment.NewLine +
" e.g. '/target win' or '/target custom \"win7-x86;win\"'" + Environment.NewLine +
+ "Optional: '/dotnet-project' with the desired project file to build" + Environment.NewLine +
"Optional: '/dotnet-configuration' with the desired .NET Core build config e.g. release or debug. Default = Release" + Environment.NewLine +
"Optional: '/electron-arch' to specify the resulting electron processor architecture (e.g. ia86 for x86 builds). Be aware to use the '/target custom' param as well!" + Environment.NewLine +
"Optional: '/electron-params' specify any other valid parameter, which will be routed to the electron-packager." + Environment.NewLine +
@@ -35,19 +36,19 @@ namespace ElectronNET.CLI.Commands
_args = args;
}
- private const string _paramTarget = "target";
- private const string _paramDotNetConfig = "dotnet-configuration";
- private const string _paramElectronArch = "electron-arch";
- private const string _paramElectronParams = "electron-params";
- private const string _paramElectronVersion = "electron-version";
- private const string _paramOutputDirectory = "relative-path";
- private const string _paramAbsoluteOutput = "absolute-path";
- private const string _paramPackageJson = "package-json";
- private const string _paramForceNodeInstall = "install-modules";
- private const string _manifest = "manifest";
- private const string _paramPublishReadyToRun = "PublishReadyToRun";
- private const string _paramPublishSingleFile = "PublishSingleFile";
- private const string _paramVersion = "Version";
+ private string _paramTarget = "target";
+ private string _paramDotNetProject = "dotnet-project";
+ private string _paramDotNetConfig = "dotnet-configuration";
+ private string _paramElectronArch = "electron-arch";
+ private string _paramElectronParams = "electron-params";
+ private string _paramOutputDirectory = "relative-path";
+ private string _paramAbsoluteOutput = "absolute-path";
+ private string _paramPackageJson = "package-json";
+ private string _paramForceNodeInstall = "install-modules";
+ private string _manifest = "manifest";
+ private string _paramPublishReadyToRun = "PublishReadyToRun";
+ private string _paramPublishSingleFile = "PublishSingleFile";
+ private string _paramVersion = "Version";
public Task ExecuteAsync()
{
@@ -108,8 +109,14 @@ namespace ElectronNET.CLI.Commands
var dotNetPublishFlags = GetDotNetPublishFlags(parser, "false", "false");
+ var project = string.Empty;
+ if (parser.Arguments.ContainsKey(_paramDotNetProject))
+ {
+ project = parser.Arguments[_paramDotNetProject][0];
+ }
+
var command =
- $"dotnet publish -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))} --self-contained";
+ $"dotnet publish {project} -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))} --self-contained";
// output the command
Console.ForegroundColor = ConsoleColor.Green;
diff --git a/ElectronNET.CLI/Commands/StartElectronCommand.cs b/ElectronNET.CLI/Commands/StartElectronCommand.cs
index ff013cd..ae82460 100644
--- a/ElectronNET.CLI/Commands/StartElectronCommand.cs
+++ b/ElectronNET.CLI/Commands/StartElectronCommand.cs
@@ -22,13 +22,15 @@ namespace ElectronNET.CLI.Commands
_args = args;
}
- private const string _aspCoreProjectPath = "project-path";
- private const string _arguments = "args";
- private const string _manifest = "manifest";
- private const string _clearCache = "clear-cache";
- private const string _paramDotNetConfig = "dotnet-configuration";
- private const string _paramTarget = "target";
- private const string _buildInsteadOfPublish = "simple-build";
+ private string _aspCoreProjectPath = "project-path";
+ private string _paramDotNetProject = "dotnet-project";
+ private string _arguments = "args";
+ private string _manifest = "manifest";
+ private string _clearCache = "clear-cache";
+ private string _paramPublishReadyToRun = "PublishReadyToRun";
+ private string _paramPublishSingleFile = "PublishSingleFile";
+ private string _paramDotNetConfig = "dotnet-configuration";
+ private string _paramTarget = "target";
public Task ExecuteAsync()
{
@@ -96,6 +98,7 @@ namespace ElectronNET.CLI.Commands
configuration = parser.Arguments[_paramDotNetConfig][0];
}
+<<<<<<< HEAD
if (!buildInsteadOfPublish)
{
if (parser != null && !parser.Arguments.ContainsKey("watch"))
@@ -109,6 +112,17 @@ namespace ElectronNET.CLI.Commands
{
resultCode = ProcessHelper.CmdExecute($"dotnet build -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {string.Join(' ', dotNetPublishFlags.Select(kvp => $"{kvp.Key}={kvp.Value}"))} /p:DisabledWarnings=true", aspCoreProjectPath);
}
+=======
+ var project = string.Empty;
+ if (parser.Arguments.ContainsKey(_paramDotNetProject))
+ {
+ project = parser.Arguments[_paramDotNetProject][0];
+ }
+
+ if (parser != null && !parser.Arguments.ContainsKey("watch"))
+ {
+ resultCode = ProcessHelper.CmdExecute($"dotnet publish {project} -r {platformInfo.NetCorePublishRid} -c \"{configuration}\" --output \"{tempBinPath}\" {publishReadyToRun} {publishSingleFile} --no-self-contained", aspCoreProjectPath);
+>>>>>>> 2331ef43b4c2028c57564f3a8c885555c81661d4
}
if (resultCode != 0)
diff --git a/ElectronNET.CLI/ElectronNET.CLI.csproj b/ElectronNET.CLI/ElectronNET.CLI.csproj
old mode 100644
new mode 100755
index f3c4bfa..1b0e0c9
--- a/ElectronNET.CLI/ElectronNET.CLI.csproj
+++ b/ElectronNET.CLI/ElectronNET.CLI.csproj
@@ -2,8 +2,6 @@
Exe
-
- net5.0
dotnet-electronize
electronize
@@ -30,6 +28,7 @@
PackageIcon.png
true
+ net5.0;net6.0
@@ -77,7 +76,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers
diff --git a/ElectronNET.WebApp/ElectronNET.WebApp.csproj b/ElectronNET.WebApp/ElectronNET.WebApp.NET5.csproj
old mode 100644
new mode 100755
similarity index 95%
rename from ElectronNET.WebApp/ElectronNET.WebApp.csproj
rename to ElectronNET.WebApp/ElectronNET.WebApp.NET5.csproj
index e9fe1c2..0e4232f
--- a/ElectronNET.WebApp/ElectronNET.WebApp.csproj
+++ b/ElectronNET.WebApp/ElectronNET.WebApp.NET5.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/ElectronNET.WebApp/ElectronNET.WebApp.NET6.csproj b/ElectronNET.WebApp/ElectronNET.WebApp.NET6.csproj
new file mode 100755
index 0000000..d203911
--- /dev/null
+++ b/ElectronNET.WebApp/ElectronNET.WebApp.NET6.csproj
@@ -0,0 +1,42 @@
+
+
+ net6.0
+ OutOfProcess
+ AspNetCoreModule
+ win-x64
+ 4.2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+
+
+ Never
+
+
+
+
+ PreserveNewest
+
+
+
\ No newline at end of file
diff --git a/ElectronNET.sln b/ElectronNET.sln
index 08a1a85..c167255 100644
--- a/ElectronNET.sln
+++ b/ElectronNET.sln
@@ -2,10 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31112.23
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronNET.WebApp", "ElectronNET.WebApp\ElectronNET.WebApp.csproj", "{7C048379-401C-4345-B5E7-BE232DEA8157}"
- ProjectSection(ProjectDependencies) = postProject
- {CE3EB0F2-DA39-427A-85D2-E00D660EBFDE} = {CE3EB0F2-DA39-427A-85D2-E00D660EBFDE}
- EndProjectSection
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronNET.WebApp.NET5", "ElectronNET.WebApp\ElectronNET.WebApp.NET5.csproj", "{7C048379-401C-4345-B5E7-BE232DEA8157}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronNET.WebApp.NET6", "ElectronNET.WebApp\ElectronNET.WebApp.NET6.csproj", "{76F72AED-31F4-4289-AFB5-D7ECA84072B8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronNET.API", "ElectronNET.API\ElectronNET.API.csproj", "{A78157BA-B754-45F1-969F-D6A513CA0E72}"
EndProject
@@ -66,6 +65,10 @@ Global
{B33E9B82-B6B4-4DB0-B6EE-61CC34641518}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B33E9B82-B6B4-4DB0-B6EE-61CC34641518}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{B33E9B82-B6B4-4DB0-B6EE-61CC34641518}.Release|Any CPU.Build.0 = Debug|Any CPU
+ {76F72AED-31F4-4289-AFB5-D7ECA84072B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {76F72AED-31F4-4289-AFB5-D7ECA84072B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {76F72AED-31F4-4289-AFB5-D7ECA84072B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {76F72AED-31F4-4289-AFB5-D7ECA84072B8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/README.md b/README.md
index 1ded6fa..fb41d8a 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ Well... there are lots of different approaches how to get a X-plat desktop app r
## 🛠 Requirements to run:
-The current Electron.NET CLI builds Windows/macOS/Linux binaries. Our API uses .NET 5, so our minimum base OS is the same as [.NET 5](https://github.com/dotnet/core/blob/master/release-notes/5.0/5.0-supported-os.md).
+The current Electron.NET CLI builds Windows/macOS/Linux binaries. Our API multi-targets .NET 5 & .NET6, so our minimum base OS is the same as [.NET 5](https://github.com/dotnet/core/blob/master/release-notes/5.0/5.0-supported-os.md) or [.NET 6](https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md).
Also you should have installed:
diff --git a/appveyor.cmd b/appveyor.cmd
new file mode 100755
index 0000000..fe7cd6e
--- /dev/null
+++ b/appveyor.cmd
@@ -0,0 +1,28 @@
+echo "Start building Electron.NET dev stack..."
+
+echo "Restore & Build API"
+cd ElectronNet.API
+dotnet restore
+dotnet build
+cd ..
+
+echo "Restore & Build CLI"
+cd ElectronNet.CLI
+dotnet restore
+dotnet build
+
+echo "Install CLI"
+
+dotnet tool uninstall ElectronNET.CLI -g
+dotnet tool install ElectronNET.CLI -g
+cd ..
+
+echo "Restore & Build WebApp Demo"
+cd ElectronNet.WebApp
+dotnet restore ElectronNet.WebApp.NET5.csproj
+dotnet build ElectronNet.WebApp.NET5.csproj
+
+echo "Invoke electronize build in WebApp Demo"
+
+echo "/target win (dev-build)"
+electronize build /target win /dotnet-project ElectronNet.WebApp.NET5.csproj /electron-params "--publish never"
\ No newline at end of file
diff --git a/appveyor.yml b/appveyor.yml
index 62d4674..0770f4d 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,7 +1,7 @@
version: 1.0.{build}
-image: Visual Studio 2019
+image: Visual Studio 2022
build_script:
-- cmd: buildAll.cmd
+- cmd: appveyor.cmd
pull_requests:
do_not_increment_build_number: true
artifacts:
diff --git a/buildAll.cmd b/buildAll.cmd
index 31f75f7..3d276f0 100755
--- a/buildAll.cmd
+++ b/buildAll.cmd
@@ -5,32 +5,34 @@ cd ElectronNet.API
dotnet restore
dotnet build
cd ..
+
echo "Restore & Build CLI"
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"
echo "Install CLI"
dotnet tool uninstall ElectronNET.CLI -g
dotnet tool install ElectronNET.CLI -g
+cd ..
+
+echo "Restore & Build WebApp Demo"
+cd ElectronNet.WebApp
+dotnet restore ElectronNet.WebApp.NET5.csproj
+dotnet build ElectronNet.WebApp.NET5.csproj
+
+echo "Invoke electronize build in WebApp Demo"
echo "/target xxx (dev-build)"
-electronize build /target custom win7-x86;win /dotnet-configuration Debug /electron-arch ia32 /electron-params "--publish never"
+electronize build /target custom win7-x86;win /dotnet-project ElectronNet.WebApp.NET5.csproj /dotnet-configuration Debug /electron-arch ia32 /electron-params "--publish never"
echo "/target win (dev-build)"
-electronize build /target win /electron-params "--publish never"
+electronize build /target win /dotnet-project ElectronNet.WebApp.NET5.csproj /electron-params "--publish never"
echo "/target custom win7-x86;win (dev-build)"
-electronize build /target custom win7-x86;win /electron-params "--publish never"
+electronize build /target custom win7-x86;win /dotnet-project ElectronNet.WebApp.NET5.csproj /electron-params "--publish never"
:: Be aware, that for non-electronnet-dev environments the correct
:: invoke command would be dotnet electronize ...
diff --git a/buildAll.sh b/buildAll.sh
old mode 100644
new mode 100755
index b88f32e..ee09d5f
--- a/buildAll.sh
+++ b/buildAll.sh
@@ -1,17 +1,30 @@
# flag arguments to target specific builds are available.
# sh ./buildAll.sh
+
# sh ./buildAll.sh -t osx
# sh ./buildAll.sh -t win
# sh ./buildAll.sh -t linux
+# sh ./buildAll.sh -t osx -p *.NET5.csproj
+# sh ./buildAll.sh -t win -p *.NET5.csproj
+# sh ./buildAll.sh -t linux -p *.NET5.csproj
+
+# sh ./buildAll.sh -t osx -p *.NET6.csproj
+# sh ./buildAll.sh -t win -p *.NET6.csproj
+# sh ./buildAll.sh -t linux -p *.NET6.csproj
+
target=default
-while getopts t: flag; do
+project="*.NET5.cspoj"
+while getopts t:p: flag; do
case "${flag}" in
t) target=${OPTARG} ;;
+ p) project=${OPTARG} ;;
esac
done
+echo "Targeting $target & Project $project"
+
dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
echo "Start building Electron.NET dev stack..."
@@ -31,38 +44,37 @@ echo "Restore & Build CLI"
pushd $dir/ElectronNET.CLI
dotnet restore
dotnet build
+
+ echo "Install CLI as dotnet tool"
+ dotnet tool uninstall ElectronNET.CLI -g
+ dotnet tool install ElectronNET.CLI -g
popd
echo "Restore & Build WebApp Demo"
pushd $dir/ElectronNET.WebApp
- dotnet restore
- dotnet build
-
- echo "Install CLI as dotnet tool"
-
- dotnet tool uninstall ElectronNET.CLI -g
- dotnet tool install ElectronNET.CLI -g
+ dotnet restore $project
+ dotnet build $project
echo "Invoke electronize build in WebApp Demo"
if [[ "$target" != "default" ]]; then
echo "/target $target (dev-build)"
- electronize build /target $target
+ electronize build /target $target /dotnet-project $project
else
echo "/target win (dev-build)"
- electronize build /target win
+ electronize build /target win /dotnet-project $project
echo "/target linux (dev-build)"
- electronize build /target linux
+ electronize build /target linux /dotnet-project $project
# Cannot publish osx/win on windows due to:
# NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture.
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
echo "/target osx (dev-build)"
- electronize build /target osx
+ electronize build /target osx /dotnet-project $project
echo "/target custom win7-x86;win (dev-build)"
- electronize build /target custom "win7-x86;win"
+ electronize build /target custom "win7-x86;win" /dotnet-project $project
fi
fi
popd
diff --git a/start.cmd b/start.cmd
index a898fde..a84bbbb 100644
--- a/start.cmd
+++ b/start.cmd
@@ -1,8 +1,8 @@
echo Bundle ASP.NET Core Project into EXE
cd ElectronNET.WebApp
-dotnet restore
-dotnet publish -r win-x64 --output ../ElectronNET.Host/bin/
+dotnet restore *.NET5.csproj
+dotnet publish *.NET5.csproj -r win-x64 --output ../ElectronNET.Host/bin/
echo Start Electron with bundled EXE
cd ..\ElectronNET.Host
diff --git a/start.sh b/start.sh
index ac13c7e..c74bac3 100755
--- a/start.sh
+++ b/start.sh
@@ -1,8 +1,8 @@
echo Bundle ASP.NET Core Project into EXE
cd ElectronNET.WebApp
-dotnet restore
-dotnet publish -r osx-x64 --output ../ElectronNET.Host/bin/
+dotnet restore *.NET5.csproj
+dotnet publish *.NET5.csproj -r osx-x64 --output ../ElectronNET.Host/bin/
echo Start Electron with bundled EXE
cd ../ElectronNET.Host