Skip to content

Commit 21380a0

Browse files
author
Kai Guo
authored
fix: windows project imports (#359)
Switched to $(ReactNativeWindowsDir) variable instead of searching for the hard coded path, this unblocks our uses cases inside react-native-windows repo.
1 parent 998900b commit 21380a0

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

example/windows/AsyncStorageExample.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Global
5555
..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9
5656
..\..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
5757
..\..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
58+
..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
5859
..\..\node_modules\react-native-windows\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
5960
..\..\node_modules\react-native-windows\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
6061
EndGlobalSection

example/windows/AsyncStorageExample/Bundle/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

windows/ReactNativeAsyncStorage/ReactNativeAsyncStorage.vcxproj

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@
6363
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
6464
<ImportGroup Label="ExtensionSettings">
6565
</ImportGroup>
66+
<PropertyGroup>
67+
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
68+
</PropertyGroup>
6669
<ImportGroup Label="Shared">
67-
<Import Project="..\..\..\..\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems" Label="Shared" Condition="Exists('..\..\..\..\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems')" />
68-
<Import Project="..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems" Label="Shared" Condition="Exists('..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems')" />
70+
<Import Project="$(ReactNativeWindowsDir)\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems" Label="Shared" />
6971
</ImportGroup>
7072
<ImportGroup Label="PropertySheets">
7173
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
@@ -135,11 +137,7 @@
135137
<None Include="PropertySheet.props" />
136138
</ItemGroup>
137139
<ItemGroup>
138-
<ProjectReference Include="..\..\..\..\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj" Condition="Exists('..\..\..\..\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj')">
139-
<Project>{f7d32bd0-2749-483e-9a0d-1635ef7e3136}</Project>
140-
<Private>false</Private>
141-
</ProjectReference>
142-
<ProjectReference Include="..\..\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj" Condition="Exists('..\..\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj')">
140+
<ProjectReference Include="$(ReactNativeWindowsDir)\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj">
143141
<Project>{f7d32bd0-2749-483e-9a0d-1635ef7e3136}</Project>
144142
<Private>false</Private>
145143
</ProjectReference>

0 commit comments

Comments
 (0)