summaryrefslogtreecommitdiff
path: root/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Workarounds.targets
diff options
context:
space:
mode:
Diffstat (limited to '.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Workarounds.targets')
-rwxr-xr-x.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Workarounds.targets191
1 files changed, 191 insertions, 0 deletions
diff --git a/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Workarounds.targets b/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Workarounds.targets
new file mode 100755
index 0000000000..04749819ba
--- /dev/null
+++ b/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Workarounds.targets
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
+<Project>
+
+ <!-- Workaround for https://github.com/Microsoft/msbuild/issues/1310 -->
+ <Target Name="ForceGenerationOfBindingRedirects"
+ AfterTargets="ResolveAssemblyReferences"
+ BeforeTargets="GenerateBindingRedirects"
+ Condition="'$(AutoGenerateBindingRedirects)' == 'true'">
+ <PropertyGroup>
+ <!-- Needs to be set in a target because it has to be set after the initial evaluation in the common targets -->
+ <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
+ </PropertyGroup>
+ </Target>
+
+ <!--
+ Workaround to fix IntelliSense file generation for XAML projects
+ https://github.com/dotnet/project-system/issues/2488
+ -->
+ <Target Name="WorkaroundForXamlIntelliSenseBuildIssue" AfterTargets="_CheckCompileDesignTimePrerequisite">
+ <PropertyGroup>
+ <BuildingProject>false</BuildingProject>
+ </PropertyGroup>
+ </Target>
+
+ <!--
+ WPF temp project sets OutDir, which makes the SDK create an empty directory for it,
+ polluting the output dir. Avoid creating these directories.
+ https://github.com/dotnet/sdk/issues/1367
+ -->
+ <PropertyGroup Condition="'$(IsWpfTempProject)' == 'true'">
+ <OutDir/>
+ </PropertyGroup>
+
+ <ItemGroup Condition="'$(IsWpfTempProject)' == 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework'">
+ <Reference Include="mscorlib" Pack="false" />
+ </ItemGroup>
+
+ <!--
+ Workaround for a race condition https://github.com/Microsoft/msbuild/issues/1479.
+ -->
+ <PropertyGroup>
+ <TargetFrameworkMonikerAssemblyAttributesPath>$(IntermediateOutputPath)$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)</TargetFrameworkMonikerAssemblyAttributesPath>
+ <TargetFrameworkMonikerAssemblyAttributesFileClean>true</TargetFrameworkMonikerAssemblyAttributesFileClean>
+ </PropertyGroup>
+
+ <!--
+ Portable PDBs are not included in .nupkg by default. Include them unless the project produces symbol packages.
+ Remove this once we migrate to .snupkg. See https://github.com/dotnet/arcade/issues/1959.
+ -->
+ <PropertyGroup Condition="'$(DebugType)' == 'portable' and '$(IncludeSymbols)' != 'true'">
+ <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
+ </PropertyGroup>
+
+ <!--
+ Workarounds for insufficient support for tools packages by NuGet Pack: https://github.com/NuGet/Home/issues/6321.
+
+ Project that produce tools packages use .nuspec file in order to include all the needed dependencies.
+ This target translates common msbuild properties to NuSpec properties.
+ -->
+ <Target Name="InitializeStandardNuspecProperties"
+ BeforeTargets="GenerateNuspec"
+ DependsOnTargets="_InitializeNuspecRepositoryInformationPropertiesWorkaround"
+ Condition="'$(IsPackable)' == 'true'">
+
+ <PropertyGroup>
+ <PackageId Condition="'$(NuspecPackageId)' != ''">$(NuspecPackageId)</PackageId>
+ <PackageProjectUrl Condition="'$(PackageProjectUrl)' == ''">$(RepositoryUrl)</PackageProjectUrl>
+ </PropertyGroup>
+
+ <Error Text="PackageDescription must be specified" Condition="'$(PackageDescription)' == ''"/>
+ <Error Text="PackageProjectUrl must be specified" Condition="'$(PackageProjectUrl)' == ''"/>
+ <Error Text="RepositoryUrl must be specified" Condition="'$(RepositoryUrl)' == ''"/>
+ <Error Text="RepositoryCommit must be specified" Condition="'$(RepositoryCommit)' == ''"/>
+ <Error Text="RepositoryType must be specified" Condition="'$(RepositoryType)' == ''"/>
+ <Error Text="Either PackageLicenseExpression or PackageLicenseFile must be specified" Condition="'$(PackageLicenseExpression)' == '' and '$(PackageLicenseFile)' == ''"/>
+
+ <PropertyGroup Condition="'$(NuspecFile)' != '' and '$(NuspecProperties)' == ''">
+ <_LicenseElement/>
+ <_LicenseElement Condition="'$(PackageLicenseExpression)' != ''">
+ <license type="expression">$(PackageLicenseExpression)</license>
+ </_LicenseElement>
+ <_LicenseElement Condition="'$(PackageLicenseFile)' != ''">
+ <license type="file">$(PackageLicenseFile)</license>
+ </_LicenseElement>
+
+ <_TagsElement/>
+ <_TagsElement Condition="'$(PackageTags)' != ''">
+ <tags>$(PackageTags.Replace(';', ' '))</tags>
+ </_TagsElement>
+
+ <_IconUrlElement/>
+ <_IconUrlElement Condition="'$(PackageIcon)' == '' and '$(PackageIconUrl)' != ''">
+ <iconUrl>$(PackageIconUrl)</iconUrl>
+ </_IconUrlElement>
+
+ <_IconElement/>
+ <_IconElement Condition="'$(PackageIcon)' != ''">
+ <icon>$(PackageIcon)</icon>
+ </_IconElement>
+
+ <_IconFileElement/>
+ <_IconFileElement Condition="'$(PackageIcon)' != ''">
+ <file src="$(PackageIconFullPath)" target="$(PackageIcon)" />
+ </_IconFileElement>
+
+ <_ReleaseNotesElement/>
+ <_ReleaseNotesElement Condition="'$(PackageReleaseNotes)' != ''">
+ <releaseNotes>$(PackageReleaseNotes)</releaseNotes>
+ </_ReleaseNotesElement>
+
+ <_CommonMetadataElements>
+ <id>$(PackageId)</id>
+ <description>$(PackageDescription)</description>
+ <version>$(PackageVersion)</version>
+ <authors>$(Authors)</authors>
+ <requireLicenseAcceptance>$(PackageRequireLicenseAcceptance)</requireLicenseAcceptance>
+ $(_TagsElement)
+ $(_LicenseElement)
+ $(_IconElement)
+ $(_IconUrlElement)
+ $(_ReleaseNotesElement)
+ <projectUrl>$(PackageProjectUrl)</projectUrl>
+ <copyright>$(Copyright)</copyright>
+ <developmentDependency>$(DevelopmentDependency)</developmentDependency>
+ <serviceable>$(Serviceable)</serviceable>
+ <repository type="$(RepositoryType)" url="$(RepositoryUrl)" commit="$(RepositoryCommit)" />
+ </_CommonMetadataElements>
+
+ <_CommonFileElements>
+ $(_IconFileElement)
+ </_CommonFileElements>
+ </PropertyGroup>
+
+ <ItemGroup Condition="'$(NuspecFile)' != '' and '$(NuspecProperties)' == ''">
+ <NuspecProperty Include="CommonMetadataElements=$(_CommonMetadataElements)"/>
+ <NuspecProperty Include="CommonFileElements=$(_CommonFileElements)"/>
+ <NuspecProperty Include="PackageId=$(PackageId)"/>
+ <NuspecProperty Include="Version=$(PackageVersion)"/>
+ <NuspecProperty Include="ProjectDirectory=$(MSBuildProjectDirectory)"/>
+ </ItemGroup>
+ <PropertyGroup Condition="'$(NuspecFile)' != '' and '$(NuspecProperties)' == ''">
+ <NuspecProperties>@(NuspecProperty, ';')</NuspecProperties>
+ </PropertyGroup>
+ </Target>
+
+ <!--
+ Initialize Repository* properties from properties set by a source control package, if available in the project.
+ -->
+ <Target Name="_InitializeNuspecRepositoryInformationPropertiesWorkaround"
+ DependsOnTargets="InitializeSourceControlInformation"
+ Condition="'$(SourceControlInformationFeatureSupported)' == 'true'">
+ <PropertyGroup>
+ <!-- The project must specify PublishRepositoryUrl=true in order to publish the URL, in order to prevent inadvertent leak of internal URL. -->
+ <RepositoryUrl Condition="'$(RepositoryUrl)' == '' and '$(PublishRepositoryUrl)' == 'true'">$(PrivateRepositoryUrl)</RepositoryUrl>
+ <RepositoryCommit Condition="'$(RepositoryCommit)' == ''">$(SourceRevisionId)</RepositoryCommit>
+ </PropertyGroup>
+ </Target>
+
+ <!--
+ NuGet Restore uses PackageId and project name in the same namespace, so that project reference can be interchanged with a package reference.
+ This causes issues however for leaf packages that are not to be referenced (such as analyzer or tools packages) when we want to name the package
+ the same as an existing project in the solution. In that case we set PackageId to an invalid but unique value for Restore and override it for Pack
+ with the desired name stored in $(NuspecPackageId).
+ -->
+ <PropertyGroup Condition="'$(NuspecPackageId)' != ''">
+ <PackageId>*$(MSBuildProjectName)*</PackageId>
+ </PropertyGroup>
+
+ <!--
+ Source packaging helpers.
+ -->
+
+ <PropertyGroup Condition="'$(IsPackable)' == 'true' and '$(IsSourcePackage)' == 'true'">
+ <TargetsForTfmSpecificContentInPackage Condition="'$(NuspecFile)' == ''">$(TargetsForTfmSpecificContentInPackage);_AddSourceFilesToSourcePackage</TargetsForTfmSpecificContentInPackage>
+ </PropertyGroup>
+
+ <Target Name="_AddSourceFilesToSourcePackage">
+ <PropertyGroup>
+ <!-- TODO: language to dir name mapping (https://github.com/Microsoft/msbuild/issues/2101) -->
+ <_LanguageDirName>$(DefaultLanguageSourceExtension.TrimStart('.'))</_LanguageDirName>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <_File Remove="@(_File)"/>
+ <_File Include="$(MSBuildProjectDirectory)\**\*$(DefaultLanguageSourceExtension)" TargetDir="contentFiles/$(_LanguageDirName)/$(TargetFramework)" BuildAction="Compile" />
+
+ <TfmSpecificPackageFile Include="@(_File)" PackagePath="%(_File.TargetDir)/%(_File.RecursiveDir)%(_File.FileName)%(_File.Extension)"/>
+ </ItemGroup>
+ </Target>
+</Project>