This repository has been archived by the owner on Mar 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.ps1
60 lines (50 loc) · 1.73 KB
/
default.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
Framework "4.0x86"
properties {
$baseDir = Resolve-Path "."
$buildtoolsDir = Resolve-Path "."
$outDir = "$(Resolve-Path ""."")\bin"
$branch = "develop"
}
Task default -Depends Build-All
Function Update-Packages($PackagesDirectory) {
"Updating packages for $PackagesDirectory"
dir $PackagesDirectory | ? { $_.Name -match "^.+\.[0-9]" } | % {
$referenceName = $_.FullName
$baseName = $_.Name -replace "^(.+?)\.[0-9].*$","`$1"
dir "$outDir\$baseName.[0-9]*.nupkg" | % { .\7z.exe x -r -y "-o$referenceName" "$($_.FullName)" | Out-Null }
}
}
Function Build-Project($ProjectName, $UpdatePackages = $true) {
If ($UpdatePackages) {
Update-Packages "$baseDir\$ProjectName\packages"
}
Invoke-Psake "$baseDir\$ProjectName\build\default.ps1"
cp "$baseDir\$ProjectName\bin\*.nupkg" $outDir
}
Task Build-All {
if (Test-Path $outDir) {
rm -Recurse -Force "$outDir" >$null
}
md $outDir >$null
Write-Host "Fetching repos..."
Exec { git submodule -q foreach git fetch origin -q }
Write-Host "Done."
Write-Host "Checking out branch $branch in all repos..."
Exec { git submodule -q foreach git reset --hard -q "origin/$branch" }
Write-Host "Done."
Write-Host "Updating submodules in all repos..."
Exec { git submodule -q foreach git submodule -q update --init --recursive }
Write-Host "Done."
Write-Host "Cleaning all repos..."
Exec { git submodule -q foreach git clean -xdfq }
Write-Host "Done."
Build-Project -ProjectName Compiler -UpdatePackages $false
Build-Project -ProjectName QUnit
Build-Project -ProjectName Linq
Build-Project -ProjectName Web
Build-Project -ProjectName Loader
Build-Project -ProjectName Knockout
Build-Project -ProjectName jQuery
Build-Project -ProjectName jQueryUI
Build-Project -ProjectName NodeJS
}