Skip to content

Commit 1ea5673

Browse files
authored
Add builds and nugets for MS.RN Fabric (#12900)
## Description This PR adds configurations for Microsoft.ReactNative with Fabric enabled to PR, CI, and Publish builds. This change will enable the publishing of new versions of the Microsoft.ReactNative NuGet with the `-Fabric` suffix to differentiate it from the current Paper NuGet. This replicates the setup that Desktop has, where we create and publish versions of React Native Win32 nugets with the `-Fabric` suffix to indicate those versions are using Fabric. ### Type of Change - New feature (non-breaking change which adds functionality) ### Why We want the default new arch, new app / lib experience to *not* build RNW, but instead consume it via NuGets, see #12639. In order to get that started, we'll need the ### What Updated CI/PR/Publish configurations. ## Screenshots N/A ## Testing Verified new configurations fired off existing tests in PR. ## Changelog Should this change be included in the release notes: yes New Microsoft.ReactNative nugets with Fabric enabled
1 parent eeef500 commit 1ea5673

File tree

6 files changed

+164
-35
lines changed

6 files changed

+164
-35
lines changed

.ado/jobs/desktop.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ parameters:
1919
BuildConfiguration: Debug
2020
BuildPlatform: x64
2121
UseFabric: false
22-
- Name: X64DebugFabric
23-
BuildConfiguration: Debug
24-
BuildPlatform: x64
25-
UseFabric: true
2622
- Name: X64Release
2723
BuildConfiguration: Release
2824
BuildPlatform: x64
@@ -31,6 +27,10 @@ parameters:
3127
BuildConfiguration: Debug
3228
BuildPlatform: x86
3329
UseFabric: false
30+
- Name: X64DebugFabric
31+
BuildConfiguration: Debug
32+
BuildPlatform: x64
33+
UseFabric: true
3434
- BuildEnvironment: SecurePullRequest
3535
Matrix:
3636
- Name: X64DebugFabric
@@ -48,16 +48,20 @@ parameters:
4848
- Name: X86Debug
4949
BuildConfiguration: Debug
5050
BuildPlatform: x86
51+
- Name: X86Release
52+
BuildConfiguration: Release
53+
BuildPlatform: x86
5154
- Name: Arm64Debug
5255
BuildConfiguration: Debug
5356
BuildPlatform: ARM64
5457
- Name: Arm64Release
5558
BuildConfiguration: Release
5659
BuildPlatform: ARM64
57-
- Name: X86Release
58-
BuildConfiguration: Release
59-
BuildPlatform: x86
60-
- X86ReleaseFabric:
60+
- Name: X64DebugFabric
61+
BuildConfiguration: Debug
62+
BuildPlatform: x64
63+
UseFabric: true
64+
- Name: X86ReleaseFabric # Specifically built so binskim / tests get run on fabric
6165
BuildConfiguration: Release
6266
BuildPlatform: x86
6367
UseFabric: true

.ado/jobs/universal.yml

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,70 @@
1313
default:
1414
- BuildEnvironment: PullRequest
1515
Matrix:
16+
- Name: X64Debug
17+
BuildConfiguration: Debug
18+
BuildPlatform: x64
19+
UseFabric: false
1620
- Name: X64Release
1721
BuildConfiguration: Release
1822
BuildPlatform: x64
23+
UseFabric: false
1924
- Name: X86Debug
2025
BuildConfiguration: Debug
2126
BuildPlatform: x86
27+
UseFabric: false
2228
CreateApiDocs: true
23-
- BuildEnvironment: Continuous
29+
- Name: X64DebugFabric
30+
BuildConfiguration: Debug
31+
BuildPlatform: x64
32+
UseFabric: true
33+
- BuildEnvironment: SecurePullRequest
2434
Matrix:
25-
- Name: Arm64Debug
35+
- Name: X64DebugFabric
2636
BuildConfiguration: Debug
27-
BuildPlatform: ARM64
28-
- Name: Arm64Release
29-
BuildConfiguration: Release
30-
BuildPlatform: ARM64
37+
BuildPlatform: x64
38+
UseFabric: true
39+
- BuildEnvironment: Continuous
40+
Matrix:
3141
- Name: X64Debug
3242
BuildConfiguration: Debug
3343
BuildPlatform: x64
44+
UseFabric: false
3445
- Name: X64Release
3546
BuildConfiguration: Release
3647
BuildPlatform: x64
48+
UseFabric: false
3749
- Name: X86Debug
3850
BuildConfiguration: Debug
3951
BuildPlatform: x86
52+
UseFabric: false
4053
CreateApiDocs: true
4154
- Name: X86Release
4255
BuildConfiguration: Release
4356
BuildPlatform: x86
57+
UseFabric: false
58+
- Name: Arm64Debug
59+
BuildConfiguration: Debug
60+
BuildPlatform: ARM64
61+
UseFabric: false
62+
- Name: Arm64Release
63+
BuildConfiguration: Release
64+
BuildPlatform: ARM64
65+
UseFabric: false
66+
- Name: X64DebugFabric
67+
BuildConfiguration: Debug
68+
BuildPlatform: x64
69+
UseFabric: true
70+
- Name: X86ReleaseFabric # Specifically built so binskim / tests get run on fabric
71+
BuildConfiguration: Release
72+
BuildPlatform: x86
73+
UseFabric: true
4474

4575
jobs:
4676
- ${{ each config in parameters.buildMatrix }}:
4777
- ${{ if eq(config.BuildEnvironment, parameters.buildEnvironment) }}:
4878
- ${{ each matrix in config.Matrix }}:
49-
- job: UniversalBuild${{ matrix.BuildPlatform }}${{ matrix.BuildConfiguration }}
79+
- job: UniversalBuild${{ matrix.Name }}
5080
variables:
5181
- template: ../variables/windows.yml
5282
# Some tasks run on a different user (VssAdministrator) instead of the default user (AzDevOps).
@@ -71,10 +101,16 @@
71101

72102
- template: ../templates/apply-published-version-vars.yml
73103

104+
- ${{ if eq(matrix.UseFabric, true) }}:
105+
- template: ../templates/enable-fabric-experimental-feature.yml
106+
74107
- template: ../templates/msbuild-sln.yml
75108
parameters:
76109
solutionDir: vnext
77-
solutionName: Microsoft.ReactNative.sln
110+
${{ if eq(matrix.UseFabric, true) }}:
111+
solutionName: Microsoft.ReactNative.CppOnly.slnf
112+
${{ else }}:
113+
solutionName: Microsoft.ReactNative.sln
78114
buildPlatform: ${{ matrix.BuildPlatform }}
79115
buildConfiguration: ${{ matrix.BuildConfiguration }}
80116

@@ -102,7 +138,10 @@
102138

103139
- template: ../templates/publish-build-artifacts.yml
104140
parameters:
105-
artifactName: ReactWindows
141+
${{ if eq(matrix.UseFabric, true) }}:
142+
artifactName: ReactWindowsFabric
143+
${{ else }}:
144+
artifactName: ReactWindows
106145
buildPlatform: ${{ matrix.BuildPlatform }}
107146
buildConfiguration: ${{ matrix.BuildConfiguration }}
108147
contents: |
@@ -235,7 +274,7 @@
235274
collectDumpOn: onAbortOnly
236275
vsTestVersion: latest
237276
failOnMinTestsNotRun: true
238-
condition: and(succeeded(), not(eq('${{ matrix.BuildPlatform }}', 'ARM64')))
277+
condition: and(succeeded(), not(eq('${{ matrix.BuildPlatform }}', 'ARM64')), eq('${{ matrix.UseFabric }}', 'false'))
239278

240279
- task: VSTest@2
241280
displayName: Run Universal Unit Tests (NetCore)
@@ -253,4 +292,4 @@
253292
collectDumpOn: onAbortOnly
254293
vsTestVersion: latest
255294
failOnMinTestsNotRun: true
256-
condition: and(succeeded(), eq('${{ matrix.BuildPlatform }}', 'x64'))
295+
condition: and(succeeded(), eq('${{ matrix.BuildPlatform }}', 'x64'), eq('${{ matrix.UseFabric }}', 'false'))

.ado/publish.yml

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,21 +275,51 @@ extends:
275275
X64Release:
276276
BuildConfiguration: Release
277277
BuildPlatform: x64
278+
UseFabric: false
278279
X86Release:
279280
BuildConfiguration: Release
280281
BuildPlatform: x86
282+
UseFabric: false
281283
Arm64Release:
282284
BuildConfiguration: Release
283285
BuildPlatform: ARM64
286+
UseFabric: false
284287
X64Debug:
285288
BuildConfiguration: Debug
286289
BuildPlatform: x64
290+
UseFabric: false
287291
X86Debug:
288292
BuildConfiguration: Debug
289293
BuildPlatform: x86
294+
UseFabric: false
290295
Arm64Debug:
291296
BuildConfiguration: Debug
292-
BuildPlatform: ARM64
297+
BuildPlatform: ARM64Debug
298+
UseFabric: false
299+
X64ReleaseFabric:
300+
BuildConfiguration: Release
301+
BuildPlatform: x64
302+
UseFabric: true
303+
X86ReleaseFabric:
304+
BuildConfiguration: Release
305+
BuildPlatform: x86
306+
UseFabric: true
307+
Arm64ReleaseFabric:
308+
BuildConfiguration: Release
309+
BuildPlatform: ARM64
310+
UseFabric: true
311+
X64DebugFabric:
312+
BuildConfiguration: Debug
313+
BuildPlatform: x64
314+
UseFabric: true
315+
X86DebugFabric:
316+
BuildConfiguration: Debug
317+
BuildPlatform: x86
318+
UseFabric: true
319+
Arm64DebugFabric:
320+
BuildConfiguration: Debug
321+
BuildPlatform: ARM64
322+
UseFabric: true
293323
pool: ${{ parameters.AgentPool.Large }}
294324
timeoutInMinutes: 360 # CodeQL requires 3x usual build timeout
295325

@@ -304,6 +334,9 @@ extends:
304334

305335
- template: .ado/templates/apply-published-version-vars.yml@self
306336

337+
- ${{ if eq(matrix.UseFabric, true) }}:
338+
- template: .ado/templates/enable-fabric-experimental-feature.yml@self
339+
307340
- template: .ado/templates/msbuild-sln.yml@self
308341
parameters:
309342
solutionDir: vnext
@@ -321,7 +354,10 @@ extends:
321354
- template: .ado/templates/publish-build-artifacts.yml@self
322355
parameters:
323356
oneESMode: true ## Files are only copied to staging, not published
324-
artifactName: ReactWindows
357+
${{ if eq(matrix.UseFabric, true) }}:
358+
artifactName: ReactWindowsFabric
359+
${{ if eq(matrix.UseFabric, false) }}:
360+
artifactName: ReactWindows
325361
buildPlatform: $(BuildPlatform)
326362
buildConfiguration: $(BuildConfiguration)
327363
contents: |
@@ -354,9 +390,14 @@ extends:
354390
targetPath: '$(CrashDumpRootPath)'
355391
artifactName: Crash dumps - $(Agent.JobName)-$(System.JobAttempt)
356392
- output: pipelineArtifact
357-
displayName: 'Publish Artifact: ReactWindows.$(BuildPlatform).$(BuildConfiguration)'
358-
artifactName: ReactWindows.$(BuildPlatform).$(BuildConfiguration)
359-
targetPath: $(Build.StagingDirectory)/NuGet/ReactWindows/$(BuildPlatform)/$(BuildConfiguration)
393+
${{ if eq(matrix.UseFabric, true) }}:
394+
displayName: 'Publish Artifact: ReactWindowsFabric.$(BuildPlatform).$(BuildConfiguration)'
395+
artifactName: ReactWindowsFabric.$(BuildPlatform).$(BuildConfiguration)
396+
targetPath: $(Build.StagingDirectory)/NuGet/ReactWindowsFabric/$(BuildPlatform)/$(BuildConfiguration)
397+
${{ if eq(matrix.UseFabric, false) }}:
398+
displayName: 'Publish Artifact: ReactWindows.$(BuildPlatform).$(BuildConfiguration)'
399+
artifactName: ReactWindows.$(BuildPlatform).$(BuildConfiguration)
400+
targetPath: $(Build.StagingDirectory)/NuGet/ReactWindows/$(BuildPlatform)/$(BuildConfiguration)
360401

361402
- job: RNWNuget
362403
dependsOn:
@@ -406,6 +447,32 @@ extends:
406447
- platform: ARM64
407448
configuration: Debug
408449

450+
- template: .ado/templates/prep-and-pack-nuget.yml@self
451+
parameters:
452+
artifactName: ReactWindowsFabric
453+
publishCommitId: $(publishCommitId)
454+
npmVersion: $(npmVersion)-Fabric
455+
nugetroot: $(System.DefaultWorkingDirectory)\ReactWindows
456+
packMicrosoftReactNative: true
457+
packMicrosoftReactNativeCxx: true
458+
# packMicrosoftReactNativeManaged: true
459+
# packMicrosoftReactNativeManagedCodeGen: true
460+
${{ if or(eq(variables['EnableCodesign'], 'true'), endsWith(variables['Build.SourceBranchName'], '-stable')) }}: # Sign if EnableCodeSign or on *-stable release builds
461+
signMicrosoft: true
462+
slices:
463+
- platform: x64
464+
configuration: Release
465+
- platform: x86
466+
configuration: Release
467+
- platform: ARM64
468+
configuration: Release
469+
- platform: x64
470+
configuration: Debug
471+
- platform: x86
472+
configuration: Debug
473+
- platform: ARM64
474+
configuration: Debug
475+
409476
- template: .ado/templates/prep-and-pack-nuget.yml@self
410477
parameters:
411478
artifactName: Desktop
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Add builds and nugets for MS.RN Fabric",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"solution": {
3+
"path": "Microsoft.ReactNative.sln",
4+
"projects": [
5+
"Chakra\\Chakra.vcxitems",
6+
"Common\\Common.vcxproj",
7+
"Folly\\Folly.vcxproj",
8+
"Microsoft.ReactNative.ComponentTests\\Microsoft.ReactNative.ComponentTests.vcxproj",
9+
"Microsoft.ReactNative.Cxx.UnitTests\\Microsoft.ReactNative.Cxx.UnitTests.vcxproj",
10+
"Microsoft.ReactNative.Cxx\\Microsoft.ReactNative.Cxx.vcxitems",
11+
"Microsoft.ReactNative.IntegrationTests\\Microsoft.ReactNative.IntegrationTests.vcxproj",
12+
"Microsoft.ReactNative\\Microsoft.ReactNative.vcxproj",
13+
"Mso.UnitTests\\Mso.UnitTests.vcxproj",
14+
"Mso\\Mso.vcxitems",
15+
"ReactCommon\\ReactCommon.vcxproj",
16+
"Shared\\Shared.vcxitems",
17+
"fmt\\fmt.vcxproj",
18+
"include\\Include.vcxitems"
19+
]
20+
}
21+
}

vnext/Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,15 @@
141141
<Version>$(NETCoreUWPVersion)</Version>
142142
</PackageReference>
143143
</ItemGroup>
144-
<Choose>
145-
<When Condition="'$(EnableSourceLink)' == 'true'">
146-
<ItemGroup>
147-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
148-
</ItemGroup>
149-
</When>
150-
</Choose>
151144
<!--
152145
Visual Studio (but not MSBuild) will ignore Conditions applied directly to
153146
the PackageReference or ItemGroup containing a PackageReference. Both
154147
respect <Choose> for conditional restoration.
155148
-->
156149
<Choose>
157-
<When Condition="'$(UseWinUI3)'=='true'">
150+
<When Condition="'$(EnableSourceLink)' == 'true'">
158151
<ItemGroup>
159-
<PackageReference Include="Microsoft.WinUI">
160-
<Version>$(WinUI3Version)</Version>
161-
</PackageReference>
152+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
162153
</ItemGroup>
163154
</When>
164155
</Choose>

0 commit comments

Comments
 (0)