Skip to content

Commit 650f289

Browse files
authored
[ci] Use '$(XAShouldAnalyzeAssembly)'=='True' (#6382)
Context: ad5f6e8 The CI nightly pipeline is failing with: /Users/builder/azdo/_work/4/s/xamarin-android/build-tools/scripts/RoslynAnalyzers.projitems(3,14): error MSB4113: Specified condition " $(XAShouldAnalyzeAssembly) " evaluates to "" instead of a boolean. The cause of the problem is commit ad5f6e8, which implicitly requires that `$(XAShouldAnalyzeAssembly)` have a "boolean" value, i.e. `True` or `False`. The empty string is not a valid boolean value. If `$(XAShouldAnalyzeAssembly)` isn't set -- as can be the case on the nightly CI run -- then an MSB4113 error results. Update the `<ItemGroup/>` within `build-tools/scripts/RoslynAnalyzers.projitems` to use a "safe" boolean expression: <ItemGroup Condition=" '$(XAShouldAnalyzeAssembly)' == 'True' "> This will work reliably even if `$(XAShouldAnalyzeAssembly)` isn't set.
1 parent 0eb7026 commit 650f289

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build-tools/scripts/RoslynAnalyzers.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22

3-
<ItemGroup Condition=" $(XAShouldAnalyzeAssembly) ">
3+
<ItemGroup Condition=" '$(XAShouldAnalyzeAssembly)' == 'True' ">
44
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
55
<PrivateAssets>all</PrivateAssets>
66
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)