Targeting pack and shared framework fixups (#7794)
* Fix package type to match spec ('DotnetPlatform')
* Fix missing metadata in MSI installer
* Fix incorrect target order which caused duplicate assemblies in netcore.app and aspnetcore.app
This commit is contained in:
parent
51e2bea403
commit
6252351da7
|
|
@ -18,11 +18,10 @@ This package is an internal implementation of the .NET Core SDK and is not meant
|
||||||
<PackageTags>aspnetcore;targeting-pack</PackageTags>
|
<PackageTags>aspnetcore;targeting-pack</PackageTags>
|
||||||
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
|
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
|
||||||
|
|
||||||
<!-- Subject to change: see https://github.com/dotnet/designs/pull/50 -->
|
<PackageType>DotnetPlatform</PackageType>
|
||||||
<PackageType>TargetingPack</PackageType>
|
|
||||||
<RefAssemblyPackagePath>ref/$(TargetFramework)/</RefAssemblyPackagePath>
|
<RefAssemblyPackagePath>ref/$(TargetFramework)/</RefAssemblyPackagePath>
|
||||||
|
|
||||||
<LayoutTargetDir>$(TargetingPackLayoutRoot)packs/Microsoft.AspNetCore.App.Ref/$(PackageVersion)/$(RefAssemblyPackagePath)</LayoutTargetDir>
|
<LayoutTargetDir>$(TargetingPackLayoutRoot)packs/Microsoft.AspNetCore.App.Ref/$(PackageVersion)/</LayoutTargetDir>
|
||||||
<ArchiveOutputFileName>aspnetcore-targeting-pack-$(PackageVersion).zip</ArchiveOutputFileName>
|
<ArchiveOutputFileName>aspnetcore-targeting-pack-$(PackageVersion).zip</ArchiveOutputFileName>
|
||||||
<ArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName)</ArchiveOutputPath>
|
<ArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName)</ArchiveOutputPath>
|
||||||
|
|
||||||
|
|
@ -56,7 +55,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
|
||||||
$(BuildDependsOn);
|
$(BuildDependsOn);
|
||||||
GeneratePackageConflictManifest;
|
GeneratePackageConflictManifest;
|
||||||
_ResolveTargetingPackContent;
|
_ResolveTargetingPackContent;
|
||||||
_BatchCopyToOutputDirectory;
|
|
||||||
_BatchCopyToLayoutTargetDir;
|
_BatchCopyToLayoutTargetDir;
|
||||||
_CreateTargetingPackArchive;
|
_CreateTargetingPackArchive;
|
||||||
</BuildDependsOn>
|
</BuildDependsOn>
|
||||||
|
|
@ -87,15 +85,11 @@ This package is an internal implementation of the .NET Core SDK and is not meant
|
||||||
|
|
||||||
<AspNetCoreReferenceDocXml Include="@(AspNetCoreReferenceAssemblyPath->'%(RootDir)%(Directory)%(FileName).xml')" />
|
<AspNetCoreReferenceDocXml Include="@(AspNetCoreReferenceAssemblyPath->'%(RootDir)%(Directory)%(FileName).xml')" />
|
||||||
|
|
||||||
<!-- Exclude known missing XML docs files. Time-boxing this workaround because we want XML docs for everything. This can be removed when we get a new build with https://github.com/dotnet/core-setup/pull/5109. -->
|
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
|
||||||
<AspNetCoreReferenceDocXml Remove="@(AspNetCoreReferenceDocXml)"
|
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
|
||||||
Condition="'$(MicrosoftNETCoreAppPackageVersion)' == '3.0.0-preview-27405-2' AND ('%(FileName)' == 'Microsoft.Extensions.DependencyModel' OR '%(FileName)' == 'Microsoft.DotNet.PlatformAbstractions' )" />
|
<RefPackContent Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(PackageConflictManifestPackagePath)" />
|
||||||
|
|
||||||
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" />
|
<_PackageFiles Include="@(RefPackContent)" />
|
||||||
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" />
|
|
||||||
|
|
||||||
<_PackageFiles Include="@(RefPackContent)" PackagePath="$(RefAssemblyPackagePath)" />
|
|
||||||
<_PackageFiles Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(PackageConflictManifestPackagePath)" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
@ -114,25 +108,14 @@ This package is an internal implementation of the .NET Core SDK and is not meant
|
||||||
Overwrite="true" />
|
Overwrite="true" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<!-- Written to take advantage of target batching in MSBuild. -->
|
|
||||||
<Target Name="_BatchCopyToOutputDirectory"
|
|
||||||
DependsOnTargets="_ResolveTargetingPackContent"
|
|
||||||
Inputs="@(RefPackContent)"
|
|
||||||
Outputs="@(RefPackContent->'$(TargetDir)%(FileName)%(Extension)')">
|
|
||||||
|
|
||||||
<Copy SourceFiles="@(RefPackContent)"
|
|
||||||
DestinationFiles="@(RefPackContent->'$(TargetDir)%(FileName)%(Extension)')"
|
|
||||||
UseHardlinksIfPossible="true" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<!-- Written to take advantage of target batching in MSBuild. -->
|
<!-- Written to take advantage of target batching in MSBuild. -->
|
||||||
<Target Name="_BatchCopyToLayoutTargetDir"
|
<Target Name="_BatchCopyToLayoutTargetDir"
|
||||||
DependsOnTargets="_ResolveTargetingPackContent"
|
DependsOnTargets="_ResolveTargetingPackContent"
|
||||||
Inputs="@(RefPackContent)"
|
Inputs="@(RefPackContent)"
|
||||||
Outputs="@(RefPackContent->'$(LayoutTargetDir)%(FileName)%(Extension)')">
|
Outputs="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')">
|
||||||
|
|
||||||
<Copy SourceFiles="@(RefPackContent)"
|
<Copy SourceFiles="@(RefPackContent)"
|
||||||
DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(FileName)%(Extension)')"
|
DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')"
|
||||||
UseHardlinksIfPossible="true" />
|
UseHardlinksIfPossible="true" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@
|
||||||
<SharedFxName>Microsoft.AspNetCore.App</SharedFxName>
|
<SharedFxName>Microsoft.AspNetCore.App</SharedFxName>
|
||||||
<PackageId>$(MSBuildProjectName).$(RuntimeIdentifier)</PackageId>
|
<PackageId>$(MSBuildProjectName).$(RuntimeIdentifier)</PackageId>
|
||||||
<IsShippingPackage>true</IsShippingPackage>
|
<IsShippingPackage>true</IsShippingPackage>
|
||||||
|
<!-- Undo for Preview4. Preview 3 is shipping using the runtime.$(rid) packages instead. -->
|
||||||
|
<IsPackable Condition="'$(PreReleaseLabel)'=='preview3'">false</IsPackable>
|
||||||
|
|
||||||
<PackageDescription>Provides a default set of APIs for building an ASP.NET Core application. Contains assets used for self-contained deployments.
|
<PackageDescription>Provides a default set of APIs for building an ASP.NET Core application. Contains assets used for self-contained deployments.
|
||||||
|
|
||||||
|
|
@ -23,8 +25,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
|
||||||
<PackageTags>aspnetcore;shared-framework</PackageTags>
|
<PackageTags>aspnetcore;shared-framework</PackageTags>
|
||||||
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
|
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
|
||||||
|
|
||||||
<!-- Subject to change: see https://github.com/dotnet/designs/pull/50 -->
|
<PackageType>DotnetPlatform</PackageType>
|
||||||
<PackageType>RuntimePack</PackageType>
|
|
||||||
<!-- NuGet appends target framework to this value. Example: runtimes/win-x64/lib/netcoreapp3.0/ -->
|
<!-- NuGet appends target framework to this value. Example: runtimes/win-x64/lib/netcoreapp3.0/ -->
|
||||||
<BuildOutputTargetFolder>runtimes/$(RuntimeIdentifier)/lib/</BuildOutputTargetFolder>
|
<BuildOutputTargetFolder>runtimes/$(RuntimeIdentifier)/lib/</BuildOutputTargetFolder>
|
||||||
<!-- Target framework is not append to this because native assets to not have a target framework. -->
|
<!-- Target framework is not append to this because native assets to not have a target framework. -->
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ This targets file should only be imported by .shfxproj files.
|
||||||
GenerateSharedFxVersionsFile;
|
GenerateSharedFxVersionsFile;
|
||||||
GenerateBuildDependencyFile;
|
GenerateBuildDependencyFile;
|
||||||
PrepareForPublish;
|
PrepareForPublish;
|
||||||
GeneratePublishDependencyFile;
|
|
||||||
GenerateSharedFxMetadataFiles;
|
|
||||||
GenerateBuildRuntimeConfigurationFiles;
|
GenerateBuildRuntimeConfigurationFiles;
|
||||||
ComputeAndCopyFilesToPublishDirectory;
|
ComputeAndCopyFilesToPublishDirectory;
|
||||||
|
GeneratePublishDependencyFile;
|
||||||
|
GenerateSharedFxMetadataFiles;
|
||||||
CopySharedFxToOutput;
|
CopySharedFxToOutput;
|
||||||
CollectSharedFxOutput;
|
CollectSharedFxOutput;
|
||||||
PostBuildEvent;
|
PostBuildEvent;
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,10 @@
|
||||||
<_Parameter1>ManifestOutputDir</_Parameter1>
|
<_Parameter1>ManifestOutputDir</_Parameter1>
|
||||||
<_Parameter2>%(_ResolvedFrameworkReference.ManifestOutputDir)</_Parameter2>
|
<_Parameter2>%(_ResolvedFrameworkReference.ManifestOutputDir)</_Parameter2>
|
||||||
</AssemblyAttribute>
|
</AssemblyAttribute>
|
||||||
|
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
|
||||||
|
<_Parameter1>RuntimeAssetsOutputPath</_Parameter1>
|
||||||
|
<_Parameter2>%(_ResolvedFrameworkReference.RuntimeAssetsOutputPath)</_Parameter2>
|
||||||
|
</AssemblyAttribute>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,33 @@ namespace Microsoft.AspNetCore
|
||||||
_expectedRid = TestData.GetSharedFxRuntimeIdentifier();
|
_expectedRid = TestData.GetSharedFxRuntimeIdentifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void SharedFrameworkContainsExpectedFiles()
|
||||||
|
{
|
||||||
|
var actualAssemblies = Directory.GetFiles(TestData.GetTestDataValue("RuntimeAssetsOutputPath"), "*.dll")
|
||||||
|
.Select(Path.GetFileNameWithoutExtension)
|
||||||
|
.ToHashSet();
|
||||||
|
var expectedAssemblies = TestData.GetSharedFxDependencies()
|
||||||
|
.Split(';', StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
.ToHashSet();
|
||||||
|
|
||||||
|
_output.WriteLine("==== actual assemblies ====");
|
||||||
|
_output.WriteLine(string.Join('\n', actualAssemblies));
|
||||||
|
_output.WriteLine("==== expected assemblies ====");
|
||||||
|
_output.WriteLine(string.Join('\n', expectedAssemblies));
|
||||||
|
|
||||||
|
var missing = expectedAssemblies.Except(actualAssemblies);
|
||||||
|
var unexpected = actualAssemblies.Except(expectedAssemblies);
|
||||||
|
|
||||||
|
_output.WriteLine("==== missing assemblies from the framework ====");
|
||||||
|
_output.WriteLine(string.Join('\n', missing));
|
||||||
|
_output.WriteLine("==== unexpected assemblies in the framework ====");
|
||||||
|
_output.WriteLine(string.Join('\n', unexpected));
|
||||||
|
|
||||||
|
Assert.Empty(missing);
|
||||||
|
Assert.Empty(unexpected);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void PlatformManifestListsAllFiles()
|
public void PlatformManifestListsAllFiles()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue