This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
forked from MindscapeHQ/raygun4net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.ps1
211 lines (198 loc) · 11.6 KB
/
package.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
properties {
$root = $psake.build_script_dir
$nugetspec = "$root\Mindscape.Raygun4Net.nuspec"
$nugetspec_signed = "$root\Mindscape.Raygun4Net.signed.nuspec"
$nugetspec_core = "$root\Mindscape.Raygun4Net.Core.nuspec"
$nugetspec_mvc = "$root\Mindscape.Raygun4Net.Mvc.nuspec"
$nugetspec_webjob = "$root\Mindscape.Raygun4Net.Azure.WebJob.nuspec"
$nugetspec_webapi = "$root\Mindscape.Raygun4Net.WebApi.nuspec"
$nugetspec_signed_core = "$root\Mindscape.Raygun4Net.Core.Signed.nuspec"
$nugetspec_signed_mvc = "$root\Mindscape.Raygun4Net.Mvc.Signed.nuspec"
$nugetspec_signed_webapi = "$root\Mindscape.Raygun4Net.WebApi.Signed.nuspec"
$build_dir = "$root\build\"
$build_dir2 = "$build_dir\Net2"
$build_dir3_client_profile = "$build_dir\Net3.ClientProfile"
$build_dir4 = "$build_dir\Net4"
$build_dir4_client_profile = "$build_dir\Net4.ClientProfile"
$build_dir_mvc = "$build_dir\Mvc"
$build_dir_webjob = "$build_dir\WebJob"
$build_dir_webapi = "$build_dir\WebApi"
$signed_build_dir = "$build_dir\signed"
$signed_build_dir2 = "$build_dir\signed\Net2"
$signed_build_dir3_client_profile = "$build_dir\signed\Net3.ClientProfile"
$signed_build_dir4 = "$build_dir\signed\Net4"
$signed_build_dir4_client_profile = "$build_dir\signed\Net4.ClientProfile"
$signed_build_dir_mvc = "$build_dir\signed\Mvc"
$signed_build_dir_webapi = "$build_dir\signed\WebApi"
$release_dir = "$root\release\"
$nuget_dir = "$root\.nuget"
$env:Path += ";$nuget_dir"
}
task default -depends Zip
task Clean {
remove-item -force -recurse $release_dir -ErrorAction SilentlyContinue | Out-Null
}
task Init -depends Clean {
new-item $release_dir -itemType directory | Out-Null
}
task Package -depends Init {
exec { nuget pack $nugetspec -OutputDirectory $release_dir }
exec { nuget pack $nugetspec_signed -OutputDirectory $release_dir }
exec { nuget pack $nugetspec_core -OutputDirectory $release_dir }
exec { nuget pack $nugetspec_mvc -OutputDirectory $release_dir }
exec { nuget pack $nugetspec_webjob -OutputDirectory $release_dir }
exec { nuget pack $nugetspec_webapi -OutputDirectory $release_dir }
exec { nuget pack $nugetspec_signed_core -OutputDirectory $release_dir }
exec { nuget pack $nugetspec_signed_mvc -OutputDirectory $release_dir }
exec { nuget pack $nugetspec_signed_webapi -OutputDirectory $release_dir }
}
task Zip -depends Package {
$release = Get-ChildItem $release_dir | Select-Object -f 1
$nupkg_name = $release.Name
$nupkg_name = $nupkg_name -replace "Mindscape.Raygun4Net.", "v"
$version = $nupkg_name -replace ".nupkg", ""
$outerfolder = $release_dir + $version
$versionfolder = $outerfolder + "\" + $version
$versionfolder2 = $versionfolder + "\Net2"
$versionfolder3 = $versionfolder + "\Net3"
$versionfolder3clientprofile = $versionfolder + "\Net3.ClientProfile"
$versionfolder4 = $versionfolder + "\Net4"
$versionfolder4clientprofile = $versionfolder + "\Net4.ClientProfile"
$versionfoldermvc = $versionfolder + "\Mvc"
$versionfolderwebjob = $versionfolder + "\WebJob"
$versionfolderwebapi = $versionfolder + "\WebApi"
$versionfolderwindowsphone = $versionfolder + "\WindowsPhone"
$versionfolderwindowsstore = $versionfolder + "\WindowsStore"
$versionfolderwinrt = $versionfolder + "\WinRT"
$versionfolderxamarinandroid = $versionfolder + "\Xamarin.Android"
$versionfolderxamarinios = $versionfolder + "\Xamarin.iOS"
$versionfolderxamarinmac = $versionfolder + "\Xamarin.Mac"
$signedfolder = $versionfolder + "\signed"
$signedfolder2 = $signedfolder + "\Net2"
$signedfolder3 = $signedfolder + "\Net3"
$signedfolder3clientprofile = $signedfolder + "\Net3.ClientProfile"
$signedfolder4 = $signedfolder + "\Net4"
$signedfolder4clientprofile = $signedfolder + "\Net4.ClientProfile"
$signedfolderwindowsstore = $signedfolder + "\WindowsStore"
$signedfolderwinrt = $signedfolder + "\WinRT"
$signedfoldermvc = $signedfolder + "\Mvc"
$signedfolderwebapi = $signedfolder + "\WebApi"
new-item $versionfolder -itemType directory | Out-Null
new-item $versionfolder2 -itemType directory | Out-Null
new-item $versionfolder3 -itemType directory | Out-Null
new-item $versionfolder3clientprofile -itemType directory | Out-Null
new-item $versionfolder4 -itemType directory | Out-Null
new-item $versionfolder4clientprofile -itemType directory | Out-Null
new-item $versionfoldermvc -itemType directory | Out-Null
new-item $versionfolderwebjob -itemType directory | Out-Null
new-item $versionfolderwebapi -itemType directory | Out-Null
new-item $versionfolderwindowsphone -itemType directory | Out-Null
new-item $versionfolderwindowsstore -itemType directory | Out-Null
new-item $versionfolderwinrt -itemType directory | Out-Null
new-item $versionfolderxamarinandroid -itemType directory | Out-Null
new-item $versionfolderxamarinios -itemType directory | Out-Null
new-item $versionfolderxamarinmac -itemType directory | Out-Null
new-item $signedfolder -itemType directory | Out-Null
new-item $signedfolder2 -itemType directory | Out-Null
new-item $signedfolder3 -itemType directory | Out-Null
new-item $signedfolder3clientprofile -itemType directory | Out-Null
new-item $signedfolder4 -itemType directory | Out-Null
new-item $signedfolder4clientprofile -itemType directory | Out-Null
new-item $signedfolderwindowsstore -itemType directory | Out-Null
new-item $signedfolderwinrt -itemType directory | Out-Null
new-item $signedfoldermvc -itemType directory | Out-Null
new-item $signedfolderwebapi -itemType directory | Out-Null
# .Net 3.5
copy-item $build_dir/Mindscape.Raygun4Net.dll $versionfolder3
copy-item $build_dir/Mindscape.Raygun4Net.pdb $versionfolder3
# Windows Phone
copy-item $build_dir/Mindscape.Raygun4Net.WindowsPhone.dll $versionfolderwindowsphone
copy-item $build_dir/Mindscape.Raygun4Net.WindowsPhone.pdb $versionfolderwindowsphone
# WinRT
copy-item $build_dir/Mindscape.Raygun4Net.WinRT.dll $versionfolderwinrt
copy-item $build_dir/Mindscape.Raygun4Net.WinRT.pdb $versionfolderwinrt
# Xamarin.Android
copy-item $build_dir/Mindscape.Raygun4Net.Xamarin.Android.dll $versionfolderxamarinandroid
copy-item $build_dir/Mindscape.Raygun4Net.Xamarin.Android.pdb $versionfolderxamarinandroid
# Xamarin.iOS
copy-item $build_dir/Mindscape.Raygun4Net.Xamarin.iOS.dll $versionfolderxamarinios
copy-item $build_dir/Mindscape.Raygun4Net.Xamarin.iOS.Unified.dll $versionfolderxamarinios
# Xamarin.Mac
copy-item $build_dir/Mindscape.Raygun4Net.Xamarin.Mac.dll $versionfolderxamarinmac
copy-item $build_dir/Mindscape.Raygun4Net.Xamarin.Mac.Unified.dll $versionfolderxamarinmac
# Windows Store
copy-item $build_dir/Mindscape.Raygun4Net.WindowsStore.dll $versionfolderwindowsstore
copy-item $build_dir/Mindscape.Raygun4Net.WindowsStore.pdb $versionfolderwindowsstore
# .Net 2.0
copy-item $build_dir2/Mindscape.Raygun4Net.dll $versionfolder2
copy-item $build_dir2/Mindscape.Raygun4Net.pdb $versionfolder2
# .Net 3.5 Client Profile
copy-item $build_dir3_client_profile/Mindscape.Raygun4Net.dll $versionfolder3clientprofile
copy-item $build_dir3_client_profile/Mindscape.Raygun4Net.pdb $versionfolder3clientprofile
# .Net 4.0
copy-item $build_dir4/Mindscape.Raygun4Net.dll $versionfolder4
copy-item $build_dir4/Mindscape.Raygun4Net.pdb $versionfolder4
copy-item $build_dir4/Mindscape.Raygun4Net4.dll $versionfolder4
copy-item $build_dir4/Mindscape.Raygun4Net4.pdb $versionfolder4
# .Net 4.0 Client Profile
copy-item $build_dir4_client_profile/Mindscape.Raygun4Net.dll $versionfolder4clientprofile
copy-item $build_dir4_client_profile/Mindscape.Raygun4Net.pdb $versionfolder4clientprofile
# .Net MVC
copy-item $build_dir_mvc/Mindscape.Raygun4Net.dll $versionfoldermvc
copy-item $build_dir_mvc/Mindscape.Raygun4Net.pdb $versionfoldermvc
copy-item $build_dir_mvc/Mindscape.Raygun4Net.Mvc.dll $versionfoldermvc
copy-item $build_dir_mvc/Mindscape.Raygun4Net.Mvc.pdb $versionfoldermvc
copy-item $build_dir_mvc/Mindscape.Raygun4Net4.dll $versionfoldermvc
copy-item $build_dir_mvc/Mindscape.Raygun4Net4.pdb $versionfoldermvc
# Azure WebJob
copy-item $build_dir_webjob/Mindscape.Raygun4Net.dll $versionfolderwebjob
copy-item $build_dir_webjob/Mindscape.Raygun4Net.pdb $versionfolderwebjob
copy-item $build_dir_webjob/Mindscape.Raygun4Net.Azure.WebJob.dll $versionfolderwebjob
copy-item $build_dir_webjob/Mindscape.Raygun4Net.Azure.WebJob.pdb $versionfolderwebjob
# .Net WebApi
copy-item $build_dir_webapi/Mindscape.Raygun4Net.WebApi.dll $versionfolderwebapi
copy-item $build_dir_webapi/Mindscape.Raygun4Net.WebApi.pdb $versionfolderwebapi
copy-item $build_dir_webapi/Mindscape.Raygun4Net.dll $versionfolderwebapi
copy-item $build_dir_webapi/Mindscape.Raygun4Net.pdb $versionfolderwebapi
# Signed
copy-item $signed_build_dir/Mindscape.Raygun4Net.dll $signedfolder3
copy-item $signed_build_dir/Mindscape.Raygun4Net.WinRT.dll $signedfolderwinrt
copy-item $signed_build_dir/Mindscape.Raygun4Net.WindowsStore.dll $signedfolderwindowsstore
copy-item $signed_build_dir2/Mindscape.Raygun4Net.dll $signedfolder2
copy-item $signed_build_dir3_client_profile/Mindscape.Raygun4Net.dll $signedfolder3clientprofile
copy-item $signed_build_dir4/Mindscape.Raygun4Net.dll $signedfolder4
copy-item $signed_build_dir4/Mindscape.Raygun4Net4.dll $signedfolder4
copy-item $signed_build_dir4_client_profile/Mindscape.Raygun4Net.dll $signedfolder4clientprofile
# Signed MVC
copy-item $signed_build_dir_mvc/Mindscape.Raygun4Net.dll $signedfoldermvc
copy-item $signed_build_dir_mvc/Mindscape.Raygun4Net.pdb $signedfoldermvc
copy-item $signed_build_dir_mvc/Mindscape.Raygun4Net.Mvc.dll $signedfoldermvc
copy-item $signed_build_dir_mvc/Mindscape.Raygun4Net.Mvc.pdb $signedfoldermvc
copy-item $signed_build_dir_mvc/Mindscape.Raygun4Net4.dll $signedfoldermvc
copy-item $signed_build_dir_mvc/Mindscape.Raygun4Net4.pdb $signedfoldermvc
#Signed WebApi
copy-item $signed_build_dir_webapi/Mindscape.Raygun4Net.WebApi.dll $signedfolderwebapi
copy-item $signed_build_dir_webapi/Mindscape.Raygun4Net.WebApi.pdb $signedfolderwebapi
copy-item $signed_build_dir_webapi/Mindscape.Raygun4Net.dll $signedfolderwebapi
copy-item $signed_build_dir_webapi/Mindscape.Raygun4Net.pdb $signedfolderwebapi
$zipFullName = $release_dir + $version + ".zip"
Get-ChildItem $outerfolder | Add-Zip $zipFullName
}
function Add-Zip # usage: Get-ChildItem $folder | Add-Zip $zipFullName
{
param([string]$zipfilename)
if(!(test-path($zipfilename)))
{
set-content $zipfilename ("PK" + [char]5 + [char]6 + ("$([char]0)" * 18))
(dir $zipfilename).IsReadOnly = $false
}
$shellApplication = new-object -com shell.application
$zipPackage = $shellApplication.NameSpace($zipfilename)
foreach($file in $input)
{
$zipPackage.CopyHere($file.FullName)
do {
Start-sleep 2
} until ( $zipPackage.Items() | select {$_.Name -eq $file.Name} )
}
}