-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.ps1
32 lines (22 loc) · 810 Bytes
/
build.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
param([string] $build_version )
function Run-Task
{
param(
[scriptblock] $block
)
& $block
if($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
}
Run-Task { dotnet build src/nlog.indentexception.sln -c Release }
Get-ChildItem ./src/*.pp -Recurse | ForEach-Object { Remove-Item $_ }
$files = (Get-ChildItem -Path ./src/ -Filter *.cs -File)
$files | ForEach-Object {
$in = (Get-Content $_.FullName).Replace('YourNamespace.', '$rootnamespace$.');
Set-Content ($_.FullName + ".pp") -Value '// <auto-generated/>', $in;
}
New-Item -ItemType Directory -Force -Path bin | Out-Null
'packing ' + $build_version
& nuget.exe pack src/nlog.indentexception.nuspec -OutputDirectory bin -ExcludeEmptyDirectories -version $build_version -properties "Configuration=Release"