Skip to content

Commit

Permalink
Fixup whitespace and new lines in Common props, targets and tasks (#6159
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Nirmal4G committed Mar 4, 2021
1 parent f69319c commit 4144194
Show file tree
Hide file tree
Showing 25 changed files with 386 additions and 379 deletions.
1 change: 1 addition & 0 deletions src/Tasks/Microsoft.CSharp.CrossTargeting.targets
Expand Up @@ -17,6 +17,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<PropertyGroup>
<CSharpDesignTimeTargetsPath Condition="'$(CSharpDesignTimeTargetsPath)'==''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets</CSharpDesignTimeTargetsPath>
</PropertyGroup>

<Import Project="$(CSharpDesignTimeTargetsPath)" Condition="'$(CSharpDesignTimeTargetsPath)' != '' and Exists('$(CSharpDesignTimeTargetsPath)')" />

<Import Project="Microsoft.Common.CrossTargeting.targets" />
Expand Down
55 changes: 23 additions & 32 deletions src/Tasks/Microsoft.CSharp.CurrentVersion.targets
Expand Up @@ -8,7 +8,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
This file defines the steps in the standard build process specific for C# .NET projects.
For example, it contains the step that actually calls the C# compiler. The remainder
of the build process is defined in Microsoft.Common.targets, which is imported by
of the build process is defined in Microsoft.Common.targets, which is imported by
this file.
Copyright (C) Microsoft Corporation. All rights reserved.
Expand Down Expand Up @@ -66,14 +66,14 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<!--
The CreateManifestResourceNames target create the manifest resource names from the .RESX
files.
[IN]
@(EmbeddedResource) - The list of EmbeddedResource items that have been pre-processed to add metadata about resource type
Expected Metadata "Type" can either be "Resx" or "Non-Resx"
[OUT]
@(EmbeddedResource) - EmbeddedResource items with metadata
@(EmbeddedResource) - EmbeddedResource items with metadata
For C# applications the transformation is like:
Resources1.resx => RootNamespace.Resources1 => Build into main assembly
Expand All @@ -83,64 +83,56 @@ Copyright (C) Microsoft Corporation. All rights reserved.
For other project systems, this transformation may be different.
-->

<PropertyGroup>
<CreateManifestResourceNamesDependsOn></CreateManifestResourceNamesDependsOn>
</PropertyGroup>

<Target
Name="CreateManifestResourceNames"
Condition="'@(EmbeddedResource)' != ''"
DependsOnTargets="$(CreateManifestResourceNamesDependsOn)"
>

<ItemGroup>
<_Temporary Remove="@(_Temporary)" />
</ItemGroup>

<!-- Create manifest names for culture and non-culture Resx files, and for non-culture Non-Resx resources -->
<CreateCSharpManifestResourceName
ResourceFiles="@(EmbeddedResource)"
RootNamespace="$(RootNamespace)"
UseDependentUponConvention="$(EmbeddedResourceUseDependentUponConvention)"
Condition="'%(EmbeddedResource.ManifestResourceName)' == '' and ('%(EmbeddedResource.WithCulture)' == 'false' or '%(EmbeddedResource.Type)' == 'Resx')">

<Output TaskParameter="ResourceFilesWithManifestResourceNames" ItemName="_Temporary" />

</CreateCSharpManifestResourceName>

<!-- Create manifest names for all culture non-resx resources -->
<CreateCSharpManifestResourceName
ResourceFiles="@(EmbeddedResource)"
RootNamespace="$(RootNamespace)"
PrependCultureAsDirectory="false"
UseDependentUponConvention="$(EmbeddedResourceUseDependentUponConvention)"
Condition="'%(EmbeddedResource.ManifestResourceName)' == '' and '%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Non-Resx'">

<Output TaskParameter="ResourceFilesWithManifestResourceNames" ItemName="_Temporary" />

</CreateCSharpManifestResourceName>

<ItemGroup>
<EmbeddedResource Remove="@(EmbeddedResource)" Condition="'%(EmbeddedResource.ManifestResourceName)' == ''"/>
<EmbeddedResource Include="@(_Temporary)" />
<_Temporary Remove="@(_Temporary)" />
</ItemGroup>

</Target>

<Target
Name="ResolveCodeAnalysisRuleSet"
Condition="'$(CodeAnalysisRuleSet)' != ''"
>

<ResolveCodeAnalysisRuleSet
CodeAnalysisRuleSet="$(CodeAnalysisRuleSet)"
CodeAnalysisRuleSetDirectories="$(CodeAnalysisRuleSetDirectories)"
MSBuildProjectDirectory="$(MSBuildProjectDirectory)">

<Output TaskParameter="ResolvedCodeAnalysisRuleSet" PropertyName="ResolvedCodeAnalysisRuleSet" />

</ResolveCodeAnalysisRuleSet>

</Target>

<ItemGroup>
Expand All @@ -167,7 +159,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<CoreCompileDependsOn>$(CoreCompileDependsOn);_ComputeNonExistentFileProperty;ResolveCodeAnalysisRuleSet</CoreCompileDependsOn>
<ExportWinMDFile Condition="'$(ExportWinMDFile)' == '' and '$(OutputType)' == 'WinMDObj'">true</ExportWinMDFile>
</PropertyGroup>

<!--
The XamlPreCompile target must remain identical to
the CoreCompile target in Microsoft.CSharp.Core.targets.
Expand All @@ -183,14 +175,14 @@ Copyright (C) Microsoft Corporation. All rights reserved.
@(ReferencePath);
@(CompiledLicenseFile);
@(LinkResource);
@(EmbeddedDocumentation);
@(EmbeddedDocumentation);
$(Win32Resource);
$(Win32Manifest);
@(CustomAdditionalCompileInputs);
@(Page);
@(ApplicationDefinition);
$(ResolvedCodeAnalysisRuleSet)"

Outputs="@(DocFileItem);
@(XamlIntermediateAssembly);
@(_DebugSymbolsIntermediatePath);
Expand All @@ -217,26 +209,26 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<EmbedInteropTypes/>
</ReferencePath>
</ItemGroup>

<PropertyGroup>
<!-- If the user has specified AppConfigForCompiler, we'll use it. If they have not, but they set UseAppConfigForCompiler,
then we'll use AppConfig -->
<AppConfigForCompiler Condition="'$(AppConfigForCompiler)' == '' and '$(UseAppConfigForCompiler)' == 'true'">$(AppConfig)</AppConfigForCompiler>
<!-- If we are targeting winmdobj we want to specifically the pdbFile property since we do not want it to collide with the output of winmdexp-->

<!-- If we are targeting winmdobj we want to specifically the pdbFile property since we do not want it to collide with the output of winmdexp-->
<PdbFile Condition="'$(PdbFile)' == '' and '$(OutputType)' == 'winmdobj' and '$(_DebugSymbolsProduced)' == 'true'">$(IntermediateOutputPath)$(TargetName).compile.pdb</PdbFile>
</PropertyGroup>

<!-- Prefer32Bit was introduced in .NET 4.5. Set it to false if we are targeting 4.0 -->
<PropertyGroup Condition="('$(TargetFrameworkVersion)' == 'v4.0')">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>

<ItemGroup Condition="('$(AdditionalFileItemNames)' != '')">
<AdditionalFileItems Include="$(AdditionalFileItemNames)" />
<AdditionalFiles Include="@(%(AdditionalFileItems.Identity))" />
</ItemGroup>

<PropertyGroup Condition="'$(UseSharedCompilation)' == ''">
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>
Expand All @@ -259,7 +251,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
DisabledWarnings="$(NoWarn)"
DocumentationFile="@(DocFileItem)"
EmitDebugInformation="$(DebugSymbols)"
EnvironmentVariables="$(CscEnvironment)"
EnvironmentVariables="$(CscEnvironment)"
ErrorEndLocation="$(ErrorEndLocation)"
ErrorLog="$(ErrorLog)"
ErrorReport="$(ErrorReport)"
Expand All @@ -279,7 +271,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
Nullable="$(Nullable)"
Optimize="$(Optimize)"
OutputAssembly="@(XamlIntermediateAssembly)"
PdbFile="$(PdbFile)"
PdbFile="$(PdbFile)"
Platform="$(PlatformTarget)"
Prefer32Bit="$(Prefer32Bit)"
PreferredUILang="$(PreferredUILang)"
Expand Down Expand Up @@ -322,15 +314,17 @@ Copyright (C) Microsoft Corporation. All rights reserved.
</PropertyGroup>

<Import Project="$(CSharpCoreTargetsPath)" />

<!-- Import design time targets for Roslyn Project System. These are only available if Visual Studio is installed. -->
<!-- Import design time targets before the common targets, which import targets from Nuget. -->
<PropertyGroup>
<CSharpDesignTimeTargetsPath Condition="'$(CSharpDesignTimeTargetsPath)'==''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets</CSharpDesignTimeTargetsPath>
</PropertyGroup>

<Import Project="$(CSharpDesignTimeTargetsPath)" Condition="'$(CSharpDesignTimeTargetsPath)' != '' and Exists('$(CSharpDesignTimeTargetsPath)')" />

<Import Project="Microsoft.Common.targets" />

<Import Project="$(MSBuildToolsPath)\Microsoft.ServiceModel.targets" Condition="('$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.0' and '$(TargetFrameworkVersion)' != 'v3.5') and Exists('$(MSBuildToolsPath)\Microsoft.ServiceModel.targets')"/>

<Target Name="_SetTargetFrameworkMonikerAttribute" BeforeTargets="GenerateTargetFrameworkMonikerAttribute">
Expand All @@ -346,26 +340,23 @@ using System.Reflection%3b

<PropertyGroup>
<Utf8Output Condition="'$(Utf8Output)' == ''">true</Utf8Output>

<!-- NoCompilerStandardLib maps to the compiler's /nostdlib option. By default we always
want that switch to be passed to the compiler so that either we or the user
provides the references
NoStdLib on the other hand indicates that the user doesn't want standard references
so only if NoStdLib isn't set to true, will we provide the standard references
-->
<NoCompilerStandardLib Condition=" '$(NoCompilerStandardLib)' == '' ">true</NoCompilerStandardLib>

<ErrorEndLocation Condition="'$(BuildingInsideVisualStudio)' == 'true' and '$(ErrorEndLocation)' == ''">true</ErrorEndLocation>

<!-- When building inside VS, by default use the same language for compiler messages as VS itself does. -->
<PreferredUILang Condition="'$(BuildingInsideVisualStudio)' == 'true' and '$(PreferredUILang)' == ''">$([System.Globalization.CultureInfo]::CurrentUICulture.Name)</PreferredUILang>
</PropertyGroup>

<!-- Add any "automatic" compiler references that need to be resolved when NoCompilerStandardLib is set
but the user hasn't told us to not include standard references -->
<ItemGroup Condition=" '$(NoCompilerStandardLib)' == 'true' and '$(NoStdLib)' != 'true' ">
<!-- Note that unlike VB, C# does not automatically locate System.dll as a "standard library"
instead the reference is always passed from the project. Also, for mscorlib.dll
instead the reference is always passed from the project. Also, for mscorlib.dll
we need to provide the explicit location in order to avoid resolving from, e.g.,
{CandidateAssemblyFiles}.
-->
Expand Down

0 comments on commit 4144194

Please sign in to comment.