Skip to content

Commit

Permalink
Cleanup MSBuild conditional operators to be all in lowercase (dotnet/…
Browse files Browse the repository at this point in the history
  • Loading branch information
safern authored Nov 8, 2019
1 parent 1953849 commit 50d8a5f
Show file tree
Hide file tree
Showing 55 changed files with 153 additions and 153 deletions.
6 changes: 3 additions & 3 deletions eng/codeAnalysis.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<Import Condition="Exists($(AnalyzerPropsFile)) AND '$(EnableAnalyzers)' == 'true'" Project="$(AnalyzerPropsFile)" />
<Import Condition="Exists($(AnalyzerPropsFile)) and '$(EnableAnalyzers)' == 'true'" Project="$(AnalyzerPropsFile)" />

<!-- This target is executed when building a project and EnableAnalyzers property is set to true.
It will populate the Analyzer item that is passed to the compiler with the analyzers restored
Expand All @@ -20,9 +20,9 @@
<Analyzer Include="@(ResolvedAnalyzer)" />
</ItemGroup>

<Warning Text="AnalyzersToExclude and AnalyzersToInclude shouldn't be set together, they are mutually exclusive." Condition="'@(AnalyzersToExclude)' != '' AND '@(AnalyzersToInclude)' != ''" />
<Warning Text="AnalyzersToExclude and AnalyzersToInclude shouldn't be set together, they are mutually exclusive." Condition="'@(AnalyzersToExclude)' != '' and '@(AnalyzersToInclude)' != ''" />

<ItemGroup Condition="'@(AnalyzersToExclude)' != '' OR '@(AnalyzersToInclude)' != ''">
<ItemGroup Condition="'@(AnalyzersToExclude)' != '' or '@(AnalyzersToInclude)' != ''">
<_AnalyzersToFileName Include="@(Analyzer -> '%(FileName)')">
<OriginalIdentity>%(Identity)</OriginalIdentity>
</_AnalyzersToFileName>
Expand Down
2 changes: 1 addition & 1 deletion eng/codeOptimization.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup Condition="'$(IsEligibleForNgenOptimization)' == ''">
<IsEligibleForNgenOptimization>true</IsEligibleForNgenOptimization>
<IsEligibleForNgenOptimization Condition="'$(IsReferenceAssembly)' == 'true'">false</IsEligibleForNgenOptimization>
<IsEligibleForNgenOptimization Condition="'$(GeneratePlatformNotSupportedAssembly)' == 'true' OR '$(GeneratePlatformNotSupportedAssemblyMessage)' != ''">false</IsEligibleForNgenOptimization>
<IsEligibleForNgenOptimization Condition="'$(GeneratePlatformNotSupportedAssembly)' == 'true' or '$(GeneratePlatformNotSupportedAssemblyMessage)' != ''">false</IsEligibleForNgenOptimization>
</PropertyGroup>

<Target Name="SetApplyNgenOptimization"
Expand Down
6 changes: 3 additions & 3 deletions eng/depProj.targets
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ See the LICENSE file in the project root for more information.

<Target Name="CoreCompile" Condition="'@(PackageReference)' != '' Or '@(PackageDownload)' == ''">

<Error Condition="'$(NuGetDeploySourceItem)' != 'ReferenceCopyLocalPaths' AND
'$(NuGetDeploySourceItem)' != 'Reference' AND
<Error Condition="'$(NuGetDeploySourceItem)' != 'ReferenceCopyLocalPaths' and
'$(NuGetDeploySourceItem)' != 'Reference' and
'$(NuGetDeploySourceItem)' != 'Analyzer'"
Text="Unexpected value for NuGetDeploySourceItem:'$(NuGetDeploySourceItem)'. Expected ReferenceCopyLocalPaths, Reference, or Analyzer." />

Expand Down Expand Up @@ -122,7 +122,7 @@ See the LICENSE file in the project root for more information.
<Target Name="FilterNugetPackages"
BeforeTargets="ResolveAssemblyReferences"
DependsOnTargets="ResolvePackageAssets"
Condition="'@(PackageToInclude)' != '' OR '@(PackageToExclude)' != '' OR '@(FileToInclude)' != '' OR '@(FileToExclude)' != ''">
Condition="'@(PackageToInclude)' != '' or '@(PackageToExclude)' != '' or '@(FileToInclude)' != '' or '@(FileToExclude)' != ''">
<ItemGroup>
<_nuGetDeploy Include="@($(NuGetDeploySourceItem))"/>
<_nuGetDeployByFileName Include="@(_nuGetDeploy->'%(FileName)')">
Expand Down
12 changes: 6 additions & 6 deletions eng/illink.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<ILLinkTrimInputSymbols>$(ILLinkTrimInputPath)$(TargetName).pdb</ILLinkTrimInputSymbols>
<ILLinkTrimOutputPath>$(IntermediateOutputPath)</ILLinkTrimOutputPath>

<ILLinkTrimXml Condition="'$(ILLinkTrimXml)' == '' AND Exists('$(MSBuildProjectDirectory)/ILLinkTrim.xml')">$(MSBuildProjectDirectory)/ILLinkTrim.xml</ILLinkTrimXml>
<ILLinkTrimXml Condition="'$(ILLinkTrimXml)' == '' and Exists('$(MSBuildProjectDirectory)/ILLinkTrim.xml')">$(MSBuildProjectDirectory)/ILLinkTrim.xml</ILLinkTrimXml>

<!-- if building a PDB, tell illink to rewrite the symbols file -->
<ILLinkRewritePDBs Condition="'$(ILLinkRewritePDBs)' == '' AND '$(DebugSymbols)' != 'false'">true</ILLinkRewritePDBs>
<ILLinkRewritePDBs Condition="'$(ILLinkRewritePDBs)' == '' and '$(DebugSymbols)' != 'false'">true</ILLinkRewritePDBs>
</PropertyGroup>

<ItemGroup Condition="'$(ILLinkTrimXml)' != ''">
Expand Down Expand Up @@ -73,7 +73,7 @@
<ILLinkArgs>$(ILLinkArgs) -p link $(TargetName)</ILLinkArgs>
<!-- keep type-forward assemblies (facades) -->
<ILLinkArgs>$(ILLinkArgs) -t</ILLinkArgs>
<ILLinkArgs Condition="'$(ILLinkRewritePDBs)' == 'true' AND Exists('$(ILLinkTrimAssemblySymbols)')">$(ILLinkArgs) -b true</ILLinkArgs>
<ILLinkArgs Condition="'$(ILLinkRewritePDBs)' == 'true' and Exists('$(ILLinkTrimAssemblySymbols)')">$(ILLinkArgs) -b true</ILLinkArgs>
<!-- keep types and members required by Debugger-related attributes -->
<ILLinkArgs>$(ILLinkArgs) -v true</ILLinkArgs>
<!-- don't remove the embedded root xml resource since ILLink may run again on the assembly -->
Expand All @@ -96,7 +96,7 @@
<!-- Move the PDB into a subdirectory for ILLink if we are rewriting PDBs -->
<Move SourceFiles="$(ILLinkTrimAssemblySymbols)"
DestinationFolder="$(ILLinkTrimInputPath)"
Condition="'$(ILLinkRewritePDBs)' == 'true' AND Exists('$(ILLinkTrimAssemblySymbols)')"
Condition="'$(ILLinkRewritePDBs)' == 'true' and Exists('$(ILLinkTrimAssemblySymbols)')"
/>

<ItemGroup>
Expand Down Expand Up @@ -174,11 +174,11 @@
Condition="'$(ILLinkTrimAssembly)' == 'true'">
<ItemGroup>
<PreTrimmedItem Condition="Exists('$(ILLinkTrimInputAssembly)')" Include="$(ILLinkTrimInputAssembly)" />
<PreTrimmedItem Condition="'$(ILLinkRewritePDBs)' == 'true' AND Exists('$(ILLinkTrimInputSymbols)')" Include="$(ILLinkTrimInputSymbols)" />
<PreTrimmedItem Condition="'$(ILLinkRewritePDBs)' == 'true' and Exists('$(ILLinkTrimInputSymbols)')" Include="$(ILLinkTrimInputSymbols)" />
<FileWrites Include="@(PreTrimmedItem)" />

<TrimmedItem Condition="Exists('$(ILLinkTrimAssemblyPath)')" Include="$(ILLinkTrimAssemblyPath)" />
<TrimmedItem Condition="'$(ILLinkRewritePDBs)' == 'true' AND Exists('$(ILLinkTrimAssemblySymbols)')" Include="$(ILLinkTrimAssemblySymbols)" />
<TrimmedItem Condition="'$(ILLinkRewritePDBs)' == 'true' and Exists('$(ILLinkTrimAssemblySymbols)')" Include="$(ILLinkTrimAssemblySymbols)" />

<TrimmingReport Condition="Exists('$(AsmDiffReport)')" Include="$(AsmDiffReport)" />
<TrimmingReport Condition="Exists('$(AsmDiffList)')" Include="$(AsmDiffList)" />
Expand Down
2 changes: 1 addition & 1 deletion eng/notSupported.SourceBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<MakeDir Condition="'$(DotNetBuildOffline)' != 'true'" Directories="$(_notSupportedSourceDirectory)" />

<Error Condition="'$(DotNetBuildOffline)' == 'true' AND !Exists('$(NotSupportedSourceFile)')"
<Error Condition="'$(DotNetBuildOffline)' == 'true' and !Exists('$(NotSupportedSourceFile)')"
Text="Error NotSupportedSourceFile '$(NotSupportedSourceFile)' did not exist under DotNetSourceBuildIntermediatePath." />

<!-- DotNetBuildOffline == true, don't use GenAPI and include source from DotNetSourceBuildIntermediatePath -->
Expand Down
2 changes: 1 addition & 1 deletion eng/packaging.props
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<PackageConfigurations>$(BuildConfigurations)</PackageConfigurations>
</PropertyGroup>

<Import Condition="Exists('$(PkgDir)baseline\baseline.props') AND '$(MSBuildProjectExtension)' == '.pkgproj'" Project="$(PkgDir)baseline\baseline.props" />
<Import Condition="Exists('$(PkgDir)baseline\baseline.props') and '$(MSBuildProjectExtension)' == '.pkgproj'" Project="$(PkgDir)baseline\baseline.props" />

<PropertyGroup Condition="'$(OsEnvironment)'=='Unix'">
<!--
Expand Down
4 changes: 2 additions & 2 deletions eng/packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<_excludeCompile Condition="@(Dependency->WithMetadataValue('Exclude', 'Compile')->Count()) == @(Dependency->Count())">true</_excludeCompile>
</PropertyGroup>
<Error Text="Cannot have Exclude=Compile dependencies when targeting a desktop TFM. @(Dependency). You can exclude the reference asset in the package by setting the ExcludeReferenceAssets property to true in your project."
Condition="$([System.String]::Copy('%(Dependency.TargetFramework)').StartsWith('net4')) AND
'$(_excludeCompile)' == 'true' AND
Condition="$([System.String]::Copy('%(Dependency.TargetFramework)').StartsWith('net4')) and
'$(_excludeCompile)' == 'true' and
'%(Dependency.Identity)' != '_._'" />
</Target>
</Project>
14 changes: 7 additions & 7 deletions eng/referenceFromRuntime.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<Target Name="AddReferenceFromRuntimeForTests"
BeforeTargets="SetupDefaultReferences"
Condition="'$(IsTestProject)'=='true' AND '@(ReferenceFromRuntime)' != ''">
Condition="'$(IsTestProject)'=='true' and '@(ReferenceFromRuntime)' != ''">
<ItemGroup>
<Reference Include="@(ReferenceFromRuntime->'$(RuntimePath)%(Identity).dll')" />
</ItemGroup>
Expand All @@ -23,9 +23,9 @@
</PropertyGroup>

<Target Name="AddRuntimeProjectReference"
Condition="'$(IsTestProject)'!='true' AND '@(ReferenceFromRuntime)' != ''">
<Error Condition="('$(IsReferenceAssembly)' != 'true' OR '$(AllowReferenceFromRuntime)' == 'true') AND '$(RuntimeProjectFile)' == ''" Text="RuntimeProjectFile must be specified when using ReferenceFromRuntime from source projects." />
<Error Condition="'$(IsReferenceAssembly)' == 'true' AND '$(AllowReferenceFromRuntime)' != 'true'" Text="ReferenceFromRuntime may not be used from reference assemblies." />
Condition="'$(IsTestProject)'!='true' and '@(ReferenceFromRuntime)' != ''">
<Error Condition="('$(IsReferenceAssembly)' != 'true' or '$(AllowReferenceFromRuntime)' == 'true') and '$(RuntimeProjectFile)' == ''" Text="RuntimeProjectFile must be specified when using ReferenceFromRuntime from source projects." />
<Error Condition="'$(IsReferenceAssembly)' == 'true' and '$(AllowReferenceFromRuntime)' != 'true'" Text="ReferenceFromRuntime may not be used from reference assemblies." />

<ItemGroup>
<ProjectReference Include="$(RuntimeProjectFile)">
Expand All @@ -37,7 +37,7 @@

<Target Name="FilterReferenceFromRuntime"
AfterTargets="ResolveProjectReferences"
Condition="'$(IsTestProject)'!='true' AND '@(ReferenceFromRuntime)' != ''">
Condition="'$(IsTestProject)'!='true' and '@(ReferenceFromRuntime)' != ''">
<ItemGroup>
<!-- transform to filename in order to intersect -->
<_referencePathFromRuntimeByFileName Include="@(_referencePathFromRuntime->'%(FileName)')" Condition="'%(_referencePathFromRuntime.Extension)' == '.dll'" >
Expand All @@ -46,7 +46,7 @@

<!-- intersect with ReferenceFromRuntime -->
<_filteredReferencePathFromRuntimeByFileName Include="@(_referencePathFromRuntimeByFileName)"
Condition="'@(_referencePathFromRuntimeByFileName)' == '@(ReferenceFromRuntime)' AND '%(Identity)' != ''">
Condition="'@(_referencePathFromRuntimeByFileName)' == '@(ReferenceFromRuntime)' and '%(Identity)' != ''">
<Aliases>@(ReferenceFromRuntime->'%(Aliases)')</Aliases>
</_filteredReferencePathFromRuntimeByFileName>

Expand All @@ -58,7 +58,7 @@
</_remainingReferenceFromRuntimeWithNI>

<_filteredReferencePathFromRuntimeByFileName Include="@(_referencePathFromRuntimeByFileName)"
Condition="'@(_referencePathFromRuntimeByFileName)' == '@(_remainingReferenceFromRuntimeWithNI)' AND '%(Identity)' != ''">
Condition="'@(_referencePathFromRuntimeByFileName)' == '@(_remainingReferenceFromRuntimeWithNI)' and '%(Identity)' != ''">
<Aliases>@(_remainingReferenceFromRuntimeWithNI->'%(Aliases)')</Aliases>
</_filteredReferencePathFromRuntimeByFileName>

Expand Down
6 changes: 3 additions & 3 deletions eng/resources.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ResourcesSourceFileExtension Condition="'$(MSBuildProjectExtension)' == '.csproj'">.cs</ResourcesSourceFileExtension>
<ResourcesSourceFileExtension Condition="'$(MSBuildProjectExtension)' == '.vbproj'">.vb</ResourcesSourceFileExtension>

<StringResourcesPath Condition="'$(StringResourcesPath)' == '' AND Exists('$(MSBuildProjectDirectory)/Resources/Strings.resx')">$(MSBuildProjectDirectory)/Resources/Strings.resx</StringResourcesPath>
<StringResourcesPath Condition="'$(StringResourcesPath)' == '' and Exists('$(MSBuildProjectDirectory)/Resources/Strings.resx')">$(MSBuildProjectDirectory)/Resources/Strings.resx</StringResourcesPath>
<StringResourcesNamespace Condition="'$(StringResourcesNamespace)' == ''">System</StringResourcesNamespace>
<StringResourcesClassName Condition="'$(StringResourcesClassName)' == ''">SR</StringResourcesClassName>
<StringResourcesName Condition="'$(StringResourcesName)' == ''">FxResources.$(AssemblyName).$(StringResourcesClassName)</StringResourcesName>
Expand All @@ -15,7 +15,7 @@
</PropertyGroup>

<!-- Include files under StringResourcesPath by convention unless OmitResources is set. -->
<ItemGroup Condition="'$(StringResourcesPath)' != '' AND '$(OmitResources)' != 'true'">
<ItemGroup Condition="'$(StringResourcesPath)' != '' and '$(OmitResources)' != 'true'">
<EmbeddedResource Include="$(StringResourcesPath)">
<Visible>true</Visible>
<ManifestResourceName>$(StringResourcesName)</ManifestResourceName>
Expand All @@ -25,7 +25,7 @@
</ItemGroup>

<!-- Include common SR helper when resources are included unless SkipCommonResourcesIncludes is set. -->
<ItemGroup Condition="Exists('$(StringResourcesPath)') AND '$(OmitResources)' != 'true' AND '$(SkipCommonResourcesIncludes)' == ''">
<ItemGroup Condition="Exists('$(StringResourcesPath)') and '$(OmitResources)' != 'true' and '$(SkipCommonResourcesIncludes)' == ''">
<Compile Include="$(CommonPath)/System/SR$(ResourcesSourceFileExtension)">
<Visible>true</Visible>
<Link>Resources/Common/SR$(ResourcesSourceFileExtension)</Link>
Expand Down
2 changes: 1 addition & 1 deletion eng/versioning.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<Target Name="DecideIfWeNeedToIncludeDllSafeSearchPathAttribute"
Condition="'$(IsDotNetFrameworkProductAssembly)' == 'true' AND '$(IsTestProject)' != 'true'">
Condition="'$(IsDotNetFrameworkProductAssembly)' == 'true' and '$(IsTestProject)' != 'true'">

<!-- We want to apply the IncludeDllSafeSearchPathAttribute on all DotNet assemblies (non test) that have a reference to System.Runtime.InteropServices -->
<PropertyGroup Condition="'$(IncludeDllSafeSearchPathAttribute)'==''">
Expand Down
Loading

0 comments on commit 50d8a5f

Please sign in to comment.