forked from mockingbirdnest/Principia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrebuild_all_solutions.ps1
76 lines (69 loc) · 2.06 KB
/
rebuild_all_solutions.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
$ErrorActionPreference = "Stop"
$msbuild = &".\Principia\find_msbuild.ps1"
$dependencies = @(".\Google\glog\msvc\glog.sln",
".\Google\googletest\googletest\msvc\gtest.sln",
".\Google\googletest\googlemock\msvc\gmock.sln",
".\Google\protobuf\vsprojects\protobuf.sln",
".\Google\benchmark\msvc\google-benchmark.sln",
".\Google\gipfeli\msvc\gipfeli.sln",
".\Google\abseil-cpp\msvc\abseil-cpp.sln",
".\Third Party\zfp\msvc\zfp.sln")
New-Item -ItemType Directory -Force -Path "Google"
New-Item -ItemType Directory -Force -Path "Third Party"
push-location -path "Google"
foreach ($repository in @("glog", "googletest", "protobuf", "benchmark",
"gipfeli", "abseil-cpp", "chromium")) {
if (!(test-path -path $repository)) {
git clone ("https://github.com/mockingbirdnest/" + $repository + ".git")
}
push-location $repository
git checkout master
git pull
if (!$?) {
if ($args[0] -eq "--force") {
git reset --hard origin/master
git clean -fdx
} else {
pop-location
pop-location
exit 1
}
}
pop-location
}
pop-location
push-location -path "Third Party"
foreach ($repository in @("zfp")) {
if (!(test-path -path $repository)) {
git clone ("https://github.com/mockingbirdnest/" + $repository + ".git")
}
push-location $repository
git checkout master
git pull
if (!$?) {
if ($args[0] -eq "--force") {
git reset --hard origin/master
git clean -fdx
} else {
pop-location
pop-location
exit 1
}
}
pop-location
}
pop-location
function build_solutions($solutions) {
foreach ($configuration in "Debug", "Release") {
foreach ($platform in "x64") {
foreach ($solution in $solutions) {
&$msbuild /t:"Clean;Build" /m /property:Configuration=$configuration /property:Platform=$platform $solution
if (!$?) {
exit 1
}
}
}
}
}
build_solutions($dependencies)
build_solutions(".\Principia\Principia.sln")