diff options
Diffstat (limited to '.packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/Build.Common.targets')
-rwxr-xr-x | .packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/Build.Common.targets | 324 |
1 files changed, 324 insertions, 0 deletions
diff --git a/.packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/Build.Common.targets b/.packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/Build.Common.targets new file mode 100755 index 0000000000..2bc4283f53 --- /dev/null +++ b/.packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/Build.Common.targets @@ -0,0 +1,324 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="CheckDesignTime"> + + <!-- Provide default targets which can be hooked onto or overridden as necessary --> + <Target Name="BuildAndTest" DependsOnTargets="Build;Test" /> + <Target Name="RebuildAndTest" DependsOnTargets="Rebuild;Test" /> + <Target Name="Test" /> + + <PropertyGroup> + <!-- Due to a bug in the Roslyn Microsoft.NETCore.Compilers.props file, VisualBasicCoreTargetsPath is not set, and instead they set BasicCoreTargetsPath so the wrong targets get imported --> + <VisualBasicCoreTargetsPath Condition="'$(VisualBasicCoreTargetsPath)' == '' And '$(BasicCoreTargetsPath)' != ''">$(BasicCoreTargetsPath)</VisualBasicCoreTargetsPath> + + <BuildToolsTaskDir Condition="'$(BuildToolsTaskDir)' == ''">$(ToolsDir)</BuildToolsTaskDir> + + <!-- For UAP, we need to bin place the resources as resw files to create the runner's pri file. --> + <ResourcesFolderPath Condition="'$(ResourcesFolderPath)' == ''">$(RuntimePath)resw</ResourcesFolderPath> + + <!-- A number of the imports below depend on these default properties --> + <AssemblyVersion Condition="'$(AssemblyVersion)'==''">999.999.999.999</AssemblyVersion> + <CLSCompliant Condition="'$(CLSCompliant)'=='' and '$(IsTestProject)'=='true'">false</CLSCompliant> + <CLSCompliant Condition="'$(CLSCompliant)'==''">true</CLSCompliant> + + <!-- + Find projects in the tests folder which are not executable to distinguish + from accompanying support libraries. + --> + <IsInvokableTestProject Condition="'$(IsTestProject)' == 'true' AND '$(OutputType.ToLower())' != 'exe'">true</IsInvokableTestProject> + + <!-- + Check if the project has been localized by looking for the existence of the .de.xlf file. By convention, we assume that if + a project is localized in German, then it is localized in all languages. + --> + <ExcludeLocalizationImport Condition="'$(ExcludeLocalizationImport)'=='' And !Exists('$(MSBuildProjectDirectory)/MultilingualResources/$(MSBuildProjectName).de.xlf')">true</ExcludeLocalizationImport> + </PropertyGroup> + + <!-- Assembly metadata indicating that an assembly is a framework (as opposed to user) assembly: + Test projects need to not have this because of the way "IsFrameworkAssembly" APIs work to check this. --> + <ItemGroup Condition="'$(IsDotNetFrameworkProductAssembly)' == 'true' AND '$(IsTestProject)' != 'true'" > + <AssemblyMetadata Include=".NETFrameworkAssembly"> + <Value></Value> + </AssemblyMetadata> + <AssemblyMetadata Include="Serviceable"> + <Value>True</Value> + </AssemblyMetadata> + <AssemblyMetadata Include="PreferInbox"> + <Value>True</Value> + </AssemblyMetadata> + </ItemGroup> + + <!-- + Import the provides support for EnsureBuildToolsRuntime target which will restore a .NET Core based + runtime and setup a $(ToolRuntimePath) and $(ToolHost) for others to consume. + + This must be imported before any tools that need to use it are imported. + --> + <Import Project="$(MSBuildThisFileDirectory)toolruntime.targets" Condition="'$(ExcludeToolRuntimeImport)' != 'true'"/> + + <!-- + Import the reference assembly targets + + This must be imported early because it modifies OutputPath and IntermediateOutputPath + used by other targets + + Depends on Properties: + AssemblyVersion - Needed to determine API version used in + IsReferenceAssembly - Set if the project is in the ref assm path + + Sets Properties: + APIVersion - Major.Minor assembly version for the project + --> + <Import Project="$(MSBuildThisFileDirectory)ReferenceAssemblies.targets" Condition="'$(ExcludeReferenceAssembliesImport)'!='true'" /> + + <!-- + Import the codeAnalysis.targets file to enable analyzer support during build. + This should happen before we import the frameworkTargeting.targets because that import leads to computing a default + for the CodeAnalysisRuleset unless one is already specified + --> + <Import Project="$(MSBuildThisFileDirectory)codeAnalysis.targets" Condition="'$(ExcludeCodeAnalysisImport)' != 'true'" /> + + <!-- + Import the codeOptimization.targets file to enable profile guided code optimization for managed assemblies. + --> + <Import Project="$(MSBuildThisFileDirectory)codeOptimization.targets" /> + + <!-- + Import the Symbols.targets file to provide access to Symbol Server index/archive tooling. + --> + <Import Project="$(MSBuildThisFileDirectory)Symbols.targets" /> + + <!-- + Import the PublishProduct.targets file for publish tooling like NuGetPush. + --> + <Import Project="$(MSBuildThisFileDirectory)PublishProduct.targets" /> + + <!-- + Import the default target framework targets. + + Inputs: + TargetFrameworkIdentifier - If not set defaults to .NETPortable + TargetFrameworkVersion - If not set defaults to v4.5 + TargetFrameworkProfile - If not set defaults to Profile7 + + This Imports portable.csharp/visualbasic.targets if .NETPortable is the identifier otherwise it imports csharp/visualbasic.targets + --> + <Import Project="$(MSBuildThisFileDirectory)FrameworkTargeting.targets" Condition="'$(ExcludeFrameworkTargetingImport)'!='true'" /> + + <!-- + Import the default assembly info generation targets + + Inputs: + GenerateAssemblyInfo - Controls whether or not to generate the assembly info file and defaults to true if not set. + AssemblyVersion - If not set defaults to 1.0.0.0 but it is expected to be set in csproj files. + CLSCompliant - If not set defaults to true and if it is true then adds the assembly level CLSCompliant(true) attribute. + + File Version Inputs: + MajorVersion - If not set defaults to 1. + MinorVersion - If not set defaults to 0. + BuildNumberMajor - If not set defaults to 0. + BuildNumberMinor - If not set defaults to 0. + AssemblyFileVersion - If not set defaults to $(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor). + + BuildNumberTarget - If this property is set it will try to import the file which allows for it to override the properties above. + --> + <Import Project="$(MSBuildThisFileDirectory)versioning.targets" Condition="'$(ExcludeVersioningImport)'!='true'" /> + + <Import Project="$(MSBuildThisFileDirectory)Packaging.targets" Condition="'$(ExcludePackagingImport)'!='true' AND '$(MSBuildProjectExtension)' == '.pkgproj'" /> + + <!-- Task to detect the TestNugetRuntimeId of a platform. This target is here to allow both the test build and sync steps to use + the same property for asset selection. + --> + <UsingTask TaskName="GetTargetMachineInfo" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/> + <Target Name="GetDefaultTestRid"> + <GetTargetMachineInfo> + <Output TaskParameter="RuntimeIdentifier" PropertyName="DefaultTestNugetRuntimeId" /> + </GetTargetMachineInfo> + <!-- On Windows, we always use win7-x64 as the default test RID because the build context, + usually 32-bit full-framework MSBuild, is not a good default test context. --> + <PropertyGroup> + <DefaultTestNugetRuntimeId Condition="$(DefaultTestNugetRuntimeId.StartsWith('win'))">win7-x64</DefaultTestNugetRuntimeId> + <TestArchitecture Condition="'$(TestArchitecture)' == ''">x64</TestArchitecture> + <TestNugetRuntimeId Condition="'$(TestNugetRuntimeId)' == '' And '$(TestArchitecture)'=='x86'">win7-x86</TestNugetRuntimeId> + <TestNugetRuntimeId Condition="'$(TestNugetRuntimeId)' == ''">$(DefaultTestNugetRuntimeId)</TestNugetRuntimeId> + </PropertyGroup> + </Target> + + <PropertyGroup> + <ResolvePkgProjReferencesDependsOn>GetDefaultTestRid;$(ResolvePkgProjReferencesDependsOn)</ResolvePkgProjReferencesDependsOn> + </PropertyGroup> + + <!-- + Import the default package restore and resolve targets + + Inputs: + ProjectJson - If not set defaults to $(MSBuildProjectDirectory)\project.json + RestorePackages - If not set defaults to the existence of the $(ProjectJson) + ResolveNuGetPackages - If not set defaults to the existance of $(ProjectJson) + + Depends on properties: + NugetRestoreCommand - Used to restore the project packages from packages.config + DnuRestoreCommand - Used to restore the project packages from project.json + PackagesDir - Packages are restored to and resolved from this location + + Depends on properties set by csharp/visualbasic.targets so needs to be imported after. + --> + <Import Project="$(MSBuildThisFileDirectory)packageresolve.targets" Condition="'$(ExcludePackageResolveImport)'!='true'" /> + + <!-- + Import the optional tooling restore and resolve targets + + Inputs: + OptionalToolSource - If not set, optional tools are not restored + OptionalToolSourceUser - If not set, no authentication is used to access the feed + OptionalToolSourcePassword - If not set, no authentication is used to access the feed + + Depends on properties: + DnuRestoreCommand - Used to restore the optional tool packages + PackagesDir - Location to resolve optional tool package assets + ToolsDir - Location to find optional-tool-runtime project.json + --> + <Import Project="$(MSBuildThisFileDirectory)OptionalTooling.targets" /> + + <!-- + Import the partial facade generation targets + + Inputs: + GeneratePlatformNotSupportedAssembly - Determines wether to generate not-supported API for this assembly + --> + <Import Project="$(MSBuildThisFileDirectory)notsupported.targets" Condition="'$(ExcludePartialFacadesImport)' != 'true'"/> + + <!-- + Import the default SR resource generation targets + + Inputs: + ResourcesSourceOutputDirectory - If not set defaults to $(MSBuildProjectDirectory)\Resources. + StringResourcesPath - If not set defaults to $(ResourcesSourceOutputDirectory\Strings.resx if it exists. If the file exists + then the targets generates the strongly typed $(ResourcesSourceOutputDirectory)\SR.cs/vb file based on resource strings. + OmitResources - If set to true will skip resource inclusion even if StringResourcesPath exists. + --> + <Import Project="$(MSBuildThisFileDirectory)resources.targets" Condition="'$(ExcludeResourcesImport)'!='true'" /> + + <!-- + Import the localization target + --> + <Import Project="$(MSBuildThisFileDirectory)localization.targets" Condition="'$(ExcludeLocalizationImport)'!='true'" /> + + <!-- + Import the partial facade generation targets + + Inputs: + IsPartialFacadeAssembly - Determines whether the partial facade generation targets will be as a post-processing step on the + assembly. Also invokes special logic for determining References. + --> + <Import Project="$(MSBuildThisFileDirectory)partialfacades.targets" Condition="'$(ExcludePartialFacadesImport)' != 'true'"/> + + <!-- Import the ApiCompat targets. --> + <Import Project="$(MSBuildThisFileDirectory)ApiCompat.targets" Condition="'$(ExcludeApiCompatImport)' != 'true'"/> + + <!-- + Import the contract resolution targets + + Inputs: + AssemblyName - Needed to determine which contract name to map to + AssemblyVersion - Needed to determine which contract version to map to + --> + <Import Project="$(MSBuildThisFileDirectory)resolveContract.targets" Condition="'$(ExcludeResolveContractImport)' != 'true'"/> + <!-- + Import the default signing targets which will setup the authenticode properties and do OpenSourceSigning + + Inputs: + SkipSigning - For projects that want to opt-out of strong name signing the can set this to true. + --> + <Import Project="$(MSBuildThisFileDirectory)sign.targets" Condition="'$(ExcludeSigningImport)'!='true'" /> + + <!-- + Import the tests.targets which controls the publishing and running of the tests, including code coverage options. + + Inputs: + RunTestsForProject - Usually set at the project level to disable the tests for a single project. + CoverageEnabledForProject - Usually set at the project level to disable code coverage for a single project. + SkipTests - Usually set at the root level for builds that want to disable all the tests. + ProjectJson - If not set defaults to $(MSBuildProjectDirectory)\project.json + CopyTestToTestDirectory - If not set defaults to $(IsTestProject) + + Depends on Properties: + TestPath - Controls the root path from where the test assets are published and run from. + NugetRestoreCommand - Used to restore the test runtime package + DnuRestoreCommand - Used to restore the project packages from project.json + PackagesDir - Packages are restored to and resolved from this location + --> + <Import Project="$(MSBuildThisFileDirectory)tests.targets" Condition="'$(IsTestProject)'=='true' and '$(ExcludeTestsImport)'!='true'"/> + + <!-- + Import the PackageLibs.targets which exposes targets from library projects to report what + assets they contribute to nuget packages. + Inputs: + PackageTargetFramework - Target moniker to use for harvested dependencies. + If PackageTargetPath is not set, PackageTargetPath will be constructed + based on PackageTargetFramework. + + Optional Inputs: + PackageSourcePath - Source path to the built output to be packaged, default is $(TargetPath) + Can be overridden. + IsReferenceAssembly - true if this project is a reference assembly. + PackageTargetPath - Destination subpath in the package at which all assets from this project + should be located. Default is lib\$(PackageTargetFramework) for implementation + assemblies, ref\$(PackageTargetFramework) for reference assemblies. Can be + overridden. When overridding also override PackageTargetFramework. + PackageTargetRuntime - Runtime id to use for harvested dependencies, default is none. + Can be overridden. If PackageTargetRuntime is overridden and PackageTargetPath + is not, PackageTargetPath will be constructed based on PackageTargetRuntime. + @(PackageDestination) - List of items with TargetFramework metadata that represent destination + subpaths in the package at which all assets from this project should be + located. When specified takes precedence over PackageTargetPath & + PackageTargetFramework. + DocumentationFile - location of xml doc produced by this project. + XmlDocFileRoot - location to pre-authored localized xml doc files + PackageIncludeDocs - true to include the docs next to this project's ouput. Default + is true for reference assemblies, false for implementation. + --> + <Import Project="$(MSBuildThisFileDirectory)PackageLibs.targets" Condition="'$(ExcludePackageLibsImport)'!='true'"/> + + <Target Name="CheckDesignTime"> + <!-- + Visual Studio does a number of background builds to do a variety of tasks such as resolving references and preparing for intellisense. + These are called "design time" builds. You can only determine this state within a target as the properties VS sets are added at build time. + + To see design time logs set TRACEDESIGNTIME=true before launching Visual Studio. Logs will go to %TEMP%. + + Note that the existing $(DesignTimeBuild) is not set for all background builds. + --> + <PropertyGroup> + <VSDesignTimeBuild Condition="'$(BuildingInsideVisualStudio)'=='true' and '$(BuildingOutOfProcess)'=='false'">true</VSDesignTimeBuild> + </PropertyGroup> + </Target> + + <!-- + import the MicroBuild boot-strapper project (only relevant for shipping binaries) + NOTE: we import this at the end as it will override some dummy targets (e.g. SignFiles) + --> + <Import Project="$(MSBuildThisFileDirectory)MicroBuild.Core.targets" Condition="Exists('$(MSBuildThisFileDirectory)MicroBuild.Core.targets') and '$(IsTestProject)' != 'true' and '$(ExcludeSigningImport)' != 'true'" /> + + <!-- + Providing a definition for __BlockReflectionAttribute in an assembly is a signal to the .NET Native toolchain + to remove the metadata for all non-public APIs. This both reduces size and disables private reflection on those + APIs in libraries that include this. The attribute can also be applied to individual public APIs to similarly block them. + --> + <PropertyGroup> + <BlockReflectionAttribute Condition="'$(BlockReflectionAttribute)' == '' and '$(UWPCompatible)' == 'true' and '$(IsTestProject)' != 'true'">true</BlockReflectionAttribute> + <BlockReflectionAttribute Condition="'$(MSBuildProjectExtension)' != '.csproj'">false</BlockReflectionAttribute> + </PropertyGroup> + + <PropertyGroup Condition="'$(BlockReflectionAttribute)'=='true'"> + <CoreCompileDependsOn>$(CoreCompileDependsOn);AddBlockReflectionAttribute</CoreCompileDependsOn> + <BlockReflectionAtributeFile>$(MSBuildThisFileDirectory)/BlockReflectionAttribute.cs</BlockReflectionAtributeFile> + </PropertyGroup> + + <Target Name="AddBlockReflectionAttribute" > + <ItemGroup> + <Compile Include="$(BlockReflectionAtributeFile)" /> + </ItemGroup> + </Target> + + <Import Project="$(CustomAfterBuildCommonTargets)" Condition="Exists('$(CustomAfterBuildCommonTargets)')"/> +</Project> |