-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
30 lines (26 loc) · 1.63 KB
/
Directory.Build.props
File metadata and controls
30 lines (26 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup Label="NuGet" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'">
<ResolveNuGetPackages>false</ResolveNuGetPackages>
</PropertyGroup>
<!-- Replace Base.h with original React Native version for all vcxproj projects -->
<Target Name="ReplaceBaseHeader" BeforeTargets="Build" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'">
<PropertyGroup>
<SourceUrl>https://raw.githubusercontent.com/facebook/react-native/e6848ba5ba997d102cbaf6181c7c8c73e25a0827/packages/react-native/ReactCommon/react/bridging/Base.h</SourceUrl>
<TargetPath>$(ReactNativeWindowsDir)Microsoft.ReactNative.Cxx\ReactCommon\react\bridging\Base.h</TargetPath>
<BackupPath>$(TargetPath).backup</BackupPath>
</PropertyGroup>
<!-- Check if target directory exists -->
<Error Condition="!Exists('$([System.IO.Path]::GetDirectoryName($(TargetPath)))')"
Text="Target directory does not exist. This should run after react-native-windows is installed." />
<!-- Download and replace Base.h directly -->
<Message Text="Downloading and replacing Base.h file..." Importance="high" />
<DownloadFile SourceUrl="$(SourceUrl)"
DestinationFolder="$([System.IO.Path]::GetDirectoryName($(TargetPath)))"
DestinationFileName="$([System.IO.Path]::GetFileName($(TargetPath)))"
ContinueOnError="true">
<Output TaskParameter="DownloadedFile" PropertyName="DownloadedFile" />
</DownloadFile>
<Message Text="Base.h replacement completed successfully!" Importance="high" />
</Target>
</Project>