Skip to content

Commit c335641

Browse files
authored
Merge New and Old Arch Microsoft.ReactNative Nuget packages (#14311)
## Description This PR combines the separate standard (Old Arch, Paper, UWP) versions and the `-Fabric` (New Arch, Fabric, WinAppSDK) `Microsoft.ReactNative` NuGet packages into one hybrid package with both sets of binaries. ### Type of Change - Breaking change (fix or feature that would cause existing functionality to not work as expected) ### Why It is currently an implementation detail that we have two separate "versions" of Microsoft.ReactNative.dll - one for Old Arch and one for New Arch - same named DLL, but a different API surface. Maintaining two different package versions for these makes it harder for us to do future work for New Arch and still support Old Arch. In particular it's holding back our ability to support C# for New Arch projects. Resolves #13940 ### What Updated the NuGet creation pipelines and nuspec files to use both the sets of build artifacts for the `Microsoft.ReactNative` packages together into one NuGet package, rather than creating each separately. Also changed some of the intermediate paths when creating the NuGet packages. **Note:** One side effect of this is that to build a NuGet, we need **both** the New and Old Arch builds for a platform configuration to have been built in order to build the NuGet. Also updated the appropriate targets so both New and Old projects download the one package but load the correct set of binaries based on their use of the `RnwNewArch` flag in their build. **Final Note**: This changes apply to the `Microsoft.ReactNative` NuGet package - I have left all other packages as-is for now. ## Screenshots N/A ## Testing Verified new CLI apps still build with new NuGet. ## Changelog Should this change be included in the release notes: _yes_ Merge New and Old Arch Microsoft.ReactNative Nuget packages
1 parent 2bc71c1 commit c335641

14 files changed

+125
-125
lines changed

.ado/jobs/cli-init-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ jobs:
307307

308308
${{ if eq(matrix.useNuGet, true) }}:
309309
dependsOn:
310+
- UniversalBuild${{ matrix.platform }}Release
310311
- UniversalBuild${{ matrix.platform }}ReleaseFabric
311312

312313
variables: [template: ../variables/windows.yml]

.ado/jobs/universal.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
BuildPlatform: x86
2727
UseFabric: false
2828
CreateApiDocs: true
29+
- Name: X86Release
30+
BuildConfiguration: Release
31+
BuildPlatform: x86
32+
UseFabric: false
33+
- Name: Arm64Release
34+
BuildConfiguration: Release
35+
BuildPlatform: ARM64
36+
UseFabric: false
2937
- Name: X64DebugFabric
3038
BuildConfiguration: Debug
3139
BuildPlatform: x64
@@ -44,6 +52,10 @@
4452
UseFabric: true
4553
- BuildEnvironment: SecurePullRequest
4654
Matrix:
55+
- Name: X64Release
56+
BuildConfiguration: Release
57+
BuildPlatform: x64
58+
UseFabric: false
4759
- Name: X64ReleaseFabric
4860
BuildConfiguration: Release
4961
BuildPlatform: x64

.ado/publish.yml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,9 @@ extends:
440440
- template: .ado/templates/prep-and-pack-nuget.yml@self
441441
parameters:
442442
artifactName: ReactWindows
443+
artifactName2: ReactWindowsFabric
443444
publishCommitId: $(publishCommitId)
444445
npmVersion: $(npmVersion)
445-
nugetroot: $(System.DefaultWorkingDirectory)\ReactWindows
446446
packMicrosoftReactNative: true
447447
packMicrosoftReactNativeCxx: true
448448
packMicrosoftReactNativeManaged: true
@@ -463,38 +463,12 @@ extends:
463463
- platform: ARM64
464464
configuration: Debug
465465

466-
- template: .ado/templates/prep-and-pack-nuget.yml@self
467-
parameters:
468-
artifactName: ReactWindowsFabric
469-
publishCommitId: $(publishCommitId)
470-
npmVersion: $(npmVersion)-Fabric
471-
nugetroot: $(System.DefaultWorkingDirectory)\ReactWindows
472-
packMicrosoftReactNative: true
473-
packMicrosoftReactNativeCxx: true
474-
# packMicrosoftReactNativeManaged: true
475-
# packMicrosoftReactNativeManagedCodeGen: true
476-
${{ if or(eq(variables['EnableCodesign'], 'true'), endsWith(variables['Build.SourceBranchName'], '-stable')) }}: # Sign if EnableCodeSign or on *-stable release builds
477-
signMicrosoft: false # Temporarily disabled for all builds, see issue #14030
478-
slices:
479-
- platform: x64
480-
configuration: Release
481-
- platform: x86
482-
configuration: Release
483-
- platform: ARM64
484-
configuration: Release
485-
- platform: x64
486-
configuration: Debug
487-
- platform: x86
488-
configuration: Debug
489-
- platform: ARM64
490-
configuration: Debug
491466

492467
- template: .ado/templates/prep-and-pack-nuget.yml@self
493468
parameters:
494469
artifactName: Desktop
495470
publishCommitId: $(publishCommitId)
496471
npmVersion: $(npmVersion)
497-
nugetroot: $(System.DefaultWorkingDirectory)\Desktop
498472
packDesktop: true
499473
${{ if or(eq(variables['EnableCodesign'], 'true'), endsWith(variables['Build.SourceBranchName'], '-stable')) }}: # Sign if EnableCodeSign or on *-stable release builds
500474
signMicrosoft: false # Temporarily disabled for all builds, see issue #14030
@@ -517,7 +491,6 @@ extends:
517491
artifactName: DesktopFabric
518492
publishCommitId: $(publishCommitId)
519493
npmVersion: $(npmVersion)-Fabric
520-
nugetroot: $(System.DefaultWorkingDirectory)\Desktop
521494
packDesktop: true
522495
${{ if or(eq(variables['EnableCodesign'], 'true'), endsWith(variables['Build.SourceBranchName'], '-stable')) }}: # Sign if EnableCodeSign or on *-stable release builds
523496
signMicrosoft: false # Temporarily disabled for all builds, see issue #14030

.ado/templates/prep-and-pack-nuget.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
parameters:
22
- name: artifactName
33
type: string
4+
- name: artifactName2
5+
type: string
6+
default: ''
47
- name: slices
58
type: object
69

@@ -14,7 +17,7 @@ parameters:
1417
# Note: NuGet pack expects platform-specific file separators ('\' on Windows).
1518
- name: nugetroot
1619
type: string
17-
default: $(System.DefaultWorkingDirectory)\ReactWindows
20+
default: $(System.DefaultWorkingDirectory)\NugetRoot
1821

1922
- name: packDesktop
2023
type: boolean
@@ -62,7 +65,13 @@ steps:
6265
displayName: 'Download ${{ parameters.artifactName }}.${{ slice.platform }}.${{ slice.configuration }}'
6366
inputs:
6467
artifact: ${{ parameters.artifactName }}.${{ slice.platform }}.${{ slice.configuration }}
65-
path: ${{parameters.nugetroot}}/${{ slice.platform }}/${{ slice.configuration }}
68+
path: ${{parameters.nugetroot}}/${{ parameters.artifactName }}/${{ slice.platform }}/${{ slice.configuration }}
69+
- ${{ if ne(parameters.artifactName2, '') }}:
70+
- task: DownloadPipelineArtifact@2
71+
displayName: 'Download ${{ parameters.artifactName2 }}.${{ slice.platform }}.${{ slice.configuration }}'
72+
inputs:
73+
artifact: ${{ parameters.artifactName2 }}.${{ slice.platform }}.${{ slice.configuration }}
74+
path: ${{parameters.nugetroot}}/${{ parameters.artifactName2 }}/${{ slice.platform }}/${{ slice.configuration }}
6675

6776
- task: PowerShell@2
6877
displayName: Copy MSRN Resources to NuGet layout

.ado/templates/prep-and-pack-single.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ parameters:
4141

4242
steps:
4343

44+
- powershell: gci $(System.DefaultWorkingDirectory)/NugetRoot
45+
displayName: List files in NugetRoot
46+
4447
- ${{ if ne(parameters.slices, '') }}:
4548
- powershell: >
4649
.\StripAdditionalPlatformsFromNuspec.ps1
@@ -49,7 +52,7 @@ steps:
4952
-slices (ConvertFrom-Json '${{ parameters.slices }}')
5053
-debug
5154
displayName: '${{ parameters.outputPackage }} - Strip slices from nuspec'
52-
workingDirectory: $(System.DefaultWorkingDirectory)/ReactWindows
55+
workingDirectory: $(System.DefaultWorkingDirectory)/NugetRoot
5356
5457
- ${{ if eq(parameters.codesignBinaries, true) }}:
5558
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
@@ -61,7 +64,7 @@ steps:
6164
AuthAKVName: 'rnw-keyvault'
6265
AuthCertName: 'React-Native-ESRP-App-Authentication'
6366
AuthSignCertName: 'React-Native-PRSS-Authentication'
64-
FolderPath: $(System.DefaultWorkingDirectory)/ReactWindows
67+
FolderPath: $(System.DefaultWorkingDirectory)/NugetRoot
6568
# Recursively finds files matching these patterns:
6669
${{ if ne(parameters.binariesToSign, '') }}:
6770
Pattern: ${{ parameters.binariesToSign }}
@@ -102,7 +105,7 @@ steps:
102105
inputs:
103106
command: pack
104107
verbosityPack: 'Detailed'
105-
packagesToPack: $(System.DefaultWorkingDirectory)/ReactWindows/${{ parameters.outputPackage }}.nuspec
108+
packagesToPack: $(System.DefaultWorkingDirectory)/NugetRoot/${{ parameters.outputPackage }}.nuspec
106109
packDestination: $(System.DefaultWorkingDirectory)/NugetRootFinal
107110
buildProperties: version=${{ parameters.packageVersion }};id=${{ parameters.outputPackage }};${{ parameters.buildProperties }}
108111

.ado/templates/react-native-init-windows.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ steps:
4747
- ${{ if eq(parameters.useNuGet, true) }}:
4848
- template: prep-and-pack-nuget.yml
4949
parameters:
50-
artifactName: ReactWindowsFabric
51-
npmVersion: $(npmVersion)-Fabric
50+
artifactName: ReactWindows
51+
artifactName2: ReactWindowsFabric
52+
npmVersion: $(npmVersion)
5253
packMicrosoftReactNative: true
5354
packMicrosoftReactNativeCxx: true
5455
slices:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Merge New and Old Arch Microsoft.ReactNative Nuget packages",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

vnext/PropertySheets/External/Microsoft.ReactNative.Cpp.PackageReferences.props

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,8 @@
55
-->
66
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
77
<!-- Only include Microsoft.ReactNative.* NuGet packages that C++ (app and lib) projects need when using UseExperimentalNuget. -->
8-
<Choose>
9-
<When Condition="'$(RnwNewArch)' == 'true'">
10-
<ItemGroup>
11-
<PackageReference Include="Microsoft.ReactNative" Version="$(ReactNativeWindowsVersion)-Fabric" />
12-
<PackageReference Include="Microsoft.ReactNative.Cxx" Version="$(ReactNativeWindowsVersion)-Fabric" />
13-
</ItemGroup>
14-
</When>
15-
<Otherwise>
16-
<ItemGroup>
17-
<PackageReference Include="Microsoft.ReactNative" Version="$(ReactNativeWindowsVersion)" />
18-
<PackageReference Include="Microsoft.ReactNative.Cxx" Version="$(ReactNativeWindowsVersion)" />
19-
</ItemGroup>
20-
</Otherwise>
21-
</Choose>
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.ReactNative" Version="$(ReactNativeWindowsVersion)" />
10+
<PackageReference Include="Microsoft.ReactNative.Cxx" Version="$(ReactNativeWindowsVersion)" />
11+
</ItemGroup>
2212
</Project>

vnext/Scripts/Microsoft.ReactNative.Managed.CodeGen.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
<file src="$nugetroot$\Microsoft.ReactNative.Managed.CodeGen.targets" target="build"/>
1919
<file src="$nugetroot$\Microsoft.ReactNative.VersionCheck.targets" target="build"/>
2020

21-
<file src="$nugetroot$\$baseplatform$\$baseconfiguration$\Microsoft.ReactNative.Managed.CodeGen\Publish\**" target="tools"/>
21+
<file src="$nugetroot$\ReactWindows\$baseplatform$\$baseconfiguration$\Microsoft.ReactNative.Managed.CodeGen\Publish\**" target="tools"/>
2222
</files>
2323
</package>

vnext/Scripts/Microsoft.ReactNative.Managed.nuspec

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,39 @@
2626
<file src="$nugetroot$\Microsoft.ReactNative.Managed.targets" target="build"/>
2727
<file src="$nugetroot$\Microsoft.ReactNative.VersionCheck.targets" target="build"/>
2828

29-
<file src="$nugetroot$\$baseplatform$\$baseconfiguration$\Microsoft.ReactNative.Managed\ref\Microsoft.ReactNative.Managed.dll" target="ref\uap10.0"/>
30-
<file src="$nugetroot$\$baseplatform$\$baseconfiguration$\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.xml" target="ref\uap10.0"/>
29+
<file src="$nugetroot$\ReactWindows\$baseplatform$\$baseconfiguration$\Microsoft.ReactNative.Managed\ref\Microsoft.ReactNative.Managed.dll" target="ref\uap10.0"/>
30+
<file src="$nugetroot$\ReactWindows\$baseplatform$\$baseconfiguration$\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.xml" target="ref\uap10.0"/>
3131

3232
<!-- Include in Microsoft.ReactNative.Managed -->
33-
<file src="$nugetroot$\ARM64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-arm64\native" />
34-
<file src="$nugetroot$\ARM64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-arm64\native" />
35-
<file src="$nugetroot$\ARM64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-arm64\native" />
33+
<file src="$nugetroot$\ReactWindows\ARM64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-arm64\native" />
34+
<file src="$nugetroot$\ReactWindows\ARM64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-arm64\native" />
35+
<file src="$nugetroot$\ReactWindows\ARM64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-arm64\native" />
3636

37-
<file src="$nugetroot$\x86\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-x86\native" />
38-
<file src="$nugetroot$\x86\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-x86\native" />
39-
<file src="$nugetroot$\x86\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-x86\native" />
37+
<file src="$nugetroot$\ReactWindows\x86\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-x86\native" />
38+
<file src="$nugetroot$\ReactWindows\x86\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-x86\native" />
39+
<file src="$nugetroot$\ReactWindows\x86\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-x86\native" />
4040

41-
<file src="$nugetroot$\x64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-x64\native" />
42-
<file src="$nugetroot$\x64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-x64\native" />
43-
<file src="$nugetroot$\x64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-x64\native" />
41+
<file src="$nugetroot$\ReactWindows\x64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-x64\native" />
42+
<file src="$nugetroot$\ReactWindows\x64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-x64\native" />
43+
<file src="$nugetroot$\ReactWindows\x64\Release\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-x64\native" />
4444

4545
<!-- Include in Microsoft.ReactNative.Managed.Debug -->
46-
<file src="$nugetroot$\ARM64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-arm64\native" />
47-
<file src="$nugetroot$\ARM64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-arm64\native" />
48-
<file src="$nugetroot$\ARM64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-arm64\native" />
46+
<file src="$nugetroot$\ReactWindows\ARM64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-arm64\native" />
47+
<file src="$nugetroot$\ReactWindows\ARM64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-arm64\native" />
48+
<file src="$nugetroot$\ReactWindows\ARM64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-arm64\native" />
4949

50-
<file src="$nugetroot$\x86\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-x86\native" />
51-
<file src="$nugetroot$\x86\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-x86\native" />
52-
<file src="$nugetroot$\x86\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-x86\native" />
50+
<file src="$nugetroot$\ReactWindows\x86\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-x86\native" />
51+
<file src="$nugetroot$\ReactWindows\x86\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-x86\native" />
52+
<file src="$nugetroot$\ReactWindows\x86\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-x86\native" />
5353

54-
<file src="$nugetroot$\x64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-x64\native" />
55-
<file src="$nugetroot$\x64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-x64\native" />
56-
<file src="$nugetroot$\x64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-x64\native" />
54+
<file src="$nugetroot$\ReactWindows\x64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.dll" target="runtimes\win10-x64\native" />
55+
<file src="$nugetroot$\ReactWindows\x64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pdb" target="runtimes\win10-x64\native" />
56+
<file src="$nugetroot$\ReactWindows\x64\Debug\Microsoft.ReactNative.Managed\Microsoft.ReactNative.Managed.pri" target="runtimes\win10-x64\native" />
5757

5858
<!-- XBF files need to be included for Debug since they are not embedded in the PRI -->
59-
<file src="$nugetroot$\ARM64\Debug\Microsoft.ReactNative\**\*.xbf" target="runtimes\win10-arm64\native" />
60-
<file src="$nugetroot$\x86\Debug\Microsoft.ReactNative\**\*.xbf" target="runtimes\win10-x86\native" />
61-
<file src="$nugetroot$\x64\Debug\Microsoft.ReactNative\**\*.xbf" target="runtimes\win10-x64\native" />
59+
<file src="$nugetroot$\ReactWindows\ARM64\Debug\Microsoft.ReactNative\**\*.xbf" target="runtimes\win10-arm64\native" />
60+
<file src="$nugetroot$\ReactWindows\x86\Debug\Microsoft.ReactNative\**\*.xbf" target="runtimes\win10-x86\native" />
61+
<file src="$nugetroot$\ReactWindows\x64\Debug\Microsoft.ReactNative\**\*.xbf" target="runtimes\win10-x64\native" />
6262

6363
</files>
6464
</package>

0 commit comments

Comments
 (0)