|
|
@@ -0,0 +1,296 @@
|
|
|
+<Project>
|
|
|
+ <PropertyGroup>
|
|
|
+ <OutputInRepoRoot>true</OutputInRepoRoot>
|
|
|
+ </PropertyGroup>
|
|
|
+
|
|
|
+ <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
|
|
+
|
|
|
+ <PropertyGroup>
|
|
|
+ <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
|
|
+ <RuntimeIdentifier>$(TargetRuntimeIdentifier)</RuntimeIdentifier>
|
|
|
+ <!-- Even though RuntimeIdentifier is set, shared framework projects are not self-contained projects -->
|
|
|
+ <SelfContained>false</SelfContained>
|
|
|
+ <SharedFxName>Microsoft.AspNetCore.App</SharedFxName>
|
|
|
+ <PackageId>$(MSBuildProjectName).$(RuntimeIdentifier)</PackageId>
|
|
|
+ <IsShippingPackage>true</IsShippingPackage>
|
|
|
+
|
|
|
+ <PackageDescription>Provides a default set of APIs for building an ASP.NET Core application. Contains assets used for self-contained deployments.
|
|
|
+
|
|
|
+This package is an internal implementation of the .NET Core SDK and is not meant to be used as a normal PackageReference.
|
|
|
+ </PackageDescription>
|
|
|
+ <PackageTags>aspnetcore;shared-framework</PackageTags>
|
|
|
+ <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
|
|
|
+
|
|
|
+ <!-- Subject to change: see https://github.com/dotnet/designs/pull/50 -->
|
|
|
+ <PackageType>RuntimePack</PackageType>
|
|
|
+ <!-- NuGet appends target framework to this value. Example: runtimes/win-x64/lib/netcoreapp3.0/ -->
|
|
|
+ <BuildOutputTargetFolder>runtimes/$(RuntimeIdentifier)/lib/</BuildOutputTargetFolder>
|
|
|
+ <!-- Target framework is not append to this because native assets to not have a target framework. -->
|
|
|
+ <NativeAssetsPackagePath>runtimes/$(RuntimeIdentifier)/native/</NativeAssetsPackagePath>
|
|
|
+
|
|
|
+ <!-- Setting this suppresses getting documentation .xml files in the shared runtime output. -->
|
|
|
+ <AllowedReferenceRelatedFileExtensions>.pdb</AllowedReferenceRelatedFileExtensions>
|
|
|
+
|
|
|
+ <!-- Pack .map files in symbols package (native symbols for Linux) -->
|
|
|
+ <AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>$(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder);.map</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
|
|
|
+
|
|
|
+ <!-- Optimize the framework using the crossgen tool -->
|
|
|
+ <CrossgenOutput Condition="'$(Configuration)' != 'Debug'">true</CrossgenOutput>
|
|
|
+
|
|
|
+ <!-- Produce crossgen profiling symbols (.ni.pdb or .map files). -->
|
|
|
+ <GenerateCrossgenProfilingSymbols>true</GenerateCrossgenProfilingSymbols>
|
|
|
+ <GenerateCrossgenProfilingSymbols Condition=" '$(CrossgenOutput)' == 'false' OR '$(TargetOsName)' == 'osx'">false</GenerateCrossgenProfilingSymbols>
|
|
|
+
|
|
|
+ <!-- Always generated, even though output type == Library -->
|
|
|
+ <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
|
|
+ <ProjectRuntimeConfigFileName>$(SharedFxName).runtimeconfig.json</ProjectRuntimeConfigFileName>
|
|
|
+
|
|
|
+ <!-- Suppress .deps generation (we have to customize its layout. -->
|
|
|
+ <GenerateDependencyFile>false</GenerateDependencyFile>
|
|
|
+ <ProjectDepsFileName>$(SharedFxName).deps.json</ProjectDepsFileName>
|
|
|
+
|
|
|
+ <!-- There is no way to suppress the .dev.runtimeconfig.json generation. -->
|
|
|
+ <ProjectRuntimeConfigDevFilePath>$(IntermediateOutputPath)ignoreme.dev.runtimeconfig.json</ProjectRuntimeConfigDevFilePath>
|
|
|
+
|
|
|
+ <!-- The project representing the shared framework doesn't produce a .NET assembly or symbols. -->
|
|
|
+ <DebugType>none</DebugType>
|
|
|
+ <CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
|
|
|
+ <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
|
|
|
+ <CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
|
|
|
+
|
|
|
+ <!-- Copy assets to output path from NuGet packages. -->
|
|
|
+ <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
|
|
+
|
|
|
+ <!-- Workaround for the way Microsoft.AspNetCore.Server.IIS.csproj references ANCM native deps. Do not copy content from ProjectReference's CopyToOutput items. -->
|
|
|
+ <_GetChildProjectCopyToOutputDirectoryItems>false</_GetChildProjectCopyToOutputDirectoryItems>
|
|
|
+
|
|
|
+ <!-- This project should not be referenced via the `<Reference>` impementation. -->
|
|
|
+ <IsProjectReferenceProvider>false</IsProjectReferenceProvider>
|
|
|
+
|
|
|
+ <!-- Properties related to crossgen -->
|
|
|
+ <CrossGenSymbolsType>PerfMap</CrossGenSymbolsType>
|
|
|
+ <CrossGenSymbolsType Condition="'$(TargetOsName)' == 'win'">PDB</CrossGenSymbolsType>
|
|
|
+
|
|
|
+ <LibPrefix Condition=" '$(TargetOsName)' != 'win' ">lib</LibPrefix>
|
|
|
+ <LibExtension>.so</LibExtension>
|
|
|
+ <LibExtension Condition=" '$(TargetOsName)' == 'win' ">.dll</LibExtension>
|
|
|
+ <LibExtension Condition=" '$(TargetOsName)' == 'osx' ">.dylib</LibExtension>
|
|
|
+ <ExeExtension Condition=" '$(TargetOsName)' == 'win' ">.exe</ExeExtension>
|
|
|
+ <!-- 3B = semicolon in ASCII -->
|
|
|
+ <PathSeparator Condition="'$(PathSeparator)' == ''">:</PathSeparator>
|
|
|
+ <PathSeparator Condition=" '$(TargetOsName)' == 'win' ">%3B</PathSeparator>
|
|
|
+
|
|
|
+ <!-- Crossgen executable name -->
|
|
|
+ <CrossgenToolFileName>crossgen</CrossgenToolFileName>
|
|
|
+ <CrossgenToolFileName Condition=" '$(TargetOsName)' == 'win' ">$(CrossgenToolFileName).exe</CrossgenToolFileName>
|
|
|
+ <!-- Default crossgen executable relative path -->
|
|
|
+ <CrossgenToolPackagePath>$(CrossgenToolFileName)</CrossgenToolPackagePath>
|
|
|
+ <!-- Disambiguated RID-specific crossgen executable relative path -->
|
|
|
+ <CrossgenToolPackagePath Condition=" '$(TargetRuntimeIdentifier)' == 'linux-arm' ">x64_arm\$(CrossgenToolPackagePath)</CrossgenToolPackagePath>
|
|
|
+ <CrossgenToolPackagePath Condition=" '$(TargetRuntimeIdentifier)' == 'linux-arm64' ">x64_arm64\$(CrossgenToolPackagePath)</CrossgenToolPackagePath>
|
|
|
+ <CrossgenToolPackagePath Condition=" '$(TargetRuntimeIdentifier)' == 'win-arm' ">x86_arm\$(CrossgenToolPackagePath)</CrossgenToolPackagePath>
|
|
|
+
|
|
|
+ <RuntimePackageRoot>$(NuGetPackageRoot)/runtime.$(RuntimeIdentifier).microsoft.netcore.app/$(MicrosoftNETCoreAppPackageVersion)/</RuntimePackageRoot>
|
|
|
+ <CrossgenToolPath>$(RuntimePackageRoot)tools/$(CrossgenToolPackagePath)</CrossgenToolPath>
|
|
|
+ </PropertyGroup>
|
|
|
+
|
|
|
+ <ItemGroup>
|
|
|
+ <!-- Note: do not add _TransitiveExternalAspNetCoreAppReference to this list. This is intentionally not listed as a direct package reference. -->
|
|
|
+ <Reference Include="@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference)">
|
|
|
+ <IncludeAssets>Runtime;Native</IncludeAssets>
|
|
|
+ </Reference>
|
|
|
+
|
|
|
+ <ProjectReference Condition="'$(BuildIisNativeProjects)' == 'true' AND '$(BuildNative)' != 'false'" Include="$(RepositoryRoot)src\Servers\IIS\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj">
|
|
|
+ <SetPlatform>Platform=$(TargetArchitecture)</SetPlatform>
|
|
|
+ <SetPlatform Condition="'$(TargetArchitecture)' == 'x86'">Platform=Win32</SetPlatform>
|
|
|
+ <!-- Suppress NuGet compatibility checks. We compensate for flowing .dll/.pdb files with the _ResolveCopyLocalNativeReference target. -->
|
|
|
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
|
|
+ <!-- Optimization. Native projects don't have a .NET TargetFramework -->
|
|
|
+ <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
|
|
|
+ <UndefineProperties>TargetFramework</UndefineProperties>
|
|
|
+ <OutputItemType>_ResolvedNativeProjectReferencePaths</OutputItemType>
|
|
|
+ </ProjectReference>
|
|
|
+ </ItemGroup>
|
|
|
+
|
|
|
+ <ItemGroup>
|
|
|
+ <GenerateRuntimeConfigurationFilesInputs Include="$(MSBuildAllProjects)" />
|
|
|
+ </ItemGroup>
|
|
|
+
|
|
|
+ <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
|
|
|
+
|
|
|
+ <!-- Target chain -->
|
|
|
+ <PropertyGroup>
|
|
|
+ <ResolveReferencesDependsOn>
|
|
|
+ $(ResolveReferencesDependsOn);
|
|
|
+ FilterUnwantedContent;
|
|
|
+ _ResolveCopyLocalNativeReference;
|
|
|
+ PrepareForCrossGen;
|
|
|
+ </ResolveReferencesDependsOn>
|
|
|
+ <CoreBuildDependsOn>
|
|
|
+ $(CoreBuildDependsOn);
|
|
|
+ GenerateSharedFxDepsFile;
|
|
|
+ Crossgen;
|
|
|
+ </CoreBuildDependsOn>
|
|
|
+ <CrossGenDependsOn>
|
|
|
+ ResolveReferences;
|
|
|
+ </CrossGenDependsOn>
|
|
|
+ <CrossGenDependsOn Condition=" '$(CrossgenOutput)' == 'true' ">
|
|
|
+ $(CrossGenDependsOn);
|
|
|
+ _BatchCrossGenAssemblies;
|
|
|
+ </CrossGenDependsOn>
|
|
|
+ <TargetsForTfmSpecificBuildOutput>
|
|
|
+ $(TargetsForTfmSpecificBuildOutput);
|
|
|
+ _ResolveRuntimePackBuildOutput
|
|
|
+ </TargetsForTfmSpecificBuildOutput>
|
|
|
+ </PropertyGroup>
|
|
|
+
|
|
|
+ <!-- Override the default MSBuild targets so that nothing is returned from the project since it represents a collection of assemblies. -->
|
|
|
+ <Target Name="GetTargetPath" />
|
|
|
+ <Target Name="Build" DependsOnTargets="$(BuildDependsOn)">
|
|
|
+ <Message Importance="High" Text="$(MSBuildProjectName) -> $(TargetDir)" />
|
|
|
+ </Target>
|
|
|
+
|
|
|
+ <!-- There is no Microsoft.AspNetCore.App.Runtime.dll file. This clears the default vaule for the build output group. -->
|
|
|
+ <ItemGroup>
|
|
|
+ <BuiltProjectOutputGroupKeyOutput Remove="@(BuiltProjectOutputGroupKeyOutput)" />
|
|
|
+ </ItemGroup>
|
|
|
+
|
|
|
+ <!-- Override target from internal.aspnetcore.sdk which asserts DebugType == portable if IncludeSymbols = true, which is not right for this project. -->
|
|
|
+ <Target Name="_EnsureDebugTypeIsPortable" />
|
|
|
+
|
|
|
+ <!-- This project doesn't compile anything. -->
|
|
|
+ <Target Name="CoreCompile" />
|
|
|
+
|
|
|
+ <Target Name="FilterUnwantedContent">
|
|
|
+ <ItemGroup>
|
|
|
+ <!-- These files end up in this item group as a result of setting CopyLocalLockFileAssemblies, but shouldn't be. -->
|
|
|
+ <ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(FileName)' == 'apphost' OR '%(FileName)' == '$(LibPrefix)hostfxr' OR '%(FileName)' == '$(LibPrefix)hostpolicy' "/>
|
|
|
+ </ItemGroup>
|
|
|
+ </Target>
|
|
|
+
|
|
|
+ <Target Name="_WarnAboutUnbuiltNativeDependencies"
|
|
|
+ BeforeTargets="Build"
|
|
|
+ Condition=" '$(BuildIisNativeProjects)' == 'true' AND '$(BuildNative)' == 'false' ">
|
|
|
+ <Warning Text="This project has native dependencies which were not built. Without this, tests may not function correctly. Run `build.cmd -BuildNative -BuildManaged` to build both C# and C++." />
|
|
|
+ </Target>
|
|
|
+
|
|
|
+ <Target Name="_ResolveCopyLocalNativeReference">
|
|
|
+ <ItemGroup>
|
|
|
+ <ReferenceCopyLocalPaths Include="@(_ResolvedNativeProjectReferencePaths)" IsNativeImage="true" />
|
|
|
+ <ReferenceCopyLocalPaths Include="@(_ResolvedNativeProjectReferencePaths->'%(RootDir)%(Directory)%(FileName).pdb')" IsNativeImage="true" />
|
|
|
+ </ItemGroup>
|
|
|
+ </Target>
|
|
|
+
|
|
|
+ <Target Name="GenerateSharedFxDepsFile"
|
|
|
+ DependsOnTargets="ResolveReferences;CrossGen"
|
|
|
+ Inputs="@(ReferenceCopyLocalPaths);$(_RepoTaskAssembly);$(ProjectAssetsFile);$(MSBuildAllProjects)"
|
|
|
+ Outputs="$(ProjectDepsFilePath)">
|
|
|
+
|
|
|
+ <ItemGroup>
|
|
|
+ <_RuntimeReference Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Extension)' != '.pdb' AND '%(ReferenceCopyLocalPaths.Extension)' != '.map'" />
|
|
|
+ </ItemGroup>
|
|
|
+
|
|
|
+ <RepoTasks.GenerateSharedFrameworkDepsFile
|
|
|
+ DepsFilePath="$(ProjectDepsFilePath)"
|
|
|
+ TargetFramework="$(TargetFrameworkMoniker)"
|
|
|
+ FrameworkName="$(SharedFxName)"
|
|
|
+ FrameworkVersion="$(SharedFxVersion)"
|
|
|
+ References="@(_RuntimeReference)"
|
|
|
+ RuntimeIdentifier="$(RuntimeIdentifier)"
|
|
|
+ RuntimePackageName="$(PackageId)" />
|
|
|
+ </Target>
|
|
|
+
|
|
|
+ <!-- This target resolves files into the BuiltProjectOutputGroupOutput which NuGet uses to generate the package files. -->
|
|
|
+ <Target Name="_ResolveRuntimePackBuildOutput"
|
|
|
+ DependsOnTargets="ResolveReferences;Crossgen">
|
|
|
+ <ItemGroup>
|
|
|
+ <BuiltProjectOutputGroupOutput Include="$(ProjectDepsFilePath)" />
|
|
|
+ <BuiltProjectOutputGroupOutput Include="@(ReferenceCopyLocalPaths)" Condition=" '%(ReferenceCopyLocalPaths.IsNativeImage)' != 'true' " />
|
|
|
+ <!-- Include all .pdbs in build output. Some .pdb files are part of ReferenceCopyLocalPaths, but this can change when running /t:Pack /p:NoBuild=true. -->
|
|
|
+ <BuiltProjectOutputGroupOutput Include="$(TargetDir)*.pdb" Exclude="@(ReferenceCopyLocalPaths)" />
|
|
|
+ <!-- Crossgen symbols for Linux include a GUID in the file name which cannot be predicted. -->
|
|
|
+ <BuiltProjectOutputGroupOutput Include="$(TargetDir)*.map" Condition="'$(CrossGenSymbolsType)' == 'PerfMap'" />
|
|
|
+
|
|
|
+ <NuGetPackInput Include="@(BuiltProjectOutputGroupOutput)" />
|
|
|
+ </ItemGroup>
|
|
|
+ </Target>
|
|
|
+
|
|
|
+ <Target Name="_ResolveNativePackContent"
|
|
|
+ BeforeTargets="_GetPackageFiles;GenerateNuspec"
|
|
|
+ DependsOnTargets="ResolveReferences">
|
|
|
+ <ItemGroup>
|
|
|
+ <!-- Native files are included in _PackageFile instead because they belong in a separate package folder.r -->
|
|
|
+ <Content Include="@(ReferenceCopyLocalPaths)" PackagePath="$(NativeAssetsPackagePath)" Condition=" '%(ReferenceCopyLocalPaths.IsNativeImage)' == 'true' AND '%(ReferenceCopyLocalPaths.Extension)' != '.pdb' " />
|
|
|
+ </ItemGroup>
|
|
|
+ </Target>
|
|
|
+
|
|
|
+ <!--
|
|
|
+ ##############################################
|
|
|
+ Targets related to crossgen
|
|
|
+ ##############################################
|
|
|
+ -->
|
|
|
+ <PropertyGroup>
|
|
|
+ <CrossgenToolDir>$(IntermediateOutputPath)crossgen\</CrossgenToolDir>
|
|
|
+ <CoreCLRJitPath>$(CrossgenToolDir)$(LibPrefix)clrjit$(LibExtension)</CoreCLRJitPath>
|
|
|
+ </PropertyGroup>
|
|
|
+
|
|
|
+ <ItemGroup>
|
|
|
+ <CreateDirectory Include="$(CrossgenToolDir)" />
|
|
|
+ </ItemGroup>
|
|
|
+
|
|
|
+ <Target Name="Crossgen" DependsOnTargets="$(CrossgenDependsOn)" />
|
|
|
+
|
|
|
+ <Target Name="PrepareForCrossGen" Condition="'$(CrossgenOutput)' == 'true'">
|
|
|
+ <!-- Resolve list of assemblies to crossgen -->
|
|
|
+ <ItemGroup>
|
|
|
+ <IntermediateCrossgenAssembly Include="@(ReferenceCopyLocalPaths)" Condition=" '%(ReferenceCopyLocalPaths.IsNativeImage)' != 'true' AND '%(ReferenceCopyLocalPaths.Extension)' != '.pdb'" />
|
|
|
+
|
|
|
+ <!-- These are the paths used by crossgen to find assemblies that are expected to exist at runtime in the shared frameworks. -->
|
|
|
+ <_PlatformAssemblyPaths Include="$(CrossgenToolDir)" />
|
|
|
+ <_PlatformAssemblyPaths Include="@(ReferenceCopyLocalPaths->'%(RootDir)%(Directory)')" />
|
|
|
+
|
|
|
+ <ReferenceCopyLocalPaths Remove="@(IntermediateCrossgenAssembly)" />
|
|
|
+ <ReferenceCopyLocalPaths Include="@(IntermediateCrossgenAssembly->'$(TargetDir)%(FileName)%(Extension)')" />
|
|
|
+ </ItemGroup>
|
|
|
+
|
|
|
+ <PropertyGroup>
|
|
|
+ <CrossgenSymbolsTargetDir>$(TargetDir)</CrossgenSymbolsTargetDir>
|
|
|
+ <CrossgenPlatformAssemblyPaths>@(_PlatformAssemblyPaths->Distinct(), '$(PathSeparator)')</CrossgenPlatformAssemblyPaths>
|
|
|
+ <!-- Escaping required due to the way batch processes backslashes. -->
|
|
|
+ <CrossgenSymbolsTargetDir Condition="HasTrailingSlash($(CrossgenSymbolsTargetDir)) AND '$(OS)' == 'Windows_NT'">$(TargetDir)\</CrossgenSymbolsTargetDir>
|
|
|
+ <CrossgenPlatformAssemblyPaths Condition="HasTrailingSlash($(CrossgenPlatformAssemblyPaths)) AND '$(OS)' == 'Windows_NT'">$(CrossgenPlatformAssemblyPaths)\</CrossgenPlatformAssemblyPaths>
|
|
|
+ </PropertyGroup>
|
|
|
+
|
|
|
+ <WriteLinesToFile
|
|
|
+ Lines="-platform_assemblies_paths "$(CrossgenPlatformAssemblyPaths)""
|
|
|
+ File="$(CrossgenToolDir)PlatformAssembliesPaths.rsp"
|
|
|
+ Overwrite="true" />
|
|
|
+
|
|
|
+ <ItemGroup>
|
|
|
+ <RuntimePackageFiles Include="$(RuntimePackageRoot)runtimes\**\*" />
|
|
|
+ </ItemGroup>
|
|
|
+
|
|
|
+ <Error Text="Could not find crossgen $(CrossgenToolPath)" Condition=" ! Exists($(CrossgenToolPath))" />
|
|
|
+
|
|
|
+ <!-- Create tool directory with crossgen executable and runtime assemblies -->
|
|
|
+ <Copy SourceFiles="@(RuntimePackageFiles);$(CrossgenToolPath)" DestinationFolder="$(CrossGenToolDir)"/>
|
|
|
+ <Exec Command="chmod +x "$(CrossGenToolDir)$(CrossgenToolFileName)"" Condition="'$(OS)' != 'Windows_NT'" />
|
|
|
+ </Target>
|
|
|
+
|
|
|
+ <Target Name="_BatchCrossGenAssemblies"
|
|
|
+ Inputs="@(IntermediateCrossgenAssembly)"
|
|
|
+ Outputs="@(IntermediateCrossgenAssembly->'$(TargetDir)%(FileName)%(Extension)')">
|
|
|
+
|
|
|
+ <Exec Command=""$(CrossgenToolDir)$(CrossgenToolFileName)" -nologo -readytorun -in "%(IntermediateCrossgenAssembly.Identity)" -out "$(TargetDir)%(FileName)%(Extension)" -jitpath "$(CoreCLRJitPath)" "@$(CrossgenToolDir)PlatformAssembliesPaths.rsp""
|
|
|
+ EnvironmentVariables="COMPlus_PartialNGen=0"
|
|
|
+ IgnoreStandardErrorWarningFormat="true"
|
|
|
+ StandardOutputImportance="High" />
|
|
|
+
|
|
|
+ <Exec Condition=" '$(GenerateCrossgenProfilingSymbols)' == 'true' "
|
|
|
+ Command=""$(CrossgenToolDir)$(CrossgenToolFileName)" -nologo -readytorun -in "$(TargetDir)%(IntermediateCrossgenAssembly.FileName)%(Extension)" -Create$(CrossGenSymbolsType) "$(CrossgenSymbolsTargetDir)" "@$(CrossgenToolDir)PlatformAssembliesPaths.rsp""
|
|
|
+ EnvironmentVariables="COMPlus_PartialNGen=0"
|
|
|
+ IgnoreStandardErrorWarningFormat="true"
|
|
|
+ StandardOutputImportance="High" />
|
|
|
+ </Target>
|
|
|
+
|
|
|
+</Project>
|