eng/Directory.Build.Common.targets (283 lines of code) (raw):

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="Versioning.targets" /> <Target Name="ValidateTargetFrameworks" BeforeTargets="Build"> <ItemGroup> <RequiredTargetFrameworks Include="$(RequiredTargetFrameworks)" /> <ConfiguredTargetFrameworks Include="$(TargetFrameworks)" /> <MissingTargetFrameworks Include="@(RequiredTargetFrameworks)" Exclude="@(ConfiguredTargetFrameworks)" /> </ItemGroup> <Error Condition="'@(RequiredTargetFrameworks)' == ''" Text="List of required target frameworks is empty something must have messed up property RequiredTargetFrameworks[$(RequiredTargetFrameworks)]." /> <Error Condition="'@(MissingTargetFrameworks)' != ''" Text="Missing required target frameworks '@(MissingTargetFrameworks)'. Please ensure you add those frameworks." /> </Target> <Target Name="ValidateRunApiCompat" BeforeTargets="Build" Condition="'$(ValidateRunApiCompat)' == 'true'"> <Error Condition="'$(RunApiCompat)' == 'false' and '$(IncludeBuildOutput)' != 'false'" Text="Api Compat cannot be disabled."/> </Target> <!-- Set PackageProjectUrl and PackageReleaseNotes to the package README.md and CHANGELOG.md respectively for DataPlane Libraries --> <Target Name="SetPackageProjectUrlandReleaseNotes" BeforeTargets="GenerateNuspec" DependsOnTargets="InitializeSourceControlInformationFromSourceControlManager" Condition="'$(IsShippingLibrary)' == 'true' and '$(SourceRevisionId)' != ''"> <Error Condition="'$(IsClientLibrary)' == 'true' and '$(PackageReleaseNotes)' != ''" Text="Do NOT set PackageReleaseNotes property in the project. Release notes are added automatically from package changelog" /> <PropertyGroup> <PackageRootPath>$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory)/../))</PackageRootPath> <DirectoryPartofPath>$(PackageRootPath.Replace($(RepoRoot), ''))</DirectoryPartofPath> <PackageProjectUrl Condition="Exists('$(PackageRootPath)/README.md') and '$(SkipDevBuildNumber)' != 'true'">$([System.UriBuilder]::new($(RepositoryUrl)/blob/$(SourceRevisionId)/$(DirectoryPartofPath)README.md).Uri)</PackageProjectUrl> <PackageProjectUrl Condition="Exists('$(PackageRootPath)/README.md') and '$(SkipDevBuildNumber)' == 'true'">$([System.UriBuilder]::new($(RepositoryUrl)/blob/$(PackageId)_$(Version)/$(DirectoryPartofPath)README.md).Uri)</PackageProjectUrl> <PackageReleaseNotes Condition="Exists('$(PackageRootPath)/CHANGELOG.md') and '$(SkipDevBuildNumber)' != 'true'">$([System.UriBuilder]::new($(RepositoryUrl)/blob/$(SourceRevisionId)/$(DirectoryPartofPath)CHANGELOG.md).Uri)</PackageReleaseNotes> <PackageReleaseNotes Condition="Exists('$(PackageRootPath)/CHANGELOG.md') and '$(SkipDevBuildNumber)' == 'true'">$([System.UriBuilder]::new($(RepositoryUrl)/blob/$(PackageId)_$(Version)/$(DirectoryPartofPath)CHANGELOG.md).Uri)</PackageReleaseNotes> </PropertyGroup> </Target> <!-- Validates that there is a release note entry for the current package version --> <Target Name="ValidateReleaseNotes" BeforeTargets="SetPackageProjectUrlandReleaseNotes" Condition="'$(IsShippingLibrary)' == 'true'" > <PropertyGroup> <ValidateReleaseNotesScriptPath Condition=" '$(ValidateReleaseNotesScriptPath)'=='' ">$(MSBuildThisFileDirectory)common/scripts/Verify-ChangeLog.ps1</ValidateReleaseNotesScriptPath> <ChangeLogPath>$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory)/../))CHANGELOG.md</ChangeLogPath> </PropertyGroup> <Exec ContinueOnError="true" ConsoleToMSBuild="true" StandardOutputImportance="High" Command="$(PowerShellExe) -NoProfile -NonInteractive -executionpolicy Unrestricted -File $(ValidateReleaseNotesScriptPath) -ChangeLogLocation $(ChangeLogPath) -VersionString $(_VersionInProject)"> <Output TaskParameter="ExitCode" PropertyName="SetReleaseNotesErrorCode" /> </Exec> <Error Condition="'$(SetReleaseNotesErrorCode)' != '0'" Text="ChangeLog verification failed for [$(ChangeLogPath)]." /> </Target> <!--Run Aggregate Updates to Source --> <Target Name="UpdateSourceOnBuild" AfterTargets="Build" Condition="'$(UpdateSourceOnBuild)' == 'true' and '$(IsShippingClientLibrary)' == 'true'" > <PropertyGroup> <CodeChecksScriptPath Condition=" '$(CodeChecksScriptPath)'=='' ">$(MSBuildThisFileDirectory)scripts/CodeChecks.ps1</CodeChecksScriptPath> </PropertyGroup> <Exec ConsoleToMSBuild="true" Command="$(PowerShellExe) -NoProfile -NonInteractive -executionpolicy Unrestricted -File $(CodeChecksScriptPath) -ProjectDirectory $(MSBuildProjectDirectory)"/> </Target> <PropertyGroup> <OriginalReadmeMdPath>$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory)/../))README.md</OriginalReadmeMdPath> <ProcessedReadmeMdPath>$(IntermediateOutputPath)README.md</ProcessedReadmeMdPath> <EnableNuGetReadmeMd Condition="'$(DesignTimeBuild)' != 'true' and Exists('$(OriginalReadmeMdPath)')">true</EnableNuGetReadmeMd> <PackageReadmeFile Condition="'$(EnableNuGetReadmeMd)' == 'true'">README.md</PackageReadmeFile> </PropertyGroup> <ItemGroup> <None Condition="'$(EnableNuGetReadmeMd)' != 'true' and Exists('$(OriginalReadmeMdPath)')" Include="$(OriginalReadmeMdPath)" Pack="true" PackagePath="/"/> <None Condition="'$(EnableNuGetReadmeMd)' == 'true'" Include="$(ProcessedReadmeMdPath)" Pack="true" PackagePath="/"/> </ItemGroup> <!-- Process and pack README.md --> <Target Name="ProcessReadmeMd" BeforeTargets="GenerateNuspec" Condition="'$(EnableNuGetReadmeMd)' == 'true'" > <PropertyGroup> <_ReadmeMdLines>$([System.IO.File]::ReadAllText($(OriginalReadmeMdPath)))</_ReadmeMdLines> <!-- remove comments https://github.com/NuGet/NuGetGallery/issues/8627 --> <_ReadmeMdLines><![CDATA[$([System.Text.RegularExpressions.Regex]::Replace('$(_ReadmeMdLines)', '\<\!--.*?-->', ''))]]></_ReadmeMdLines> <!-- remove impressions image --> <_ReadmeMdLines><![CDATA[$([System.Text.RegularExpressions.Regex]::Replace('$(_ReadmeMdLines)', '\!\[Impressions\]\(.*?\)', ''))]]></_ReadmeMdLines> </PropertyGroup> <WriteLinesToFile File="$(ProcessedReadmeMdPath)" Lines="$(_ReadmeMdLines)" Overwrite="true" WriteOnlyWhenDifferent="true" /> </Target> <!-- This allows us to build .NET Framework targets on non-windows TODO: Move the NETFramework reference assemblies to a feed other then the roslyn feed. --> <ItemGroup Condition="'$(IsTargetingNetFx)' == 'true' and '$(OS)' != 'Windows_NT'"> <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="all" IsImplicitlyDefined="true" /> </ItemGroup> <!-- Add Client SDK Tools --> <ItemGroup> <PackageReference Condition="'$(IsClientLibrary)' == 'true'" Include="Microsoft.Azure.AutoRest.CSharp" PrivateAssets="All" /> <PackageReference Condition="'$(GenerateAPIListing)' == 'true'" Include="Microsoft.DotNet.GenAPI" PrivateAssets="All" /> <PackageReference Condition="'$(EnableClientSdkAnalyzers)' == 'true'" Include="Azure.ClientSdk.Analyzers" PrivateAssets="All" /> <PackageReference Condition="'$(EnableMicrosoftCodeAnalysisNetAnalyzers)' == 'true'" Include="Microsoft.CodeAnalysis.NetAnalyzers" PrivateAssets="All" /> <PackageReference Condition="'$(EnableBannedApiAnalyzers)' == 'true'" Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" PrivateAssets="All" /> </ItemGroup> <!-- Remove packages built into the .NET 6+ runtime --> <ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))"> <PackageReference Remove="System.Buffers" /> <PackageReference Remove="System.Diagnostics.DiagnosticSource" /> <PackageReference Remove="System.Net.Http" /> <PackageReference Remove="System.Numerics.Vectors" /> <PackageReference Remove="System.Text.Encodings.Web" /> <PackageReference Remove="System.Text.Json" /> <PackageReference Remove="System.Threading.Channels" /> <PackageReference Remove="System.Threading.Tasks.Extensions" /> </ItemGroup> <!-- Add Package Icon to DataPlane Packages --> <ItemGroup Condition="'$(IsTestProject)' != 'true'"> <None Include="$(PackageIconPath)" Pack="true" PackagePath=""/> <None Condition="Exists('$(MSBuildProjectDirectory)/../CHANGELOG.md')" Include="$(MSBuildProjectDirectory)/../CHANGELOG.md" Pack="true" PackagePath=""/> </ItemGroup> <!-- Add App.config to enable server GC in net462 perf and stress projects --> <ItemGroup Condition="('$(IsPerfProject)' == 'true' or '$(IsStressProject)' == 'true') and '$(TargetFramework)' == 'net462'"> <None Include="$(RepoRoot)/common/Perf/App.config" /> </ItemGroup> <!-- Add StyleCop Analyzers --> <ItemGroup Condition="'$(EnableStyleCopAnalyzers)' == 'true'" > <PackageReference Include="StyleCop.Analyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference> <AdditionalFiles Include="$(RepoEngPath)\stylecop.json"> <Visible>false</Visible> </AdditionalFiles> </ItemGroup> <ItemGroup Condition="'$(IsClientLibrary)' == 'true'"> <AdditionalFiles Include="$(RepoEngPath)\BannedSymbols.txt"> <Visible>false</Visible> </AdditionalFiles> </ItemGroup> <!-- disable enhanced analysis--> <ItemGroup Condition="'$(DisableEnhancedAnalysis)' == 'true'"> <EditorConfigFiles Include="$(RepoEngPath)/globalconfigs/disable_enhanced_analysis.globalconfig" /> </ItemGroup> <!-- Enable SourceLink --> <ItemGroup Condition="'$(EnableSourceLink)' == 'true'"> <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" /> </ItemGroup> <PropertyGroup> <ImportDefaultReferences Condition="'$(ImportDefaultReferences)' == ''">true</ImportDefaultReferences> <DefaultReferenceTargets>AzSdk.reference.targets</DefaultReferenceTargets> <DefaultReferenceTargets Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true'">AzSdk.test.reference.targets</DefaultReferenceTargets> <!-- Disable running of tests for test helper libraries --> <IsTestProject Condition="'$(IsTestSupportProject)' == 'true'">false</IsTestProject> </PropertyGroup> <PropertyGroup Condition="'$(InheritDocEnabled)' != 'false' and '$(TargetFramework)' == 'netstandard2.0'"> <NoWarn> $(NoWarn);IDT001<!-- InheritDoc related to malformed XML in netstandard.xml --> </NoWarn> </PropertyGroup> <Import Project="$(DefaultReferenceTargets)" Condition="Exists('$(DefaultReferenceTargets)') And '$(ImportDefaultReferences)'=='true'" /> <Import Project="ApiListing.targets" /> <Import Project="CodeCoverage.targets" Condition="'$(CollectCoverage)' == 'true'" /> <Import Project="CodeGeneration.targets" Condition="'$(TemporaryUsePreviousGeneratorVersion)' == 'true'" /> <Import Project="Azure.Management.Test.targets" Condition="'$(IsMgmtLibrary)' == 'true' and '$(IsTestProject)' == 'true'" /> <!-- CentralPackageVersions properties --> <PropertyGroup> <CentralPackagesFile>$(MSBuildThisFileDirectory)Packages.Data.props</CentralPackagesFile> <CentralPackageVersionPackagePath>$(MSBuildThisFileDirectory)Microsoft.Build.CentralPackageVersions\2.0.46\Sdk</CentralPackageVersionPackagePath> <UseProjectReferenceToAzureClients Condition="'$(UseProjectReferenceToAzureClients)' == ''">false</UseProjectReferenceToAzureClients> </PropertyGroup> <ItemGroup Condition="'$(UseProjectReferenceToAzureClients)' == 'true'"> <!-- Find all non-management projects --> <AzureProjects Include="$(RepoRoot)/sdk/**/src/*.csproj" ProjectPath="%(Identity)" /> <PossibleProjectsToConvert Include="@(AzureProjects -> '%(Filename)')"/> <!-- Compute set of projects that intersect with the PackageReference's --> <_NotPackageReferences Include="@(PossibleProjectsToConvert)" Exclude="@(PackageReference)" /> <_NotPackageReferences Include="@(ExcludeFromProjectReferenceToConversion)" /> <ProjectsToConvert Include="@(PossibleProjectsToConvert)" Exclude="@(_NotPackageReferences)" /> <!-- Remove PackageReferences --> <PackageReference Remove="@(ProjectsToConvert)" /> <!-- Add ProjectReferences --> <ProjectReference Include="@(ProjectsToConvert -> '%(ProjectPath)')" /> <!-- Add System.ClientModel.SourceGeneration project reference if System.ClientModel was contained in ProjectsToConvert --> <_DependsOnSystemClientModel Include="@(ProjectsToConvert)" Exclude="System.ClientModel" /> <ProjectReference Condition="'@(_DependsOnSystemClientModel)' != '@(ProjectsToConvert)'" Include="$(RepoRoot)\sdk\core\System.ClientModel\gen\System.ClientModel.SourceGeneration.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" /> </ItemGroup> <!--TODO: update build targets - ADO 5668--> <PropertyGroup> <MgmtCoreShared>$(MSBuildThisFileDirectory)/../sdk/resourcemanager/Azure.ResourceManager/src/Shared</MgmtCoreShared> <ExcludeMgmtCoreShared Condition="'$(ExcludeMgmtCoreShared)' == ''">false</ExcludeMgmtCoreShared> </PropertyGroup> <ItemGroup Condition="'$(IsMgmtSubLibrary)' == 'true' and '$(IsMgmtLibrary)' == 'true' and '$(IsTestProject)' != 'true' and '$(ExcludeMgmtCoreShared)' == 'false'"> <Compile Include="$(MgmtCoreShared)/**/*.cs" LinkBase="Shared/Management" /> </ItemGroup> <!--TODO: end--> <!-- *********** Files needed for LRO ************* --> <ItemGroup Condition="'$(IncludeOperationsSharedSource)' == 'true'"> <Compile Include="$(AzureCoreSharedSources)AppContextSwitchHelper.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)AsyncLockWithValue.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)ClientDiagnostics.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)TrimmingAttribute.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)DiagnosticScope.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)DiagnosticScopeFactory.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)FixedDelayWithNoJitterStrategy.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)FormUrlEncodedContent.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)HttpMessageSanitizer.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)HttpPipelineExtensions.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)IOperationSource.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)IUtf8JsonSerializable.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)IXmlSerializable.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)NextLinkOperationImplementation.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)OperationFinalStateVia.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)OperationHelpers.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)OperationInternal.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)OperationInternalBase.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)OperationInternalOfT.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)OperationPoller.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)Page.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)PageableHelpers.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)ProtocolOperation.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)ProtocolOperationHelpers.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)RawRequestUriBuilder.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)RequestHeaderExtensions.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)RequestUriBuilderExtensions.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)ResponseHeadersExtensions.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)ResponseWithHeaders.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)ResponseWithHeadersOfTHeaders.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)ResponseWithHeadersOfTOfTHeaders.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)SequentialDelayStrategy.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)StringRequestContent.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)TaskExtensions.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)TypeFormatters.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)VoidValue.cs" LinkBase="Shared/Core" /> <Compile Include="$(AzureCoreSharedSources)XmlWriterContent.cs" LinkBase="Shared/Core" /> </ItemGroup> <!-- *********** Management Client Library Override section ************* --> <ItemGroup Condition="'$(IsMgmtLibrary)' == 'true' and '$(IsTestProject)' != 'true'"> <PackageReference Include="Azure.Core" /> <!-- TODO: Review these file references--> <Compile Include="$(AzureCoreSharedSources)NoValueResponseOfT.cs" LinkBase="Shared" /> <Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" LinkBase="Shared" /> <Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared" /> <Compile Include="$(AzureCoreSharedSources)ForwardsClientCallsAttribute.cs" LinkBase="Shared/Core" /> </ItemGroup> <!-- DataFactory Project Specific Overrides--> <ItemGroup Condition="$(MSBuildProjectName) == 'Azure.ResourceManager.DataFactory'"> <PackageReference Include="Azure.Core.Expressions.DataFactory"/> </ItemGroup> <!-- Management Client TEST Project Specific Overrides --> <ItemGroup Condition="('$(IsMgmtLibrary)' == 'true' and '$(IsTestProject)' == 'true') or '$(IsStorageTest)' == 'true'"> <ProjectReference Condition="'$(IsMgmtLibrary)' == 'true' and '$(IsTestProject)' == 'true'" Include="$(AzureCoreTestFramework)" /> <PackageReference Include="NUnit" /> <PackageReference Include="NUnit3TestAdapter" /> <PackageReference Include="Microsoft.NET.Test.Sdk" /> <PackageReference Include="Moq" /> </ItemGroup> <!-- *********** END OF Management Client Library Override section ************* --> <!-- Added layer of checks to make sure we correctly switched to project references --> <Target Name="VerifyProjectReferencesReferences" AfterTargets="Build"> <ItemGroup> <AzureReferences Include="@(ReferencePath)" Condition="$([System.String]::Copy('%(Filename)').StartsWith('Azure.'))" /> </ItemGroup> <ItemGroup Condition="'$(UseProjectReferenceToAzureClients)' == 'true'"> <ShouldBeProjectReference Include="@(AzureReferences)" Exclude="@(AzureReferences->HasMetadata('MSBuildSourceProjectFile'))" /> </ItemGroup> <Error Condition="'$(UseProjectReferenceToAzureClients)' == 'true' and '@(ShouldBeProjectReference)' != ''" Text="When UseProjectReferenceToAzureClients=true all Azure.* references should be Project References, but the following are not [@(ShouldBeProjectReference)]" /> </Target> <!-- Added layer of checks to make sure release packages don't have preview dependencies --> <Target Name="VerifyProjectReferencesReferences" Condition="'$(HasReleaseVersion)' == 'true' AND '$(IsPackable)' == 'true'" BeforeTargets="GenerateNuspec"> <Msbuild Projects="@(_ProjectReferencesFromAssetsFile)" Targets="_GetProjectVersion" SkipNonexistentTargets="true" SkipNonexistentProjects="true" Properties="BuildProjectReferences=false;SkipDevBuildNumber=true"> <Output TaskParameter="TargetOutputs" ItemName="_ProjectReferencesWithoutDevVersions"/> </Msbuild> <ItemGroup> <_AllReferencesWithVersions Include="@(_ProjectReferencesWithoutDevVersions)" Version="%(ProjectVersion)" /> <_AllReferencesWithVersions Include="@(PackageReference)" Condition="!$([System.String]::Copy('%(PackageReference.PrivateAssets)').ToLower().Equals('all'))"/> <PreviewPackageReferences Include="@(_AllReferencesWithVersions)" Condition="$([System.String]::Copy('%(Version)').Contains('-'))" /> </ItemGroup> <Error Condition="'@(PreviewPackageReferences)' != ''" Text="When the project has a release version it shouldn't reference any pre-release libraries. Found the following pre-release references: @(PreviewPackageReferences, ', ')" /> </Target> <!-- Validates that all the mgmt libraries have a trigger path in the core resourcemanager pipeline --> <Target Name="ValidateResourceManagerPipelineTriggers" AfterTargets="Build" Condition="'$(IsMgmtSubLibrary)' == 'true' and '$(IsShippingLibrary)' == 'true'" > <PropertyGroup> <_ResourceManagerCIFile>$(RepoRoot)/sdk/resourcemanager/ci.mgmt.yml</_ResourceManagerCIFile> <_ResourceManagerCIFileContents>$([System.IO.File]::ReadAllText($(_ResourceManagerCIFile)))</_ResourceManagerCIFileContents> <_ContainsTrigger>$([System.Text.RegularExpressions.Regex]::IsMatch($(_ResourceManagerCIFileContents), `- sdk/.*/$(MSBuildProjectName)\W+`))</_ContainsTrigger> </PropertyGroup> <Error Condition="'$(_ContainsTrigger)' != 'true'" Text="The core resourcemanager pipeline ['$(_ResourceManagerCIFile)'] does not contain a trigger path for your library please run 'eng/scripts/Update-Mgmt-CI.ps1' to add the correct trigger paths." /> </Target> <!-- InheritDoc--> <ItemGroup Condition="'$(InheritDocEnabled)' != 'false'"> <PackageReference Include="SauceControl.InheritDoc" PrivateAssets="all" /> </ItemGroup> <!-- Fixup netstandard2.malformed docs issue https://github.com/saucecontrol/InheritDoc#bad-netstandard-docs --> <ItemGroup Condition="'$(InheritDocEnabled)' != 'false' and '$(TargetFramework)' == 'netstandard2.0'"> <PackageDownload Include="NETStandard.Library.Ref" /> <InheritDocReference Include="$(NugetPackageRoot)\netstandard.library.ref\2.1.0\ref\netstandard2.1\netstandard.xml" /> </ItemGroup> <!-- Additional PackageReferences should be placed above this PropertyGroup --> <PropertyGroup> <ApiCompatExcludeAttributeList>$(MSBuildThisFileDirectory)ApiListing.exclude-attributes.txt</ApiCompatExcludeAttributeList> </PropertyGroup> <ItemGroup Condition="'$(ApiCompatVersion)' != ''"> <PackageDownload Include="$(PackageId)" Version="[$(ApiCompatVersion)]" /> <PackageReference Include="Microsoft.DotNet.ApiCompat" PrivateAssets="all" /> </ItemGroup> <Target Name="_ResolveResolvedMatchingContract" BeforeTargets="ValidateApiCompatForSrc" Condition="'$(ApiCompatVersion)' != ''"> <ItemGroup> <_ReferencePathDirectories Include="@(ReferencePath -> '%(RootDir)%(Directory)')" /> <ResolvedMatchingContract Include="$(NuGetPackageRoot)\$(PackageId.ToLower())\$(ApiCompatVersion)\lib\$([MSBuild]::ValueOrDefault('$(ApiCompatBaselineTargetFramework)', '$(TargetFramework)'))\$(TargetFileName)"> <DependencyPaths>@(_ReferencePathDirectories->Distinct(), ',')</DependencyPaths> </ResolvedMatchingContract> </ItemGroup> </Target> <Target Name="ApiCompatFinishedMessage" AfterTargets="ValidateApiCompatForSrc" Condition="'$(ApiCompatVersion)' != ''"> <Message Text="Ran ApiCompat against %(ResolvedMatchingContract.Identity) using assemblies from $(IntermediateOutputPath)" Importance="High" /> </Target> <Target Name="RunApiCompat" DependsOnTargets="ValidateApiCompatForSrc" Condition="'$(ApiCompatVersion)' != ''"> </Target> <Target Name="GetPackageInfo"> <PropertyGroup> <PackageIsNewSdk>false</PackageIsNewSdk> <PackageIsNewSdk Condition="'$(IsClientLibrary)' == 'true' or '$(IsFunctionsLibrary)' == 'true'">true</PackageIsNewSdk> <PackageSdkType>data</PackageSdkType> <PackageSdkType Condition="'$(IsClientLibrary)' == 'true'">client</PackageSdkType> <PackageSdkType Condition="'$(IsFunctionsLibrary)' == 'true'">functions</PackageSdkType> <PackageSdkType Condition="'$(IsMgmtLibrary)' == 'true'">mgmt</PackageSdkType> <PackageRootDirectory>$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory)/../).TrimEnd("/").TrimEnd("\\"))</PackageRootDirectory> <!-- If the AddDevVersion property is true this will output the generated dev version (e.g. 1.0.0-alpha.20210921.1) --> <VersionForProperties>$(_VersionInProject)</VersionForProperties> <VersionForProperties Condition="'$(AddDevVersion)' == 'true'">$(Version)</VersionForProperties> <!-- Parse out the service directory based on the relative path to the sdk folder --> <ServiceDirectory><![CDATA[$([System.Text.RegularExpressions.Regex]::Replace($(PackageRootDirectory), '^.*[\\/]+sdk[\\/]+([^\\/]+).*$', '$1'))]]></ServiceDirectory> </PropertyGroup> <Message Condition="'$(IsShippingLibrary)' == 'true'" Text="'$(PackageRootDirectory)' '$(ServiceDirectory)' '$(PackageId)' '$(VersionForProperties)' '$(PackageSdkType)' '$(PackageIsNewSdk)' '$(BaseOutputPath)'" Importance="High" /> </Target> <Target Name="GetCodeGenProjects" Returns="@(ProjectsToInclude)"> <ItemGroup Condition="'$(_GenerateCode)' == 'true'"> <ProjectsToInclude Include="$(MSBuildProjectFullPath)" /> </ItemGroup> </Target> <Target Name="_SetProjectDependsOnInnerTarget"> <PropertyGroup> <InnerTargets>ProjectDependsOnInner</InnerTargets> </PropertyGroup> </Target> <Target Name="ProjectDependsOn" DependsOnTargets="_SetProjectDependsOnInnerTarget;DispatchToInnerBuilds" Condition="'$(IsCrossTargetingBuild)' == 'true'" Returns="@(ProjectsToInclude)"> <RemoveDuplicates Inputs="@(InnerOutput)"> <Output TaskParameter="Filtered" ItemName="ProjectsToInclude"/> </RemoveDuplicates> </Target> <Target Name="ProjectDependsOnInner" DependsOnTargets="ResolveReferences" Returns="@(ProjectsToInclude)"> <ItemGroup> <_LibrariesReferenced Include="@(ReferencePath -> '%(Filename)')"/> <_DependsOnGiven Include="@(_LibrariesReferenced)" Condition="'%(Identity)' == '$(TestDependsOnDependency)'" /> </ItemGroup> <ItemGroup Condition="'@(_DependsOnGiven)' != '' and '$(IsClientLibrary)' == 'true'" > <ProjectsToInclude Include="$(MSBuildProjectFullPath)" /> </ItemGroup> </Target> <Import Project="$(CentralPackageVersionPackagePath)\Sdk.targets" /> </Project>