forked from reactiveui/ReactiveUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MakeRelease.ps1
62 lines (45 loc) · 1.79 KB
/
MakeRelease.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
$Archs = {"Net40", "Net45", "SL5", "SL4-WindowsPhone71", "WP8", "WinRT45", "Mono"}
$Projects = {"ReactiveUI", "ReactiveUI.Testing", "ReactiveUI.Xaml", "ReactiveUI.Routing", "ReactiveUI.Blend", "ReactiveUI.Cocoa", "ReactiveUI.Gtk", "ReactiveUI.NLog", "ReactiveUI.Mobile"}
$SlnFileExists = Test-Path ".\ReactiveUI.sln"
if ($SlnFileExists -eq $False) {
echo "*** ERROR: Run this in the project root ***"
exit -1
}
###
### Build the Release directory
###
rmdir -r --force .\Release
foreach-object $Archs | %{mkdir -p ".\Release\$_"}
foreach-object $Archs | %{
$currentArch = $_
foreach-object $Projects | %{cp -r -fo ".\$_\bin\Release\$currentArch\*" ".\Release\$currentArch"}
#ls -r | ?{$_.FullName.Contains("bin\Release\$currentArch") -and $_.Length} | %{echo cp $_.FullName ".\Release\$currentArch"}
}
ls -r .\Release | ?{$_.FullName.Contains("Clousot")} | %{rm $_.FullName}
###
### Build NuGet Packages
###
rm -r -fo .\NuGet-Release. .
cp -r .\NuGet .\NuGet-Release
$libDirs = ls -r .\NuGet-Release | ?{$_.Name -eq "lib"}
$nugetReleaseDir = Resolve-Path ".\NuGet-Release"
foreach ($dir in $libDirs) {
$projName = $dir.FullName.Split("\\")[-2]
$arches = ls $dir.FullName
foreach ($arch in $arches) {
$files = ls $arch.FullName
foreach ($file in $files) {
$src = ".\Release\" + $arch.Name + "\\" + $file.Name
cp -fo $src $file.FullName
}
}
}
$stubs = ls -r -file .\NuGet-Release | ?{$_.Length -eq 0}
if ($stubs.Length -gt 0) {
echo "*** BUILD FAILED ***"
echo ""
echo "*** There are still stubs in the NuGet output, did you fully build? (Hint: Check Silverlight) ***"
#exit 1
}
$specFiles = ls -r .\NuGet-Release | ?{$_.Name.EndsWith(".nuspec")}
$specFiles | %{.\.nuget\NuGet.exe pack $_.FullName}