forked from ThomasLebrun/XForms-Toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.ps1
More file actions
74 lines (61 loc) · 2.24 KB
/
Copy pathdefault.ps1
File metadata and controls
74 lines (61 loc) · 2.24 KB
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
properties {
$projects = $null
$configuration = "Release"
$source_folder = $null
$solution = $null
$build_meta = $null
$preRelease = $null
}
Task Default -Depends Build
Task RestorePackages {
Exec { nuget restore $solution -PackagesDirectory .\packages }
}
Task Publish -Depends Package {
$version = getVersionBase
# $projects | % {
# Get-ChildItem | Where-Object -FilterScript {
# ($_.Name.Contains("$project.$version")) -and !($_.Name.Contains(".symbols")) -and ($_.Extension -eq '.nupkg')
# } | % {
# exec { nuget push $_.Fullname }
# }
# }
exec { & ".\.nuget\Push All.ps1"}
}
Task Package -Depends {
$version = getVersionBase
# $projects | % {
# Get-ChildItem -Path "$_\*.csproj" | % {
# exec { nuget pack -sym $_.Fullname -Prop Configuration=$configuration }
# }
# }
exec { & ".\.nuget\Build All.ps1" "-version $version -preRelease $preRelease"}
}
Task Test -Depends Build {
# Get-ChildItem $source_folder -Recurse -Include *Tests.csproj | % {
# Exec { & ".\packages\xunit.runner.console.2.0.0\tools\xunit.console.exe" "$($_.DirectoryName)\bin\$configuration\$($_.BaseName).dll" }
# }
}
Task Build -Depends Clean,Set-Versions,RestorePackages {
Exec { msbuild "$solution" /t:Build /p:Configuration=$configuration }
}
Task Clean {
Exec { msbuild "$solution" /t:Clean /p:Configuration=$configuration }
exec { & ".\.nuget\Clean All.ps1"}
}
Task Set-Versions {
$version = getVersionBase
if ($build_meta) {
"##teamcity[buildNumber '$version+$build_meta']" | Write-Host
} else {
"##teamcity[buildNumber '$version']" | Write-Host
}
Get-ChildItem -Recurse -Force | Where-Object { $_.Name -eq "AssemblyInfo.cs" } | ForEach-Object {
(Get-Content $_.FullName) | ForEach-Object {
($_ -replace 'AssemblyVersion\(.*\)', ('AssemblyVersion("' + $version + '")')) -replace 'AssemblyFileVersion\(.*\)', ('AssemblyFileVersion("' + $version + '")')
} | Set-Content $_.FullName -Encoding UTF8
}
}
function getVersionBase {
$versionInfo = (Get-Content "version.json") -join "`n" | ConvertFrom-Json
"$($versionInfo.major).$($versionInfo.minor).$($versionInfo.patch)";
}