-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
QuickBuild.ps1
102 lines (90 loc) · 3.84 KB
/
QuickBuild.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# this build can be valueable if you want to modify the source
# If only debugging, the symbols are distributed with the nuget packages. So, just download the source and add the module you want into your solution and you will be able to set breakpoints etc.
# if you modify the source of any Reactive.Xaf package and build it, there are targets that will copy the assemblies into the nuget folder replacing the ones you got from nuget.org
# You will need to clean your solution after each modification.
#USAGE:
# $p=@{
# DXApiFeed="C:\dx\Latest"
# SourcePath="c:\work\rx.xaf"
# GitHubUserName="apobekiaris"
# GitHubToken="$env:GithubToken" # this is an enviromental variable or you can add it in your profile.ps1 e.g. $env:GitHubToken="449e14b381ba3d...."
# Force=$true
# }
# C:\Work\Reactive.XAF\Build\_QuickBuild.ps1 @p
#DEBUGGING
#Use VsCode with the PowerShell extension and you will be able to set breakpoints, stepin etc
param(
$Branch = "master",
$SourcePath ,
$GitHubUserName=$env:myGitHubUserName,
$GitHubToken = $env:myGitHubToken,
$DXApiFeed = $env:myDxFeed,
[switch]$SkipRepoClone,
[switch]$Force
)
if ($PSVersionTable.Psedition -ne "Core"){
Write-Warning "This script is desinged for Powershell core."
}
# check if latest XpandPwsh is used
if ((Get-Module Xpandpwsh -ListAvailable).Version -ne (Find-Module Xpandpwsh).version){
throw "XpandPwsh Remote version is different. Use Update-Module XpandPwsh to update"
}
# check if DxFeed is not null. You can use a path as well. If your Dx sources path contains space consider creating a symbolic link
# e.g. new-item -ItemType SymbolicLink -Value "C:\Program Files\DevExpress 22.1\Components\System\Components\packages\" -Name Lastest -Path C:\DX\
if (!$DXApiFeed){
throw "DXFeed is null. Consider adding a default value for this variable to your profile.ps1"
}
# check git clone parameters, feel free to use $skipRepoClone if you clone manually or even if you download the source with no cloning
if (!$SourcePath ){
throw "SourcePath is null, set it to the path where you want to clone the Reactive.Xaf repo"
}
if (!(Test-path $SourcePath)){
New-Item $SourcePath -ItemType Directory -ErrorAction SilentlyContinue
}
Push-Location $SourcePath
if (!$SkipRepoClone){
$sourceItems=Get-ChildItem $SourcePath
if ($sourceItems){
if (!$Force){
throw "$Sourcepath is not empty. Please choose another path. Or use the Force parameter"
}
else{
$sourceItems|Remove-Item -Force -Recurse
}
}
if (!$GitHubUserName){
throw "GitHubUserName parameter is null. Consider adding a default value for this variable to your profile.ps1"
}
if (!$GitHubToken){
throw "GitHubToken parameter is null. Consider adding a default value for this variable to your profile.ps1"
}
git clone "https://$GitHubUserName`:[email protected]/eXpandFramework/Reactive.XAF.git" --branch $Branch
Push-Location .\Reactive.XAF
}
else{
Push-Location $SourcePath
}
Clear-NugetCache XpandPackages #clear xpand packages so only one version will be in cache after restoration
dotnet tool restore #ensure tools e.g paket
Move-PaketSource 0 $DXApiFeed
Write-HostFormatted "Restore all packages" -section
Invoke-PaketRestore
Write-HostFormatted "Sing Hangfire" -section
& powershell.exe ".\build\targets\Xpand.XAF.Modules.JobScheduler.Hangfire.ps1" -nugetPackagesFolder "$env:USERPROFILE\.nuget\packages"
Push-Location .\src\extensions
Write-HostFormatted "Build Extensions" -section
Start-Build
Pop-Location
Write-HostFormatted "Build modules" -section
Push-Location .\src\modules
Start-Build
Pop-Location
Write-HostFormatted "Build tests" -section
Push-Location .\src\tests
Start-Build
Pop-Location
Write-HostFormatted "Build EasyTests" -section
Push-Location .\src\tests\EasyTests
Start-Build
Pop-Location
Pop-Location