Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / msvc / compare-config-content.ps1
1 ##############################################################################
2 ##
3 ## compare-config-content
4 ##
5 ##############################################################################
6
7 <#
8
9 .SYNOPSIS
10
11 Compares mono build configuration content detecting diff's.
12
13 #>
14
15 param(
16     ## first config source to compare.
17     $mono_config_source1,
18
19     ## second config source to compare.
20     $mono_config_source2
21 )
22
23 if ((Test-Path -isvalid $mono_config_source1) -And (Test-Path $mono_config_source1))
24 {
25         $mono_config_source1_content = Get-Content $mono_config_source1
26 }
27 else
28 {
29         $mono_config_source1_content = $mono_config_source1
30 }
31
32 if ((Test-Path -isvalid $mono_config_source2) -And (Test-Path $mono_config_source2))
33 {
34         $mono_config_source2_content = Get-Content $mono_config_source2
35 }
36 else
37 {
38         $mono_config_source2_content = $mono_config_source2
39 }
40
41 ## Compare content.
42 $comparedLines = Compare-Object $mono_config_source1_content $mono_config_source2_content -IncludeEqual | Sort-Object { $_.InputObject.ReadCount }
43 $comparedLines | foreach {
44     if($_.SideIndicator -ne "==")
45     {
46                 Write-Host "Changes detected."
47                 exit 1;
48     }
49 }
50
51 exit 0;