1 param($installPath, $toolsPath, $package, $project)
2 
3 $analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers" ) * -Resolve
4 
5 foreach($analyzersPath in $analyzersPaths)
6 {
7     # Install the language agnostic analyzers.
8     if (Test-Path $analyzersPath)
9     {
10         foreach ($analyzerFilePath in Get-ChildItem $analyzersPath -Filter *.dll)
11         {
12             if($project.Object.AnalyzerReferences)
13             {
14                 $project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName)
15             }
16         }
17     }
18 }
19 
20 # $project.Type gives the language name like (C# or VB.NET)
21 $languageFolder = ""
22 if($project.Type -eq "C#")
23 {
24     $languageFolder = "cs"
25 }
26 if($project.Type -eq "VB.NET")
27 {
28     $languageFolder = "vb"
29 }
30 if($languageFolder -eq "")
31 {
32     return
33 }
34 
35 foreach($analyzersPath in $analyzersPaths)
36 {
37     # Install language specific analyzers.
38     $languageAnalyzersPath = join-path $analyzersPath $languageFolder
39     if (Test-Path $languageAnalyzersPath)
40     {
41         foreach ($analyzerFilePath in Get-ChildItem $languageAnalyzersPath -Filter *.dll)
42         {
43             if($project.Object.AnalyzerReferences)
44             {
45                 $project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName)
46             }
47         }
48     }
49 }
50 # SIG # Begin signature block
51 # MIIaoQYJKoZIhvcNAQcCoIIakjCCGo4CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
52 # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
53 # AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQU2Q/XtUMgeda05ZRH6iWmJDPu
54 # oTCgghWCMIIEwzCCA6ugAwIBAgITMwAAAHPGWcJSl4OjOgAAAAAAczANBgkqhkiG
55 # 9w0BAQUFADB3MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G
56 # A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9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aQJaGCAigwggIkBgkqhkiG9w0BCQYxggIV
182 # MIICEQIBATCBjjB3MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQ
183 # MA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u
184 # MSEwHwYDVQQDExhNaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0ECEzMAAABzxlnCUpeD
185 # ozoAAAAAAHMwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw
186 # HAYJKoZIhvcNAQkFMQ8XDTE1MDYxOTAyNTk0OFowIwYJKoZIhvcNAQkEMRYEFGZQ
187 # e8ojPYUl1DjvBan3KNtqFEJdMA0GCSqGSIb3DQEBBQUABIIBAJHjS6vTvsLIuzBU
188 # xQdQopG+qV3hJzqh7u1uPdsknaqMLWjn9zF7Qy6q7gk17eCQ+uStUXdqMCYWqX6J
189 # GkpaBZGZpmmQ2uEau2G6TuxdN4nVFAmlO5W+RbfLBTizjTH3/VRJsLiIHNu0JpmM
190 # SjbuKpROk3wKYiUIsbWrHU0rpWmU6lX/xGv/zIZrMskzJ0Xas7+78S1zHeHlsoWS
191 # TMNtcy+MJfhAfAg6AX1x9Ga7T4J2uT+zo16rMqkIgH/VGmS3+/1ZIMY92ev6BOps
192 # smrx6ksElucvRtwE41kulKtPbziSPaIhCQyoIvvalwdjO+F0nd3lip/k4dJpUpzj
193 # d2EmeyI=
194 # SIG # End signature block
195