11
11
# See the License for the specific language governing permissions and
12
12
# limitations under the License.
13
13
# ----------------------------------------------------------------------------------
14
- [CmdletBinding (DefaultParameterSetName = " AllSet" )]
14
+ [CmdletBinding (DefaultParameterSetName = " AllSet" )]
15
15
param (
16
16
[string ]$RepoRoot ,
17
17
[string ]$Configuration = ' Debug' ,
18
- [Parameter (ParameterSetName = " AllSet" )]
18
+ [Parameter (ParameterSetName = " AllSet" )]
19
19
[string ]$TestsToRun = ' All' ,
20
- [Parameter (ParameterSetName = " CIPlanSet" , Mandatory = $true )]
20
+ [Parameter (ParameterSetName = " CIPlanSet" , Mandatory = $true )]
21
21
[switch ]$CIPlan ,
22
- [Parameter (ParameterSetName = " ModifiedModuleSet" , Mandatory = $true )]
22
+ [Parameter (ParameterSetName = " ModifiedModuleSet" , Mandatory = $true )]
23
23
[switch ]$ModifiedModule ,
24
- [Parameter (ParameterSetName = " TargetModuleSet" , Mandatory = $true )]
24
+ [Parameter (ParameterSetName = " TargetModuleSet" , Mandatory = $true )]
25
25
[string []]$TargetModule ,
26
26
[switch ]$ForceRegenerate ,
27
27
[switch ]$InvokedByPipeline ,
@@ -51,7 +51,8 @@ Import-Module $BuildScriptsModulePath
51
51
52
52
if (-not (Test-Path $sourceDirectory )) {
53
53
Write-Warning " Cannot find source directory: $sourceDirectory "
54
- } elseif (-not (Test-Path $generatedDirectory )) {
54
+ }
55
+ elseif (-not (Test-Path $generatedDirectory )) {
55
56
Write-Warning " Cannot find generated directory: $generatedDirectory "
56
57
}
57
58
@@ -72,20 +73,22 @@ switch ($PSCmdlet.ParameterSetName) {
72
73
}
73
74
if (' Core' -eq $TestsToRun ) {
74
75
$testModule = $coreTestModule
75
- } elseif (' NonCore' ) {
76
- $testModule = $TargetModule | Where-Object { $_ -notin $coreTestModule }
77
- } else {
76
+ }
77
+ elseif (' NonCore' -eq $TestsToRun ) {
78
+ $testModule = $TargetModule | Where-Object { $_ -notin $coreTestModule }
79
+ }
80
+ else {
78
81
$testModule = $TargetModule
79
82
}
80
83
}
81
84
' CIPlanSet' {
82
85
$CIPlanPath = Join-Path $RepoArtifacts " PipelineResult" " CIPlan.json"
83
86
If (Test-Path $CIPlanPath ) {
84
87
$CIPlanContent = Get-Content $CIPlanPath | ConvertFrom-Json
85
- foreach ($build in $CIPlanContent.build ) {
88
+ foreach ($build in $CIPlanContent.build ) {
86
89
$TargetModule += $build
87
90
}
88
- foreach ($test in $CIPlanContent.test ) {
91
+ foreach ($test in $CIPlanContent.test ) {
89
92
$testModule += $test
90
93
}
91
94
}
@@ -100,7 +103,8 @@ switch ($PSCmdlet.ParameterSetName) {
100
103
if ($line -match " ^##\s\d+\.\d+\.\d+" ) {
101
104
if ($continueReading ) {
102
105
break
103
- } else {
106
+ }
107
+ else {
104
108
$continueReading = $true
105
109
}
106
110
}
@@ -110,11 +114,11 @@ switch ($PSCmdlet.ParameterSetName) {
110
114
}
111
115
}
112
116
$testModule = $TargetModule
113
- Write-Host " ----------Start building modified modules----------`r`n $ ( $TargetModule | Join-String - Separator " `r`n " ) " - ForegroundColor DarkYellow
117
+ Write-Host " ----------Start building modified modules----------`r`n $ ( $TargetModule | Join-String - Separator " `r`n " ) " - ForegroundColor DarkYellow
114
118
}
115
119
' TargetModuleSet' {
116
120
$testModule = $TargetModule
117
- Write-Host " ----------Start building target modules----------`r`n $ ( $TargetModule | Join-String - Separator " `r`n " ) " - ForegroundColor DarkYellow
121
+ Write-Host " ----------Start building target modules----------`r`n $ ( $TargetModule | Join-String - Separator " `r`n " ) " - ForegroundColor DarkYellow
118
122
}
119
123
}
120
124
@@ -155,7 +159,8 @@ Write-Output "Modules are added to build sln file"
155
159
$LogFile = Join-Path $RepoArtifacts ' Build.log'
156
160
if (' Release' -eq $Configuration ) {
157
161
$BuildAction = ' publish'
158
- } else {
162
+ }
163
+ else {
159
164
$BuildAction = ' build'
160
165
161
166
$testCsprojFiles = Get-CsprojFromModule - TestModuleList $testModule - RepoRoot $RepoRoot - Configuration $Configuration
@@ -171,12 +176,10 @@ if ('Release' -eq $Configuration) {
171
176
}
172
177
173
178
$buildCmdResult = " dotnet $BuildAction $Buildsln -c $Configuration -fl '/flp1:logFile=$LogFile ;verbosity=quiet'"
174
- If ($GenerateDocumentationFile -eq " false" )
175
- {
179
+ If ($GenerateDocumentationFile -eq " false" ) {
176
180
$buildCmdResult += " -p:GenerateDocumentationFile=false"
177
181
}
178
- if ($EnableTestCoverage -eq " true" )
179
- {
182
+ if ($EnableTestCoverage -eq " true" ) {
180
183
$buildCmdResult += " -p:TestCoverage=TESTCOVERAGE"
181
184
}
182
185
Invoke-Expression - Command $buildCmdResult
@@ -188,4 +191,4 @@ $removeScriptPath = Join-Path $toolDirectory 'BuildScripts' 'RemoveUnwantedFiles
188
191
& $removeScriptPath - RootPath (Join-Path $RepoArtifacts $Configuration ) - CodeSign $CodeSign
189
192
190
193
$updateModuleScriptPath = Join-Path $toolDirectory ' UpdateModules.ps1'
191
- pwsh $updateModuleScriptPath - BuildConfig $Configuration - Scope $Scope
194
+ pwsh $updateModuleScriptPath - BuildConfig $Configuration - Scope $Scope
0 commit comments