Skip to content

Commit 300dc49

Browse files
DanDan
authored andcommitted
Update the buildAll.sh so that you can run it successfully on a Mac
1 parent ce0f3fd commit 300dc49

File tree

2 files changed

+40
-18
lines changed

2 files changed

+40
-18
lines changed

ElectronNET.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
3737
buildReleaseNuGetPackages.cmd = buildReleaseNuGetPackages.cmd
3838
Changelog.md = Changelog.md
3939
README.md = README.md
40+
start.cmd = start.cmd
41+
start.sh = start.sh
4042
EndProjectSection
4143
EndProject
4244
Global

buildAll.sh

100755100644
Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# flag arguments to target specific builds are available.
2+
3+
# sh ./buildAll.sh
4+
# sh ./buildAll.sh -t osx
5+
# sh ./buildAll.sh -t win
6+
# sh ./buildAll.sh -t linux
7+
8+
target=default
9+
while getopts t: flag; do
10+
case "${flag}" in
11+
t) target=${OPTARG} ;;
12+
esac
13+
done
14+
115
dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
216
echo "Start building Electron.NET dev stack..."
317

@@ -23,29 +37,35 @@ echo "Restore & Build WebApp Demo"
2337
pushd $dir/ElectronNET.WebApp
2438
dotnet restore
2539
dotnet build
26-
40+
2741
echo "Install CLI as dotnet tool"
28-
42+
2943
dotnet tool uninstall ElectronNET.CLI -g
3044
dotnet tool install ElectronNET.CLI -g
31-
45+
3246
echo "Invoke electronize build in WebApp Demo"
33-
echo "/target win (dev-build)"
34-
electronize build /target win
35-
36-
echo "/target linux (dev-build)"
37-
electronize build /target linux
38-
39-
# Cannot public osx/win on windows due to:
40-
# NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture.
41-
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
42-
echo "/target osx (dev-build)"
43-
electronize build /target osx
44-
45-
echo "/target custom win7-x86;win (dev-build)"
46-
electronize build /target custom "win7-x86;win"
47+
48+
if [[ "$target" != "default" ]]; then
49+
echo "/target $target (dev-build)"
50+
electronize build /target $target
51+
else
52+
echo "/target win (dev-build)"
53+
electronize build /target win
54+
55+
echo "/target linux (dev-build)"
56+
electronize build /target linux
57+
58+
# Cannot publish osx/win on windows due to:
59+
# NETSDK1095: Optimizing assemblies for performance is not supported for the selected target platform or architecture.
60+
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
61+
echo "/target osx (dev-build)"
62+
electronize build /target osx
63+
64+
echo "/target custom win7-x86;win (dev-build)"
65+
electronize build /target custom "win7-x86;win"
66+
fi
4767
fi
4868
popd
4969

50-
# Be aware, that for non-electronnet-dev environments the correct
70+
# Be aware, that for non-electronnet-dev environments the correct
5171
# invoke command would be dotnet electronize ...

0 commit comments

Comments
 (0)