<Project>
+ <PropertyGroup>
+ <!--
+ For non-SDK projects that import this file and then import Microsoft.Common.props,
+ tell Microsoft.Common.props not to import Directory.Build.props again
+ -->
+ <ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
+ </PropertyGroup>
+
<!--
Import the arcade sdk with these requirements.
After:
<ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin'))</ArtifactsBinDir>
</PropertyGroup>
- <PropertyGroup>
- <RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'tools-local'))</RepoToolsLocalDir>
- <RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(RepoToolsLocalDir)', 'tasks'))</RepoTasksDir>
+ <!--
+ Get ProjectToBuild and '<subset>ProjectToBuild' items. Using the items lets projects handle
+ $(Subset) automatically when creating project-to-project dependencies.
+ -->
+ <Import Project="$(RepositoryEngineeringDir)Subsets.props" />
+ <PropertyGroup>
<!-- Installer specific, required during restore. -->
<InstallerTasksOutputPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'installer.tasks'))</InstallerTasksOutputPath>
<InstallerTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$([MSBuild]::NormalizePath('$(InstallerTasksOutputPath)', 'Debug', 'netstandard2.0', 'installer.tasks.dll'))</InstallerTasksAssemblyPath>
<InstallerTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$([MSBuild]::NormalizePath('$(InstallerTasksOutputPath)', 'Debug', 'net46', 'installer.tasks.dll'))</InstallerTasksAssemblyPath>
<HostMachineInfoProps>$(ArtifactsObjDir)HostMachineInfo.props</HostMachineInfoProps>
- <LibrariesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'libraries'))</LibrariesProjectRoot>
- <CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'coreclr'))</CoreClrProjectRoot>
- <InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'installer'))</InstallerProjectRoot>
-
<DocsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'docs'))</DocsDir>
<ManPagesDir>$([MSBuild]::NormalizeDirectory('$(DocsDir)', 'manpages'))</ManPagesDir>
<CoreLibSharedDir>$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'System.Private.CoreLib', 'src'))</CoreLibSharedDir>
<RepositoryUrl>git://github.com/dotnet/runtime</RepositoryUrl>
<ProjectUrl>https://github.com/dotnet/runtime</ProjectUrl>
<LicenseUrl>https://github.com/dotnet/runtime/blob/master/LICENSE.TXT</LicenseUrl>
+ <LicenseFile>$(RepoRoot)LICENSE.TXT</LicenseFile>
+
+ <!-- Indicates this is not an officially supported release. Release branches should set this to false. -->
+ <IsPrerelease>true</IsPrerelease>
+
+ <!-- Experimental packages should not be stable -->
+ <SuppressFinalPackageVersion Condition="'$(SuppressFinalPackageVersion)' == '' and $(MSBuildProjectName.Contains('Experimental'))">true</SuppressFinalPackageVersion>
+ <IsShippingAssembly Condition="$(MSBuildProjectName.Contains('Experimental'))">false</IsShippingAssembly>
+
+ <!-- We don't want Private packages to be shipped to NuGet.org -->
+ <IsShippingPackage Condition="$(MSBuildProjectName.Contains('Private')) and '$(MSBuildProjectExtension)' == '.pkgproj'">false</IsShippingPackage>
+ </PropertyGroup>
+
+ <!-- Language configuration -->
+ <PropertyGroup>
+ <!-- default to allowing all language features -->
+ <LangVersion>latest</LangVersion>
+ <LangVersion Condition="'$(Language)' == 'C#'">preview</LangVersion>
+ <Deterministic>true</Deterministic>
+
+ <!-- Resource naming bug: https://github.com/microsoft/msbuild/issues/4740 -->
+ <EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
</PropertyGroup>
+ <PropertyGroup>
+ <!-- Default to portable build if not explicitly set -->
+ <PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
+ <!-- Used for launchSettings.json and runtime config files. -->
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ </PropertyGroup>
+
+ <Import Project="$(RepositoryEngineeringDir)Analyzers.props" />
+
</Project>
<Project>
+ <PropertyGroup>
+ <!--
+ For non-SDK projects that import this file and then import Microsoft.Common.targets,
+ tell Microsoft.Common.targets not to import Directory.Build.targets again
+ -->
+ <ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
+ </PropertyGroup>
+
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" Condition="'$(SkipImportArcadeSdkFromRoot)' != 'true'" />
+ <PropertyGroup>
+ <!--
+ Define this here (not just in Versions.props) because the SDK resets it
+ unconditionally in Microsoft.NETCoreSdk.BundledVersions.props.
+ -->
+ <NETCoreAppMaximumVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppMaximumVersion>
+ </PropertyGroup>
+
</Project>
\ No newline at end of file
<Project>
- <ItemGroup>
+ <PropertyGroup>
+ <CodeAnalysisRuleset>$(MSBuildThisFileDirectory)CodeAnalysis.ruleset</CodeAnalysisRuleset>
+ </PropertyGroup>
+ <ItemGroup Condition="'$(EnableAnalyzers)' == 'true'">
<PackageReference Include="Microsoft.DotNet.CodeAnalysis" Version="$(MicrosoftDotNetCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.4.0-beta2-final" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6" />
https://github.com/dotnet/arcade/issues/388
-->
- <PropertyGroup>
- <SkipImportArcadeSdkFromRoot>true</SkipImportArcadeSdkFromRoot>
- </PropertyGroup>
-
<Import Project="$(MSBuildThisFileDirectory)Subsets.props" />
<Target Name="CheckSpecifiedSubsetValidity"
artifacts to the test layout, then running the test subset.
-->
- <!-- Import only when imported by Arcade's Build.proj as we import Directory.Build.props ourselves. -->
- <Import Project="$(RepoRoot)Directory.Build.props" Condition="'$(SkipImportArcadeSdkFromRoot)' == 'true'" />
+ <PropertyGroup>
+ <LibrariesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'libraries'))</LibrariesProjectRoot>
+ <CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'coreclr'))</CoreClrProjectRoot>
+ <InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'installer'))</InstallerProjectRoot>
+ <RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'tools-local'))</RepoToolsLocalDir>
+ <RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(RepoToolsLocalDir)', 'tasks'))</RepoTasksDir>
+ </PropertyGroup>
<PropertyGroup>
<DefaultSubsetCategories>libraries-installer-coreclr</DefaultSubsetCategories>
<Project>
<PropertyGroup>
<MSBuildTreatWarningsAsErrors>false</MSBuildTreatWarningsAsErrors>
+ <EnableAnalyzers>true</EnableAnalyzers>
</PropertyGroup>
<!-- We need to import this props file which contains PackageReferences to analyzers so that
analyzer build assets are imported via the Tools generated props and targets -->
- <Import Project="$(RepositoryEngineeringDir)analyzers.props" Condition="Exists('$(RepositoryEngineeringDir)analyzers.props') and '$(DotNetBuildFromSource)' != 'true'" />
+ <Import Project="$(RepositoryEngineeringDir)Analyzers.props" Condition="Exists('$(RepositoryEngineeringDir)Analyzers.props') and '$(DotNetBuildFromSource)' != 'true'" />
<!-- source-built packages -->
<ItemGroup>
<!-- roslyn -->
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="$(MicrosoftNetCompilersToolsetVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
+
+ <!-- mono -->
+ <PackageReference Include="illink.tasks" Version="$(ILLinkTasksVersion)" PrivateAssets="all" IsImplicitlyDefined="true" ExcludeAssets="build" GeneratePathProperty="true" />
</ItemGroup>
<!-- excluded from offline portion of source build -->
<PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="$(MicrosoftSourceLinkVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>
- <Import Project="$(RepositoryEngineeringDir)restore\docs.targets" Condition="Exists('$(RepositoryEngineeringDir)restore\docs.targets') and '$(DotNetBuildFromSource)' != 'true'" />
- <Import Project="$(RepositoryEngineeringDir)restore\optimizationData.targets" Condition="Exists('$(RepositoryEngineeringDir)restore\optimizationData.targets') and '$(DotNetBuildFromSource)' != 'true' and '$(EnableNgenOptimization)' == 'true'" />
- <Import Project="$(RepositoryEngineeringDir)restore\illink.targets" Condition="Exists('$(RepositoryEngineeringDir)restore\illink.targets') and '$(ILLinkTrimAssembly)' != 'false'" />
+ <Import Project="$(RepositoryEngineeringDir)restore\docs.targets" Condition="'$(DotNetBuildFromSource)' != 'true'" />
+ <Import Project="$(RepositoryEngineeringDir)restore\optimizationData.targets" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(EnableNgenOptimization)' == 'true'" />
</Project>
<UsingToolXliff>false</UsingToolXliff>
<!-- Paths used during restore -->
<EnableNgenOptimization Condition="'$(EnableNgenOptimization)' == '' and '$(ConfigurationGroup)' == 'Release'">true</EnableNgenOptimization>
- <ILLinkDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsToolsetDir)', 'ILLink'))</ILLinkDir>
<IbcOptimizationDataDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'ibc'))</IbcOptimizationDataDir>
<XmlDocDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'docs'))</XmlDocDir>
<!-- Blob storage container that has the "Latest" channel to publish to. -->
<!-- Inputs and outputs of ILLinkTrimAssembly -->
<PropertyGroup>
- <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' And '$(MSBuildRuntimeType)' == 'core'">$(ILLinkDir)netcoreapp2.0/ILLink.Tasks.dll</ILLinkTasksPath>
- <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' And '$(MSBuildRuntimeType)' != 'core'">$(ILLinkDir)net472/ILLink.Tasks.dll</ILLinkTasksPath>
+ <ILLinkTasksDir>$([MSBuild]::NormalizeDirectory('$(PkgILLink_Tasks)', 'tools'))</ILLinkTasksDir>
+ <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' and '$(MSBuildRuntimeType)' == 'core'">$(ILLinkTasksDir)netcoreapp2.0/ILLink.Tasks.dll</ILLinkTasksPath>
+ <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' and '$(MSBuildRuntimeType)' != 'core'">$(ILLinkTasksDir)net472/ILLink.Tasks.dll</ILLinkTasksPath>
<ILLinkTrimAssemblyPath>$(IntermediateOutputPath)$(TargetName)$(TargetExt)</ILLinkTrimAssemblyPath>
<ILLinkTrimAssemblySymbols>$(IntermediateOutputPath)$(TargetName).pdb</ILLinkTrimAssemblySymbols>
<ILLinkTrimInputPath>$(IntermediateOutputPath)PreTrim/</ILLinkTrimInputPath>
+++ /dev/null
-<Project>
-
- <ItemGroup>
- <PackageReference Include="illink.tasks" Version="$(ILLinkTasksVersion)" PrivateAssets="all" IsImplicitlyDefined="true" ExcludeAssets="build" />
- </ItemGroup>
-
- <Target Name="IncludeToolsFiles"
- AfterTargets="Restore">
-
- <ItemGroup>
- <_illinkSrcFiles Include="$(NuGetPackageRoot)illink.tasks\$(ILLinkTasksVersion)\tools\**\*" />
- </ItemGroup>
-
- <Copy SourceFiles="@(_illinkSrcFiles)"
- DestinationFolder="$(ILLinkDir)%(_illinkSrcFiles.RecursiveDir)"
- SkipUnchangedFiles="true"
- UseHardlinksIfPossible="true" />
-
- </Target>
-</Project>
</Target>
+ <!-- Import targets here to have TargetPath and other macros defined. Limit to CoreLib. -->
+ <Import Condition="'$(MSBuildProjectName)' == 'System.Private.CoreLib'" Project="$(RepositoryEngineeringDir)illink.targets" />
+
</Project>
\ No newline at end of file
</PropertyGroup>
<PropertyGroup>
- <_ILLinkRuntimeRootDescriptorFileName Condition=" '$(_ILLinkRuntimeRootDescriptorFileName)' == '' ">System.Private.CoreLib.xml</_ILLinkRuntimeRootDescriptorFileName>
- <_ILLinkRuntimeRootDescriptorFilePath Condition=" '$(_ILLinkRuntimeRootDescriptorFilePath)' == '' ">$(IntermediateOutputPath)$(_ILLinkRuntimeRootDescriptorFileName)</_ILLinkRuntimeRootDescriptorFilePath>
+ <_ILLinkRuntimeRootDescriptorFilePath>$(ILLinkTrimXml)</_ILLinkRuntimeRootDescriptorFilePath>
<_NamespaceFilePath Condition=" '$(_NamespaceFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\namespace.h</_NamespaceFilePath>
<_MscorlibFilePath Condition=" '$(_MscorlibFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\mscorlib.h</_MscorlibFilePath>
<_CortypeFilePath Condition=" '$(_CortypeFilePath)' == '' ">$(MSBuildThisFileDirectory)..\inc\cortypeinfo.h</_CortypeFilePath>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <TargetsTriggeredByCompilation>
- $(TargetsTriggeredByCompilation);
- ILLinkTrimAssembly
- </TargetsTriggeredByCompilation>
- </PropertyGroup>
-
- <!-- Inputs and outputs of ILLinkTrimAssembly -->
- <PropertyGroup>
- <ILLinkTasksToolsDir>$(PkgILLink_Tasks)/tools</ILLinkTasksToolsDir>
- <ILLinkTasksDir>$(ILLinkTasksToolsDir)/net472/</ILLinkTasksDir>
- <ILLinkTasksDir Condition="'$(MSBuildRuntimeType)' == 'Core'">$(ILLinkTasksToolsDir)/netcoreapp2.0/</ILLinkTasksDir>
- <ILLinkTasksPath>$(ILLinkTasksDir)ILLink.Tasks.dll</ILLinkTasksPath>
- <ILLinkTrimAssembly Condition="'$(ILLinkTrimAssembly)' == ''">true</ILLinkTrimAssembly>
- <ILLinkTrimAssemblyPath>$(IntermediateOutputPath)$(TargetName)$(TargetExt)</ILLinkTrimAssemblyPath>
- <ILLinkTrimAssemblySymbols>$(IntermediateOutputPath)$(TargetName).pdb</ILLinkTrimAssemblySymbols>
- <ILLinkTrimInputPath>$(IntermediateOutputPath)PreTrim/</ILLinkTrimInputPath>
- <ILLinkTrimInputAssembly>$(ILLinkTrimInputPath)$(TargetName)$(TargetExt)</ILLinkTrimInputAssembly>
- <ILLinkTrimInputSymbols>$(ILLinkTrimInputPath)$(TargetName).pdb</ILLinkTrimInputSymbols>
- <ILLinkTrimOutputPath>$(IntermediateOutputPath)</ILLinkTrimOutputPath>
-
- <!-- if building a PDB, tell illink to rewrite the symbols file -->
- <ILLinkRewritePDBs Condition="'$(ILLinkRewritePDBs)' == '' AND '$(DebugSymbols)' != 'false'">true</ILLinkRewritePDBs>
- </PropertyGroup>
-
- <!-- Custom binplacing for pre/post-trimming and reports that is useful for analysis
- Must be enabled by setting BinPlaceILLinkTrimAssembly=true
- -->
- <ItemGroup Condition="'$(BinPlaceILLinkTrimAssembly)' == 'true'">
- <BinPlaceConfiguration Include="$(BuildConfiguration)">
- <RuntimePath>$(BinDir)ILLinkTrimAssembly/$(BuildConfiguration)/trimmed</RuntimePath>
- <ItemName>TrimmedItem</ItemName>
- </BinPlaceConfiguration>
- <BinPlaceConfiguration Include="$(BuildConfiguration)">
- <RuntimePath>$(BinDir)ILLinkTrimAssembly/$(BuildConfiguration)/reports</RuntimePath>
- <ItemName>TrimmingReport</ItemName>
- </BinPlaceConfiguration>
- <BinPlaceConfiguration Include="$(BuildConfiguration)">
- <RuntimePath>$(BinDir)ILLinkTrimAssembly/$(BuildConfiguration)/pretrimmed</RuntimePath>
- <ItemName>PreTrimmedItem</ItemName>
- </BinPlaceConfiguration>
- </ItemGroup>
-
- <!-- ILLinkTrimAssembly
- Examines the "input assembly" for IL that is unreachable from public API and trims that,
- rewriting the assembly to an "output assembly"
- -->
- <UsingTask TaskName="ILLink" AssemblyFile="$(ILLinkTasksPath)" />
- <Target Name="ILLinkTrimAssembly" Condition="'$(ILLinkTrimAssembly)' == 'true'">
- <PropertyGroup>
- <ILLinkArgs>$(ILLinkArgs)-r $(TargetName)</ILLinkArgs>
- <!-- default action for core assemblies -->
- <ILLinkArgs>$(ILLinkArgs) -c skip</ILLinkArgs>
- <!-- default action for non-core assemblies -->
- <ILLinkArgs>$(ILLinkArgs) -u skip</ILLinkArgs>
- <!-- trim the target assembly -->
- <ILLinkArgs>$(ILLinkArgs) -p link $(TargetName)</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 -->
- <ILLinkArgs>$(ILLinkArgs) --strip-resources false</ILLinkArgs>
- <!-- keep interface implementations -->
- <ILLinkArgs>$(ILLinkArgs) --disable-opt unusedinterfaces</ILLinkArgs>
- </PropertyGroup>
-
- <MakeDir Directories="$(ILLinkTrimInputPath)" />
-
- <!-- Move the assembly into a subdirectory for ILLink -->
- <Move SourceFiles="$(ILLinkTrimAssemblyPath)"
- DestinationFolder="$(ILLinkTrimInputPath)"
- />
-
- <!-- Move the PDB into a subdirectory for ILLink if we are rewriting PDBs -->
- <Move SourceFiles="$(ILLinkTrimAssemblySymbols)"
- DestinationFolder="$(ILLinkTrimInputPath)"
- Condition="'$(ILLinkRewritePDBs)' == 'true' AND Exists('$(ILLinkTrimAssemblySymbols)')"
- />
-
- <!-- When running from Desktop MSBuild, DOTNET_HOST_PATH is not set.
- In this case, explicitly specify the path to the dotnet host. -->
- <PropertyGroup Condition=" '$(DOTNET_HOST_PATH)' == '' ">
- <_DotNetHostDirectory>$(NetCoreRoot)</_DotNetHostDirectory>
- <_DotNetHostFileName>dotnet</_DotNetHostFileName>
- <_DotNetHostFileName Condition=" '$(OS)' == 'Windows_NT' ">dotnet.exe</_DotNetHostFileName>
- </PropertyGroup>
-
- <ILLink AssemblyPaths="$(ILLinkTrimInputAssembly)"
- RootAssemblyNames=""
- OutputDirectory="$(ILLinkTrimOutputPath)"
- ClearInitLocals="true"
- ClearInitLocalsAssemblies="$(TargetName)"
- ExtraArgs="$(ILLinkArgs)"
- ToolExe="$(_DotNetHostFileName)"
- ToolPath="$(_DotNetHostDirectory)" />
-
- </Target>
-
- <!-- ILLink reporting.
- Only enabled when developer specifies a path to the AsmDiff tool with property AsmDiffCmd.
- EG: AsmDiffCmd=d:\tools\asmdiff\asmdiff.exe
- This is necessary until the AsmDiff tool is ported to .NET Core. -->
- <Target Name="_CreateILLinkTrimAssemblyReports"
- AfterTargets="ILLinkTrimAssembly"
- Condition="'$(AsmDiffCmd)' != ''">
- <PropertyGroup>
- <AsmDiffArgs>$(AsmDiffArgs) $(ILLinkTrimInputAssembly)</AsmDiffArgs>
- <AsmDiffArgs>$(AsmDiffArgs) $(ILLinkTrimAssemblyPath)</AsmDiffArgs>
- <AsmDiffArgs>$(AsmDiffArgs) -includePrivateApis -includeInternalApis -alwaysDiffMembers -diffAttributes</AsmDiffArgs>
-
- <AsmDiffReport>$(IntermediateOutputPath)$(TargetName).diff.html</AsmDiffReport>
- <AsmDiffReportArgs>$(AsmDiffArgs) -out:$(AsmDiffReport)</AsmDiffReportArgs>
- <AsmDiffReportArgs>$(AsmDiffReportArgs) -unchanged -changed -added -removed</AsmDiffReportArgs>
-
- <AsmDiffList>$(IntermediateOutputPath)$(TargetName).diff.csv</AsmDiffList>
- <AsmDiffListArgs>$(AsmDiffArgs) -out:$(AsmDiffList)</AsmDiffListArgs>
- <AsmDiffListArgs>$(AsmDiffListArgs) -unchanged -changed -added -removed </AsmDiffListArgs>
- <AsmDiffListArgs>$(AsmDiffListArgs) -diffWriter:CSV</AsmDiffListArgs>
- </PropertyGroup>
-
- <Exec Command="$(AsmDiffCmd) $(AsmDiffReportArgs)" />
- <Message Text="Assembly trimming diff: $(AsmDiffReport)" />
- <Exec Command="$(AsmDiffCmd) $(AsmDiffListArgs)" />
- <Message Text="Assembly trimming report: $(AsmDiffList)" />
- </Target>
-
- <!-- Similar to _CheckForCompileOutputs and runs in the same places,
- always set these even if compile didn't run. -->
- <Target Name="_CheckForILLinkTrimAssemblyOutputs"
- BeforeTargets="CopyFilesToOutputDirectory;_CleanGetCurrentAndPriorFileWrites"
- Condition="'$(ILLinkTrimAssembly)' == 'true'">
- <ItemGroup>
- <PreTrimmedItem Condition="Exists('$(ILLinkTrimInputAssembly)')" Include="$(ILLinkTrimInputAssembly)" />
- <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)" />
-
- <TrimmingReport Condition="Exists('$(AsmDiffReport)')" Include="$(AsmDiffReport)" />
- <TrimmingReport Condition="Exists('$(AsmDiffList)')" Include="$(AsmDiffList)" />
- </ItemGroup>
- </Target>
-</Project>
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<EnableDefaultItems>false</EnableDefaultItems>
<GenerateResxSourceOmitGetResourceString>true</GenerateResxSourceOmitGetResourceString>
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
<EnsureRuntimePackageDependencies>false</EnsureRuntimePackageDependencies>
-
- <OutputType>Library</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<!-- Ensure a portable PDB is emitted for the project. A PDB is needed for crossgen. -->
<OutputPath>$(BinDir)IL/</OutputPath>
<Configurations>Debug;Release;Checked</Configurations>
<Platforms>x64;x86;arm;arm64</Platforms>
+
+ <ILLinkClearInitLocals>true</ILLinkClearInitLocals>
+ <ILLinkTrimAssembly>true</ILLinkTrimAssembly>
+ <ILLinkTrimXml>$(IntermediateOutputPath)System.Private.CoreLib.xml</ILLinkTrimXml>
</PropertyGroup>
<!-- Note that various places in SPCL depend on this resource name i.e. TplEventSource -->
<Configuration Condition=" '$(Configuration)' == '' ">$(BuildType)</Configuration>
<Platform Condition=" '$(Platform)' == '' ">$(BuildArch)</Platform>
<Platform Condition=" '$(Platform)' == 'armel' ">arm</Platform>
- <ProjectGuid>{3DA06C3A-2E7B-4CB7-80ED-9B12916013F9}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- This prevents the default MsBuild targets from referencing System.Core.dll -->
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)/Documentation</_FullFrameworkReferenceAssemblyPaths>
<SkipCommonResourcesIncludes>true</SkipCommonResourcesIncludes>
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
+ <EnableAnalyzers>false</EnableAnalyzers>
</PropertyGroup>
<!-- Platform specific properties -->
<!-- Assembly attributes -->
<PropertyGroup>
- <AssemblyName>System.Private.CoreLib</AssemblyName>
- <AssemblyVersion>5.0.0.0</AssemblyVersion>
- <ExcludeAssemblyInfoPartialFile>true</ExcludeAssemblyInfoPartialFile>
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<Description>$(AssemblyName)</Description>
</PropertyGroup>
<Exec Command=""$(PYTHON)" $(MSBuildThisFileDirectory)..\scripts\check-definitions.py "$(ProjectDir.TrimEnd('\'))" "$(CMakeDefinitionSaveFile)" "$(DefineConstants)" "$(IgnoreDefineConstants)" " />
</Target>
<PropertyGroup Condition="'$(BuildOS)' == 'Windows_NT'">
- <EnableDotnetAnalyzers Condition="'$(EnableDotnetAnalyzers)'==''">true</EnableDotnetAnalyzers>
- <UseWin32Apis>true</UseWin32Apis>
<OSGroup>Windows_NT</OSGroup>
</PropertyGroup>
<PropertyGroup>
<FeatureAsyncCausalityTracer Condition="'$(FeatureCominterop)' == 'true'">true</FeatureAsyncCausalityTracer>
</PropertyGroup>
- <!-- Globals used by ILLink.targets -->
- <PropertyGroup>
- <TargetName>$(MSBuildProjectName)</TargetName>
- <TargetExt>.dll</TargetExt>
- </PropertyGroup>
-
<!-- Setup ILLink.targets -->
<ItemGroup>
<PackageReference Include="ILLink.Tasks" Version="$(ILLinkTasksVersion)" ExcludeAssets="build" GeneratePathProperty="True" />
</ItemGroup>
- <!-- Analyzers -->
- <PropertyGroup>
- <CodeAnalysisRuleset>$(LibrariesProjectRoot)CodeAnalysis.ruleset</CodeAnalysisRuleset>
- </PropertyGroup>
- <ItemGroup>
- <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4" PrivateAssets="all" />
- <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66" PrivateAssets="all" />
- </ItemGroup>
-
<Import Project="CreateRuntimeRootILLinkDescriptorFile.targets" />
<Target Name="CreateRuntimeRootIlLinkDescFile" BeforeTargets="CoreCompile" DependsOnTargets="_CreateILLinkRuntimeRootDescriptorFile">
</Target>
<!-- This is working around dotnet/coreclr#26371 until dotnet/sourcelink#392 gets solved -->
- <Target Condition="'$(BuildingInsideVisualStudio)' != 'true'" Name="AddUntrackedResourcesForSourceLink"
- BeforeTargets="CoreCompile"
- DependsOnTargets="SetEmbeddedFilesFromSourceControlManagerUntrackedFiles;
- _GenerateResxSource" >
+ <Target Name="AddUntrackedResourcesForSourceLink"
+ Condition="'$(BuildingInsideVisualStudio)' != 'true'"
+ BeforeTargets="CoreCompile"
+ DependsOnTargets="SetEmbeddedFilesFromSourceControlManagerUntrackedFiles;_GenerateResxSource" >
<ItemGroup>
<EmbeddedFiles Include="@(GeneratedResxSource)" />
</ItemGroup>
- </Target>
-
- <ItemGroup>
- <EmbeddedResource Include="$(_ILLinkRuntimeRootDescriptorFilePath)">
- <LogicalName>$(MSBuildProjectName).xml</LogicalName>
- </EmbeddedResource>
- </ItemGroup>
-
- <Import Project="ILLink.targets" />
+ </Target>
</Project>
<Import Project="..\..\Directory.Build.props" />
<!--
- Get ProjectToBuild and '<subset>ProjectToBuild' items. Using the items lets projects handle
- $(Subset) automatically when creating project-to-project dependencies.
- -->
- <Import Project="$(RepositoryEngineeringDir)Subsets.props" />
-
- <!--
Before Microsoft.Common.targets, set the extensions path to match the restore dir as Arcade
sets it, so MSBuild packages with targets files will be found and imported.
-->
</PropertyGroup>
<PropertyGroup>
- <InstallerProjectRoot>$(MSBuildThisFileDirectory)</InstallerProjectRoot>
<SigningToolsDir>$(InstallerProjectRoot)signing\</SigningToolsDir>
- <LicenseFile>$(RepoRoot)LICENSE.TXT</LicenseFile>
</PropertyGroup>
<PropertyGroup>
</PropertyGroup>
<PropertyGroup>
- <!--
- This name is used to create a GIT repository URL https://github.com/dotnet/$(GitHubRepositoryName) used to find source code for debugging
- It is also used to name the build output manifest for orchestrated builds.
- -->
- <GitHubRepositoryName Condition="'$(GitHubRepositoryName)' == ''">core-setup</GitHubRepositoryName>
- </PropertyGroup>
-
- <!-- Build as portable by default -->
- <PropertyGroup>
- <PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
- </PropertyGroup>
-
- <PropertyGroup>
<SharedFrameworkName>Microsoft.NETCore.App</SharedFrameworkName>
<NETCoreAppFrameworkIdentifier>.NETCoreApp</NETCoreAppFrameworkIdentifier>
<NETCoreAppFrameworkMoniker>$(NETCoreAppFrameworkIdentifier),Version=v$(NETCoreAppFrameworkVersion)</NETCoreAppFrameworkMoniker>
<EnableSourceLink>false</EnableSourceLink>
<EnableSourceControlManagerQueries>false</EnableSourceControlManagerQueries>
<DeterministicSourcePaths>false</DeterministicSourcePaths>
- <!-- Normally set by sourcelink, and needed by the Pack targets -->
- <RepositoryUrl Condition="'$(RepositoryUrl)' == '''">https://github.com/dotnet/core-setup</RepositoryUrl>
</PropertyGroup>
<!-- Set up Default symbol and optimization for Configuration -->
<UsingTask TaskName="GetTargetMachineInfo" AssemblyFile="$(InstallerTasksAssemblyPath)" />
<UsingTask TaskName="RegenerateReadmeTable" AssemblyFile="$(InstallerTasksAssemblyPath)" />
- <PropertyGroup>
- <!--
- Define this here (not just in Versions.props) because the SDK resets it
- unconditionally in Microsoft.NETCoreSdk.BundledVersions.props.
- -->
- <NETCoreAppMaximumVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppMaximumVersion>
- </PropertyGroup>
-
<!-- Common target to find all sfxproj. In a target to avoid evaluating for every project. -->
<Target Name="GetSharedFrameworkProjects">
<ItemGroup>
<Project>
- <!-- Base repo layout properties -->
- <PropertyGroup>
- <RepoRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), global.json))</RepoRoot>
- <RepoRoot>$([MSBuild]::EnsureTrailingSlash('$(RepoRoot)'))</RepoRoot>
- <RepositoryEngineeringDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'eng'))</RepositoryEngineeringDir>
- <LibrariesProjectRoot>$(MSBuildThisFileDirectory)</LibrariesProjectRoot>
- <RepositoryUrl>git://github.com/dotnet/corefx</RepositoryUrl>
- </PropertyGroup>
-
<PropertyGroup>
<SkipImportArcadeSdkFromRoot>true</SkipImportArcadeSdkFromRoot>
</PropertyGroup>
<Import Project="..\..\Directory.Build.props" />
<PropertyGroup>
- <!--
- For non-SDK projects that import this file and then import Microsoft.Common.props,
- tell Microsoft.Common.props not to import Directory.Build.props again
- -->
- <ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
-
<!-- We use the compiler toolset that comes from NuGet Packages rather than the SDK built-in.
This one sets UseSharedCompilation to false by default. -->
<UseSharedCompilation>true</UseSharedCompilation>
<BuildConfigurations Condition="'$(MSBuildProjectExtension)' == '.pkgproj' and '$(BuildConfigurations)' == ''">package</BuildConfigurations>
</PropertyGroup>
- <!-- Indicates this is not an officially supported release. Release branches should set this to false. -->
- <PropertyGroup>
- <IsPrerelease>true</IsPrerelease>
- </PropertyGroup>
-
<Import Sdk="Microsoft.DotNet.Build.Tasks.Configuration" Project="Sdk.props" />
<!-- Define test projects and companions -->
<!-- Common repo directories -->
<PropertyGroup>
- <ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin'))</ArtifactsBinDir>
-
<!-- Need to try and keep the same logic as the native builds as we need this for packaging -->
<NativeBinDir>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'native', '$(BuildConfiguration)'))</NativeBinDir>
<PropertyGroup>
<!-- By default make all libraries to be AnyCPU but individual projects can override it if they need to -->
<Platform>AnyCPU</Platform>
- <OutputType>Library</OutputType>
<!-- Default any assembly not specifying a key to use the Open Key -->
<StrongNameKeyId>Open</StrongNameKeyId>
+ </PropertyGroup>
+
+ <PropertyGroup>
<RunApiCompatForSrc>$(IsSourceProject)</RunApiCompatForSrc>
<RunMatchingRefApiCompat>$(IsSourceProject)</RunMatchingRefApiCompat>
<ApiCompatExcludeAttributeList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt</ApiCompatExcludeAttributeList>
- <!-- Build as portable by default -->
- <PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
- <!-- Used for launchSettings.json and runtime config files. -->
- <AppDesignerFolder>Properties</AppDesignerFolder>
</PropertyGroup>
<PropertyGroup>
<!-- Language configuration -->
<PropertyGroup>
- <!-- default to allowing all language features -->
- <LangVersion>latest</LangVersion>
- <LangVersion Condition="'$(Language)' == 'C#'">preview</LangVersion>
<Features>strict;nullablePublicOnly</Features>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <Deterministic>true</Deterministic>
-
<!-- We decided to keep this disabled by default to see some history of way have a look at https://github.com/dotnet/corefx/issues/3140 -->
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-
- <!-- Suppress preview message as we are usually using preview SDK versions. -->
- <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<GenFacadesIgnoreBuildAndRevisionMismatch>true</GenFacadesIgnoreBuildAndRevisionMismatch>
-
- <!-- Resource naming bug: https://github.com/microsoft/msbuild/issues/4740 -->
- <EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
+ <EnableAnalyzers Condition="'$(EnableProjectRestore)' == 'true' and '$(IsSourceProject)' == 'true' and '$(MSBuildProjectExtension)' != '.ilproj'">true</EnableAnalyzers>
</PropertyGroup>
<!-- Set up some common paths -->
<!-- Set the documentation output file globally. -->
<DocumentationFile Condition="'$(IsSourceProject)' == 'true' and '$(DocumentationFile)' == ''">$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
- <CodeAnalysisRuleset>$(LibrariesProjectRoot)CodeAnalysis.ruleset</CodeAnalysisRuleset>
- <EnablePinvokeUWPAnalyzer>false</EnablePinvokeUWPAnalyzer>
-
<!-- Clear the init locals flag on all src projects, except those in VB, where we can't use spans. -->
<ILLinkClearInitLocals Condition="'$(IsSourceProject)' == 'true' and '$(Language)' != 'VB'">true</ILLinkClearInitLocals>
</PropertyGroup>
- <PropertyGroup>
- <!-- Experimental packages should not be stable -->
- <SuppressFinalPackageVersion Condition="'$(SuppressFinalPackageVersion)' == '' and $(MSBuildProjectName.Contains('Experimental'))">true</SuppressFinalPackageVersion>
- <IsShippingAssembly Condition="$(MSBuildProjectName.Contains('Experimental'))">false</IsShippingAssembly>
-
- <!-- We don't want Private packages to be shipped to NuGet.org -->
- <IsShippingPackage Condition="$(MSBuildProjectName.Contains('Private')) and '$(MSBuildProjectExtension)' == '.pkgproj'">false</IsShippingPackage>
- </PropertyGroup>
-
<PropertyGroup Condition="'$(BuildAllConfigurations)' != 'true'">
<!-- We add extra binplacing for the test shared framework until we can get hardlinking with the runtime directory working on all platforms -->
<BinPlaceTestSharedFramework Condition="'$(_bc_TargetGroup)' == 'netcoreapp'">true</BinPlaceTestSharedFramework>
<CLSCompliant Condition="'$(CLSCompliant)' == '' and '$(IsTestProject)' == 'true'">false</CLSCompliant>
<CLSCompliant Condition="'$(CLSCompliant)' == ''">true</CLSCompliant>
</PropertyGroup>
-
- <Import Condition="'$(EnableProjectRestore)' == 'true' and '$(IsSourceProject)' == 'true' and '$(MSBuildProjectExtension)' != '.ilproj'" Project="$(RepositoryEngineeringDir)analyzers.props" />
</Project>
<ErrorReport Condition="'$(ErrorReport)' == 'prompt'" />
<WarningsAsErrors Condition="'$(WarningsAsErrors)' == 'NU1605'" />
</PropertyGroup>
-
- <!-- Adds Nullable annotation attributes to netstandard <= 2.0 builds -->
- <Choose>
- <When Condition="'$(Nullable)' != '' and ($(TargetFramework.StartsWith('netstandard1')) or '$(TargetFramework)' == 'netstandard2.0' or $(TargetFramework.StartsWith('netcoreapp2')) or '$(TargetsNetFx)' == 'true')">
- <PropertyGroup>
- <DefineConstants>$(DefineConstants),INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\NullableAttributes.cs" Link="System\Diagnostics\CodeAnalysis\NullableAttributes.cs" />
- </ItemGroup>
- </When>
- </Choose>
-
- <PropertyGroup>
- <!--
- For non-SDK projects that import this file and then import Microsoft.Common.targets,
- tell Microsoft.Common.targets not to import Directory.Build.targets again
- -->
- <ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
- <!-- This is a workaround to allow the SDK to accept the netcoreapp5.0 tfm until the SDK supports targeting this tfm. -->
- <NETCoreAppMaximumVersion>5.0</NETCoreAppMaximumVersion>
- </PropertyGroup>
<PropertyGroup>
<!-- Override strong name key to default to Open for test projects,
<Target Name="GetDocumentationFile"
Returns="$(DocumentationFile)"/>
+ <!-- Adds Nullable annotation attributes to netstandard <= 2.0 builds -->
+ <Choose>
+ <When Condition="'$(Nullable)' != '' and ($(TargetFramework.StartsWith('netstandard1')) or '$(TargetFramework)' == 'netstandard2.0' or $(TargetFramework.StartsWith('netcoreapp2')) or '$(TargetsNetFx)' == 'true')">
+ <PropertyGroup>
+ <DefineConstants>$(DefineConstants),INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\NullableAttributes.cs" Link="System\Diagnostics\CodeAnalysis\NullableAttributes.cs" />
+ </ItemGroup>
+ </When>
+ </Choose>
+
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<EnableBinPlacing>false</EnableBinPlacing>
+ <EnableAnalyzers>true</EnableAnalyzers>
<Language>C#</Language>
</PropertyGroup>
- <!-- Import PackageReferences containing analyzers -->
- <Import Project="$(RepositoryEngineeringDir)analyzers.props" />
-
<UsingTask TaskName="Microsoft.DotNet.Arcade.Sdk.SaveItems" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />
<Target Name="GenerateAnalyzersPropsFile"