forked from JoshMcCullough/SVG
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdefault.ps1
84 lines (75 loc) · 2.95 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#########################
###### PSAKE BUILD ######
#########################
# psake build definition
properties {
$base_dir = resolve-path .
$build_dir = "$base_dir\build"
$source_dir = "$base_dir"
$nuget_packages_dir = "$up\.nuget\packages"
$global:config = "debug"
}
$up = [System.Environment]::ExpandEnvironmentVariables("%UserProfile%")
$msbuild = "C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe"
function getNunit3TestRunner(){
$testRunners = @(gci $nuget_packages_dir -rec -filter nunit3-console.exe)
if ($testRunners.Length -ne 1)
{
throw "Expected to find 1 nunit3-console.exe, but found $($testRunners.Length)."
}
$testRunner = $testRunners[0].FullName
$testRunner
}
task default -depends local
task local -depends compile
task reset {
get-childitem -include bin,obj,project.lock.json -recurse -force |remove-item -recurse -force
}
task clean {
rd "$base_dir\build" -recurse -force -ErrorAction SilentlyContinue | out-null
}
# SVG BUILD
task configrelease {
$global:config = "release"
}
task installNuget {
$targetNugetExe = "$base_dir\Nuget\nuget.exe"
if(-not (Test-Path $targetNugetExe)){
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
}
Set-Alias nuget $targetNugetExe -Scope Global -Verbose
}
task compileSvg -depends clean, installNuget {
exec { &.\Nuget\nuget.exe restore $source_dir\svg.sln}
#exec { & $msbuild /t:Clean /t:Build /p:Configuration=$config /v:q /p:NoWarn=1591 /nologo $source_dir\svg.sln }
}
task compileEditor -depends clean, installNuget {
.\Nuget\nuget.exe restore svg.sln
#exec { & $msbuild /t:Clean /t:Build /p:Configuration=$config /v:q /p:NoWarn=1591 /nologo $source_dir\svg.editor.sln }
}
task compileSvgRelease -depends clean, configrelease, installNuget {
exec { &.\Nuget\nuget.exe restore $source_dir\svg.sln}
#exec { & $msbuild /t:Clean /t:Build /p:Configuration=$config /v:q /p:NoWarn=1591 /nologo $source_dir\svg.sln }
}
task compileEditorRelease -depends clean, configrelease, installNuget {
exec { &.\Nuget\nuget.exe restore $source_dir\svg.sln}
#exec { & $msbuild /t:Clean /t:Build /p:Configuration=$config /v:q /p:NoWarn=1591 /nologo $source_dir\svg.editor.sln }
}
task packageSvg -depends compileSvg, compileSvgRelease {
get-childitem -include obj -recurse -force | remove-item -recurse -force
nuget pack Svg.symbols.nuspec -symbols
nuget pack Svg.nuspec
}
task packageEditor -depends compileEditor, compileEditorRelease {
get-childitem -include obj -recurse -force | remove-item -recurse -force
nuget pack Svg.Editor.symbols.nuspec -symbols
nuget pack Svg.Editor.nuspec
nuget pack Svg.Editor.Forms.symbols.nuspec -symbols
nuget pack Svg.Editor.Forms.nuspec
nuget pack Svg.Editor.Views.symbols.nuspec -symbols
nuget pack Svg.Editor.Views.nuspec
}
# BUILD
task compile -depends compileEditor
task package -depends packageSvg, packageEditor