-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathbuild.ps1
43 lines (28 loc) · 1.62 KB
/
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
32
33
34
35
36
37
38
39
40
41
[cmdletbinding()]
param(
[Parameter(Mandatory=$False)]
[ValidateSet('Release','Debug')]
[string]$configuration="Release"
)
# How to run: .\build.ps1 or .\build.ps1 -configuration Debug
$env:VSToolsPath="C:\Program Files\Microsoft Visual Studio\2022\Professional\Msbuild\Microsoft\VisualStudio\v17.0"
. .\build-clean.ps1
New-Item -ItemType Directory -Force -Path ".\packages-local"
. .\build-external.ps1 $configuration
. .\build-core.ps1 $configuration
. .\build-models.ps1 $configuration
if ($configuration -eq "Release")
{
# TODO: clear bin/obj again to enforce that all further projects will use the nugets
Get-ChildItem .\Core\ -Recurse | Where{$_.FullName -CMatch ".*\\bin$" -and $_.PSIsContainer} | Remove-Item -Recurse -Force -ErrorAction Ignore
Get-ChildItem .\Core\ -Recurse | Where{$_.FullName -CMatch ".*\\obj$" -and $_.PSIsContainer} | Remove-Item -Recurse -Force -ErrorAction Ignore
Get-ChildItem .\Models\ -Recurse | Where{$_.FullName -CMatch ".*\\bin$" -and $_.PSIsContainer} | Remove-Item -Recurse -Force -ErrorAction Ignore
Get-ChildItem .\Models\ -Recurse | Where{$_.FullName -CMatch ".*\\obj$" -and $_.PSIsContainer} | Remove-Item -Recurse -Force -ErrorAction Ignore
}
. .\build-tools.ps1 $configuration
# Unit tests # TODO: break this into CORE tests, MODEL tests, CLITESTS
dotnet build -c $configuration .\Core\CodegenCS.Tests\CodegenCS.Tests.csproj
#dotnet test Core\CodegenCS.Tests\CodegenCS.Tests.csproj
# VSExtension (not working with Release yet - error NU1106: Unable to satisfy conflicting requests)
#. .\build-visualstudio.ps1 $configuration
.\build-visualstudio.ps1 "Debug"