/
test-dotnet.ps1
101 lines (73 loc) · 3.05 KB
/
test-dotnet.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This script semi-automates testing the dotnet templates.
# It creates a solution at the given directory, instantiates all templates,
# builds, and runs them one after the other so that they can be visually checked.
param (
[Parameter(Mandatory=$true)]
[string] $directory,
[string] $nupkg
)
if (test-path "$directory") {
echo "This directory already exists."
exit 1
}
if ("$nupkg") {
dotnet new -u WebSharper.Templates
dotnet new -i "$nupkg"
}
dotnet new sln -o "$directory"
pushd "$directory"
try {
dotnet new websharper-lib -o Fs.Lib -lang f#
dotnet sln add Fs.Lib/Fs.Lib.fsproj
dotnet new websharper-lib -o Cs.Lib -lang c#
dotnet sln add Cs.Lib/Cs.Lib.csproj
dotnet new websharper-ext -o Fs.Ext -lang f#
dotnet sln add Fs.Ext/Fs.Ext.fsproj
dotnet new websharper-web -o Fs.Web -lang f#
dotnet sln add Fs.Web/Fs.Web.fsproj
dotnet add Fs.Web/Fs.Web.fsproj reference Fs.Lib/Fs.Lib.fsproj
dotnet add Fs.Web/Fs.Web.fsproj reference Fs.Ext/Fs.Ext.fsproj
dotnet add Fs.Web/Fs.Web.fsproj reference Cs.Lib/Cs.Lib.csproj
dotnet new websharper-web -o Cs.Web -lang c#
dotnet sln add Cs.Web/Cs.Web.csproj
dotnet new websharper-spa -o Fs.Spa -lang f#
dotnet sln add Fs.Spa/Fs.Spa.fsproj
dotnet new websharper-spa -o Cs.Spa -lang c#
dotnet sln add Cs.Spa/Cs.Spa.csproj
dotnet new websharper-html -o Fs.Html -lang f#
dotnet sln add Fs.Html/Fs.Html.fsproj
dotnet new websharper-html -o Cs.Html -lang c#
dotnet sln add Cs.Html/Cs.Html.csproj
dotnet new websharper-min -o Fs.Min -lang f#
dotnet sln add Fs.Min/Fs.Min.fsproj
dotnet new websharper-min -o Cs.Min -lang c#
dotnet sln add Cs.Min/Cs.Min.csproj
dotnet new websharper-svc -o Fs.Svc -lang f#
dotnet sln add Fs.Svc/Fs.Svc.fsproj
dotnet new websharper-svc -o Cs.Svc -lang c#
dotnet sln add Cs.Svc/Cs.Svc.csproj
dotnet new websharper-prx -o Fs.Prx -lang f#
dotnet sln add Fs.Prx/Fs.Prx.fsproj
dotnet new websharper-prx -o Cs.Prx -lang c#
dotnet sln add Cs.Prx/Cs.Prx.csproj
dotnet build
start-process http://localhost:5000
echo "=== TESTING C# SPA; close its window and press Enter to continue ==="
start-process dotnet $("run", "-p", "Cs.Spa/Cs.Spa.csproj")
read-host
echo "=== TESTING F# SPA; close its window and press Enter to continue ==="
start-process dotnet $("run", "-p", "Fs.Spa/Fs.Spa.fsproj")
read-host
echo "=== TESTING C# Web; close its window and press Enter to continue ==="
start-process dotnet $("run", "-p", "Cs.Web/Cs.Web.csproj")
read-host
echo "=== TESTING F# Web; close its window and press Enter to continue ==="
start-process dotnet $("run", "-p", "Fs.Web/Fs.Web.fsproj")
read-host
echo "=== TESTING C# HTML; press Enter to continue ==="
./Cs.Html/bin/html/index.html
read-host
echo "=== TESTING F# HTML; press Enter to continue ==="
./Fs.Html/bin/html/index.html
read-host
} finally { popd }