From 4eefb26626c3155ad3982f0638326e328a5edd9a Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 3 Apr 2020 16:21:18 -0700 Subject: [PATCH 1/2] Clean Up Directory Logic to Fix Publish #4469 reordered build logic to define ReactNativeWindowsDir before it was seemingly used. This actually made it so we no longer correctly put patched react native sources in the right intermediate build output directory, since we don't define IntDir before including directory logic. Seemingly the previous documented assumption was that we should define ReactNativeWindowsDir before including ReactPackageDirectories.props. This is oddd/error prone. This change combines logic so we can correctly interleave dependencies. It has the side effect of forcing anything including ReactPackageDirectories to include out intermediate output dir. This should only affect ReactUwp projects, which we will no longer be supporting for 0.62. We can't actually test that this fixes publish because of #3889, but this should theoretically fix the issue. Tested locally that we can build Playground. --- .../playground-win32/Playground-win32.vcxproj | 5 +--- .../windows/playground/Playground.vcxproj | 5 +--- vnext/Directory.Build.props | 16 ++---------- ...rectories.props => ReactDirectories.props} | 25 ++++++++++++------- .../ReactWindowsCore/ReactWindowsCore.vcxproj | 3 --- 5 files changed, 20 insertions(+), 34 deletions(-) rename vnext/PropertySheets/{ReactPackageDirectories.props => ReactDirectories.props} (64%) diff --git a/packages/playground/windows/playground-win32/Playground-win32.vcxproj b/packages/playground/windows/playground-win32/Playground-win32.vcxproj index acc34f5f92d..3d8ffa2eef5 100644 --- a/packages/playground/windows/playground-win32/Playground-win32.vcxproj +++ b/packages/playground/windows/playground-win32/Playground-win32.vcxproj @@ -9,10 +9,7 @@ 10.0.18362.0 - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\ - - + diff --git a/packages/playground/windows/playground/Playground.vcxproj b/packages/playground/windows/playground/Playground.vcxproj index 02200a4c248..bded084dbb4 100644 --- a/packages/playground/windows/playground/Playground.vcxproj +++ b/packages/playground/windows/playground/Playground.vcxproj @@ -43,10 +43,7 @@ true - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\ - - + diff --git a/vnext/Directory.Build.props b/vnext/Directory.Build.props index aaafcac7ca0..ac480fe2db0 100644 --- a/vnext/Directory.Build.props +++ b/vnext/Directory.Build.props @@ -10,24 +10,12 @@ x64 Debug - - - - $(MSBuildProjectName) - - $(ReactNativeWindowsDir)build\$(Platform)\$(Configuration) - $(ReactNativeWindowsDir)build\x86\$(Configuration) - $(ReactNativeWindowsDir)target\$(Platform)\$(Configuration) - $(ReactNativeWindowsDir)target\x86\$(Configuration) - - $(BaseIntDir)\$(ProjectName)\ - $(BaseOutDir)\$(ProjectName)\ - - $(IntDir)Generated Files\ + + diff --git a/vnext/PropertySheets/ReactPackageDirectories.props b/vnext/PropertySheets/ReactDirectories.props similarity index 64% rename from vnext/PropertySheets/ReactPackageDirectories.props rename to vnext/PropertySheets/ReactDirectories.props index e48f5ffb6c3..a0791a7d0c8 100644 --- a/vnext/PropertySheets/ReactPackageDirectories.props +++ b/vnext/PropertySheets/ReactDirectories.props @@ -1,21 +1,28 @@ - - + $(MSBuildThisFileDirectory)\..\ $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native\package.json'))\node_modules\react-native\ + + + $(ReactNativeWindowsDir)build\$(Platform)\$(Configuration) + $(ReactNativeWindowsDir)build\x86\$(Configuration) + $(ReactNativeWindowsDir)target\$(Platform)\$(Configuration) + $(ReactNativeWindowsDir)target\x86\$(Configuration) + + $(BaseIntDir)\$(ProjectName)\ + $(BaseOutDir)\$(ProjectName)\ + + $(IntDir)Generated Files\ + $(IntDir)\react-native-patched\ - + $([MSBuild]::NormalizeDirectory( $([System.IO.Path]::Combine( $(MSBuildProjectDirectory), $(ReactNativeDir) )) )) diff --git a/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj b/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj index 88bf24711f4..d8162aef1b8 100644 --- a/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj +++ b/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj @@ -91,9 +91,6 @@ $(FollyDir); $(ReactNativeWindowsDir)\ReactWindowsCore\pch; $(ReactNativeWindowsDir)\ReactWindowsCore\tracing; - $(ProjectDir); - $(GeneratedFilesDir); - $(IntDir); %(AdditionalIncludeDirectories) $(HERMES_Package)\installed\$(VcpkgTriplet)\include\;%(AdditionalIncludeDirectories) From 15775ff5a3acf4cb82a0739bdb0d26f203ee3926 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 3 Apr 2020 16:21:58 -0700 Subject: [PATCH 2/2] Change files --- ...ct-native-windows-2020-04-03-16-21-58-fix-publish.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 change/react-native-windows-2020-04-03-16-21-58-fix-publish.json diff --git a/change/react-native-windows-2020-04-03-16-21-58-fix-publish.json b/change/react-native-windows-2020-04-03-16-21-58-fix-publish.json new file mode 100644 index 00000000000..28d34f1f664 --- /dev/null +++ b/change/react-native-windows-2020-04-03-16-21-58-fix-publish.json @@ -0,0 +1,8 @@ +{ + "type": "prerelease", + "comment": "Clean Up Directory Logic to Fix Publish", + "packageName": "react-native-windows", + "email": "ngerlem@microsoft.com", + "dependentChangeType": "patch", + "date": "2020-04-03T23:21:58.354Z" +} \ No newline at end of file