Skip to content

Commit c53ccee

Browse files
ViktorHoferCopilot
andauthored
Add packaging information to windowsdesktop transport package (#115477)
* Add packaging information to windowsdesktop transport package Contributes to dotnet/windowsdesktop#4998 Adds a props file that gets auto-imported when referencing the internal windowsdesktop transport package. This file defines an item `PackageLibrary` that includes all the information for the runtime assemblies that get redistributed inside the package. This information can then be used in windowsdesktop to auto-generate parts of the PackageOverrides.txt file. * Update src/libraries/Microsoft.Internal.Runtime.WindowsDesktop.Transport/src/build/Microsoft.Internal.Runtime.WindowsDesktop.Transport.props Co-authored-by: Copilot <[email protected]> * Make item name more specific * Update Microsoft.Internal.Runtime.WindowsDesktop.Transport.proj * Update Microsoft.Internal.Runtime.WindowsDesktop.Transport.proj * Update Microsoft.Internal.Runtime.WindowsDesktop.Transport.props --------- Co-authored-by: Copilot <[email protected]>
1 parent f303e13 commit c53ccee

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

eng/packaging.targets

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@
3535
<!-- During NoBuild pack invocations, skip project reference build. Necessary for the IncludeProjectReferencesWithPackAttributeInPackage target. -->
3636
<BuildProjectReferences Condition="'$(NoBuild)' == 'true'">false</BuildProjectReferences>
3737
</PropertyGroup>
38+
39+
<!-- Flow these properties to consuming projects. Used by i.e. Microsoft.Internal.Runtime.WindowsDesktop.Transport. -->
40+
<ItemDefinitionGroup>
41+
<TargetPathWithTargetPlatformMoniker>
42+
<IsPackable>true</IsPackable>
43+
<PackageId>$(PackageId)</PackageId>
44+
<PackageVersion>$(PackageVersion)</PackageVersion>
45+
</TargetPathWithTargetPlatformMoniker>
46+
</ItemDefinitionGroup>
3847

3948
<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing'">
4049
<!-- In servicing, the live package is compared against the GA version in strict mode. -->

src/libraries/Microsoft.Internal.Runtime.WindowsDesktop.Transport/src/Microsoft.Internal.Runtime.WindowsDesktop.Transport.proj

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project Sdk="Microsoft.Build.NoTargets">
2+
23
<PropertyGroup>
34
<TargetFramework>$(NetCoreAppCurrent)-windows</TargetFramework>
45
<IsShipping>false</IsShipping>
@@ -10,6 +11,11 @@
1011
<PackageDescription>Internal transport package to provide windowsdesktop with the assemblies from dotnet/runtime that make up the Microsoft.WindowsDesktop.App shared framework.</PackageDescription>
1112
<!-- Reference elements are missing from the nuspec: https://github.com/NuGet/Home/issues/8684. -->
1213
<NoWarn>$(NoWarn);NU5131;NU5128</NoWarn>
14+
15+
<!-- Generate the transport props file -->
16+
<BeforePack>$(BeforePack);GenerateTransportPropsFile</BeforePack>
17+
<TransportPropsFileInputPath>$(MSBuildThisFileDirectory)build\$(MSBuildProjectName).props</TransportPropsFileInputPath>
18+
<TransportPropsFileOutputPath>$(IntermediateOutputPath)$(MSBuildProjectName).props</TransportPropsFileOutputPath>
1319
</PropertyGroup>
1420

1521
<ItemGroup>
@@ -21,5 +27,35 @@
2127
Pack="true"
2228
Private="true"
2329
IncludeReferenceAssemblyInPackage="true" />
30+
31+
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Templating" Version="$(MicrosoftDotNetBuildTasksTemplatingVersion)" />
2432
</ItemGroup>
33+
34+
<Target Name="GenerateTransportPropsFile"
35+
DependsOnTargets="BuildOnlySettings;ResolveReferences"
36+
Inputs="$(MSBuildThisFileFullPath);$(TransportPropsFileInputPath)"
37+
Outputs="$(TransportPropsFileOutputPath)">
38+
<ItemGroup>
39+
<RuntimeWindowsDesktopPackageLibrary Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')->WithMetadataValue('Extension', '.dll')->WithMetadataValue('Pack', 'true')->WithMetadataValue('IsPackable', 'true'))" />
40+
</ItemGroup>
41+
42+
<PropertyGroup>
43+
<RuntimeWindowsDesktopPackageLibraries>@(RuntimeWindowsDesktopPackageLibrary->'&lt;RuntimeWindowsDesktopPackageLibrary Include=&quot;%(Filename)%(Extension)&quot; PackageId=&quot;%(PackageId)&quot; PackageVersion=&quot;%(PackageVersion)&quot; /&gt;', '
44+
')</RuntimeWindowsDesktopPackageLibraries>
45+
</PropertyGroup>
46+
47+
<ItemGroup>
48+
<TransportPropsTemplateProperty Include="RuntimeWindowsDesktopPackageLibraries=$(RuntimeWindowsDesktopPackageLibraries)" />
49+
</ItemGroup>
50+
51+
<GenerateFileFromTemplate
52+
TemplateFile="$(TransportPropsFileInputPath)"
53+
Properties="@(TransportPropsTemplateProperty)"
54+
OutputPath="$(TransportPropsFileOutputPath)" />
55+
56+
<ItemGroup>
57+
<None Include="$(TransportPropsFileOutputPath)" Pack="true" PackagePath="build/" />
58+
</ItemGroup>
59+
</Target>
60+
2561
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project>
2+
3+
<!-- The list of redistributed assemblies that also ship via out-of-band packages.
4+
Includes the AssemblyName, PackageId and the PackageVersion:
5+
<RuntimeWindowsDesktopPackageLibrary Include="" PackageId="" PackageVersion="" /> -->
6+
<ItemGroup>
7+
${RuntimeWindowsDesktopPackageLibraries}
8+
</ItemGroup>
9+
10+
</Project>

0 commit comments

Comments
 (0)