Skip to content

Commit 7bfa8bf

Browse files
authored
fix(cli): fix template info not detecting mixed architecture projects (#15567)
1 parent eac4dbd commit 7bfa8bf

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Fixed template info not detecting mixed architecture projects",
4+
"packageName": "@react-native-windows/cli",
5+
"email": "4123478+tido64@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/@react-native-windows/cli/src/commands/config/configUtils.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,43 +143,43 @@ export function getRawTemplateInfo(filePath: string): RawTemplateInfo {
143143
if (
144144
importProjectExists(
145145
projectContents,
146-
'Microsoft.ReactNative.Uwp.CppApp.targets',
146+
'Microsoft.ReactNative.Composition.CppApp.targets',
147147
)
148148
) {
149149
result.projectType = 'app';
150-
result.projectArch = 'old';
150+
result.projectArch = 'new';
151151
} else if (
152152
importProjectExists(
153153
projectContents,
154-
'Microsoft.ReactNative.Uwp.CppLib.targets',
154+
'Microsoft.ReactNative.Composition.CppLib.targets',
155155
)
156156
) {
157157
result.projectType = 'lib';
158-
result.projectArch = 'old';
158+
result.projectArch = 'new';
159159
} else if (
160160
importProjectExists(
161161
projectContents,
162-
'Microsoft.ReactNative.Composition.CppApp.targets',
162+
'Microsoft.ReactNative.CppLib.targets',
163163
)
164164
) {
165-
result.projectType = 'app';
166-
result.projectArch = 'new';
165+
result.projectType = 'lib';
166+
result.projectArch = 'mixed';
167167
} else if (
168168
importProjectExists(
169169
projectContents,
170-
'Microsoft.ReactNative.Composition.CppLib.targets',
170+
'Microsoft.ReactNative.Uwp.CppApp.targets',
171171
)
172172
) {
173-
result.projectType = 'lib';
174-
result.projectArch = 'new';
173+
result.projectType = 'app';
174+
result.projectArch = 'old';
175175
} else if (
176176
importProjectExists(
177177
projectContents,
178-
'Microsoft.ReactNative.CppLib.targets',
178+
'Microsoft.ReactNative.Uwp.CppLib.targets',
179179
)
180180
) {
181181
result.projectType = 'lib';
182-
result.projectArch = 'mixed';
182+
result.projectArch = 'old';
183183
}
184184
}
185185

0 commit comments

Comments
 (0)