Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
</PropertyGroup>
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactPackageDirectories.props" />
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactDirectories.props" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this already included in vnext\Directory.Build.props?

I see this project lives outside vnext. Can you confirm it's explicitly included because of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playground (non-win32) was able to correctly build locally, meaning it was able to pick up the properties. It it wasn't included, it would fail pretty hard.

<Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactCommunity.cpp.props" />
<Import Project="$(ReactNativeWindowsDir)PropertySheets\React.Cpp.props" />
<ItemGroup Label="ProjectConfigurations">
Expand Down
5 changes: 1 addition & 4 deletions packages/playground/windows/playground/Playground.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
</PropertyGroup>
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactPackageDirectories.props" />
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactDirectories.props" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is the same as Playground-win32.vcxproj.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Once these are converted from ReactUwp to Microsoft.ReactNative we can keep everything tucked into vnext as well.

<Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactCommunity.cpp.props" />
<Import Project="$(ReactNativeWindowsDir)PropertySheets\React.Cpp.props" />
<!-- Include Warnings.props after Microsoft.Cpp.props to change default WarningLevel -->
Expand Down
16 changes: 2 additions & 14 deletions vnext/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,12 @@

<Platform Condition="'$(Platform)' == ''">x64</Platform>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>

</PropertyGroup>

<!-- Initialize $(ReactNativeWindowsDir) before it is used below. -->
<Import Project="$(MSBuildThisFileDirectory)\PropertySheets\ReactPackageDirectories.props" />

<PropertyGroup Label="Configuration">
<ProjectName Condition="'$(ProjectName)'==''">$(MSBuildProjectName)</ProjectName>
<!-- Visual Studio forces using 'Win32' for the 'x86' platform. -->
<BaseIntDir Condition="'$(Platform)' != 'Win32'">$(ReactNativeWindowsDir)build\$(Platform)\$(Configuration)</BaseIntDir>
<BaseIntDir Condition="'$(Platform)' == 'Win32'">$(ReactNativeWindowsDir)build\x86\$(Configuration)</BaseIntDir>
<BaseOutDir Condition="'$(Platform)' != 'Win32'">$(ReactNativeWindowsDir)target\$(Platform)\$(Configuration)</BaseOutDir>
<BaseOutDir Condition="'$(Platform)' == 'Win32'">$(ReactNativeWindowsDir)target\x86\$(Configuration)</BaseOutDir>

<IntDir>$(BaseIntDir)\$(ProjectName)\</IntDir>
<OutDir>$(BaseOutDir)\$(ProjectName)\</OutDir>

<GeneratedFilesDir>$(IntDir)Generated Files\</GeneratedFilesDir>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)\PropertySheets\ReactDirectories.props" />

</Project>
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
Projects should include the following code in their project file before importing this file:

<PropertyGroup>
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
</PropertyGroup>

<Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactPackageDirectories.props" />
<!--
We should move all of these to the vnext Directory.build.props once we no longer have to support ReactUwp playground
-->

<PropertyGroup>

<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$(MSBuildThisFileDirectory)\..\</ReactNativeWindowsDir>
<ReactNativePackageDir Condition="'$(ReactNativePackageDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native\package.json'))\node_modules\react-native\</ReactNativePackageDir>

<!-- Visual Studio forces using 'Win32' for the 'x86' platform. -->
<BaseIntDir Condition="'$(Platform)' != 'Win32'">$(ReactNativeWindowsDir)build\$(Platform)\$(Configuration)</BaseIntDir>
<BaseIntDir Condition="'$(Platform)' == 'Win32'">$(ReactNativeWindowsDir)build\x86\$(Configuration)</BaseIntDir>
<BaseOutDir Condition="'$(Platform)' != 'Win32'">$(ReactNativeWindowsDir)target\$(Platform)\$(Configuration)</BaseOutDir>
<BaseOutDir Condition="'$(Platform)' == 'Win32'">$(ReactNativeWindowsDir)target\x86\$(Configuration)</BaseOutDir>

<IntDir>$(BaseIntDir)\$(ProjectName)\</IntDir>
<OutDir>$(BaseOutDir)\$(ProjectName)\</OutDir>

<GeneratedFilesDir>$(IntDir)Generated Files\</GeneratedFilesDir>

<ReactNativeDir Condition="'$(ReactNativeDir)' == ''">$(IntDir)\react-native-patched\</ReactNativeDir>

<!-- For relative paths, make it relative to MSBuildProjectDirectory not CurrentWorkingDirectory. -->
<ReactNativeDir>$([MSBuild]::NormalizeDirectory( $([System.IO.Path]::Combine( $(MSBuildProjectDirectory), $(ReactNativeDir) )) ))</ReactNativeDir>

Expand Down
3 changes: 0 additions & 3 deletions vnext/ReactWindowsCore/ReactWindowsCore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@
$(FollyDir);
$(ReactNativeWindowsDir)\ReactWindowsCore\pch;
$(ReactNativeWindowsDir)\ReactWindowsCore\tracing;
$(ProjectDir);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to the PR, but these shouldn't be here. ProjectDir will already be included, and the latter two allow consuming from build output while building which is dangerous and not really that useful.

$(GeneratedFilesDir);
$(IntDir);
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(USE_HERMES)'=='true'">$(HERMES_Package)\installed\$(VcpkgTriplet)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
Expand Down