Skip to content

Add packaging information to windowsdesktop transport package #115477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions eng/packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
<!-- During NoBuild pack invocations, skip project reference build. Necessary for the IncludeProjectReferencesWithPackAttributeInPackage target. -->
<BuildProjectReferences Condition="'$(NoBuild)' == 'true'">false</BuildProjectReferences>
</PropertyGroup>

<!-- Flow these properties to consuming projects. Used by i.e. Microsoft.Internal.Runtime.WindowsDesktop.Transport. -->
<ItemDefinitionGroup>
<TargetPathWithTargetPlatformMoniker>
<IsPackable>true</IsPackable>
<PackageId>$(PackageId)</PackageId>
<PackageVersion>$(PackageVersion)</PackageVersion>
</TargetPathWithTargetPlatformMoniker>
</ItemDefinitionGroup>

<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing'">
<!-- In servicing, the live package is compared against the GA version in strict mode. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.Build.NoTargets">

<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)-windows</TargetFramework>
<IsShipping>false</IsShipping>
Expand All @@ -10,6 +11,11 @@
<PackageDescription>Internal transport package to provide windowsdesktop with the assemblies from dotnet/runtime that make up the Microsoft.WindowsDesktop.App shared framework.</PackageDescription>
<!-- Reference elements are missing from the nuspec: https://github.com/NuGet/Home/issues/8684. -->
<NoWarn>$(NoWarn);NU5131;NU5128</NoWarn>

<!-- Generate the transport props file -->
<BeforePack>$(BeforePack);GenerateTransportPropsFile</BeforePack>
<TransportPropsFileInputPath>$(MSBuildThisFileDirectory)build\$(MSBuildProjectName).props</TransportPropsFileInputPath>
<TransportPropsFileOutputPath>$(IntermediateOutputPath)$(MSBuildProjectName).props</TransportPropsFileOutputPath>
</PropertyGroup>

<ItemGroup>
Expand All @@ -21,5 +27,35 @@
Pack="true"
Private="true"
IncludeReferenceAssemblyInPackage="true" />

<PackageReference Include="Microsoft.DotNet.Build.Tasks.Templating" Version="$(MicrosoftDotNetBuildTasksTemplatingVersion)" />
</ItemGroup>

<Target Name="GenerateTransportPropsFile"
DependsOnTargets="BuildOnlySettings;ResolveReferences"
Inputs="$(MSBuildThisFileFullPath);$(TransportPropsFileInputPath)"
Outputs="$(TransportPropsFileOutputPath)">
<ItemGroup>
<RuntimeWindowsDesktopPackageLibrary Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')->WithMetadataValue('Extension', '.dll')->WithMetadataValue('Pack', 'true')->WithMetadataValue('IsPackable', 'true'))" />
</ItemGroup>

<PropertyGroup>
<RuntimeWindowsDesktopPackageLibraries>@(RuntimeWindowsDesktopPackageLibrary->'&lt;RuntimeWindowsDesktopPackageLibrary Include=&quot;%(Filename)%(Extension)&quot; PackageId=&quot;%(PackageId)&quot; PackageVersion=&quot;%(PackageVersion)&quot; /&gt;', '
')</RuntimeWindowsDesktopPackageLibraries>
</PropertyGroup>

<ItemGroup>
<TransportPropsTemplateProperty Include="RuntimeWindowsDesktopPackageLibraries=$(RuntimeWindowsDesktopPackageLibraries)" />
</ItemGroup>

<GenerateFileFromTemplate
TemplateFile="$(TransportPropsFileInputPath)"
Properties="@(TransportPropsTemplateProperty)"
OutputPath="$(TransportPropsFileOutputPath)" />

<ItemGroup>
<None Include="$(TransportPropsFileOutputPath)" Pack="true" PackagePath="build/" />
</ItemGroup>
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>

<!-- The list of redistributed assemblies that also ship via out-of-band packages.
Includes the AssemblyName, PackageId and the PackageVersion:
<RuntimeWindowsDesktopPackageLibrary Include="" PackageId="" PackageVersion="" /> -->
<ItemGroup>
${RuntimeWindowsDesktopPackageLibraries}
</ItemGroup>

</Project>
Loading