forked from mockingbirdnest/Principia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrebuild_all_solutions.ps1
51 lines (45 loc) · 1.45 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
$ErrorActionPreference = "Stop"
$msbuild = &".\Principia\find_msbuild.ps1"
$dependencies = @(".\Google\glog\google-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")
push-location -path "Google"
foreach ($repository in @("glog", "googletest", "protobuf", "benchmark",
"gipfeli", "abseil-cpp")) {
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")