Skip to content

Conversation

@vmoroz
Copy link
Member

@vmoroz vmoroz commented Apr 1, 2020

When we create a new project using the 'react-native init' we have a build error.
It says that it cannot find Microsoft.ReactNative.winmd file.
The issue was that the target destination of this file is reported as a relative path instead of an absolute one. This is because the $(ReactNativeWindowsDir) variable is not initialized since the Directory.Build.props file from our repo root folder is not deployed.

In this PR we ensure that we properly initialize the $(ReactNativeWindowsDir) before it is used for the build and target folder creation. It fixes the issue with the new project builds.

Microsoft Reviewers: Open in CodeFlow

@vmoroz vmoroz requested a review from acoates-ms April 1, 2020 03:32
@vmoroz vmoroz requested a review from a team as a code owner April 1, 2020 03:32
@vmoroz vmoroz requested a review from a team April 1, 2020 03:32
Copy link
Contributor

@NickGerleman NickGerleman left a comment

Choose a reason for hiding this comment

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

Can we remove the other place this is imported now that we import it earlier?

Nevermind. Missed that the other was in the repo root.

@JunielKatarn JunielKatarn self-requested a review April 1, 2020 03:40
@vmoroz vmoroz added the AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity) label Apr 1, 2020
@ghost
Copy link

ghost commented Apr 1, 2020

Hello @vmoroz!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 60 minutes, a condition that will be fulfilled in about 44 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 6bee377 into microsoft:master Apr 1, 2020
acoates-ms pushed a commit to acoates-ms/react-native-windows that referenced this pull request Apr 3, 2020
* Set $(ReactNativeWindowsDir) before it is used

* Change files
ghost pushed a commit that referenced this pull request Apr 3, 2020
* Fix crash when calling measure on non-framework element (#4473)

* Fix crash when calling measure on non-framework element

* Change files

* Fix new project build (#4469)

* Set $(ReactNativeWindowsDir) before it is used

* Change files

* Update MSBuild ADO Tasks to use MSBuild x64 (#4462)

* Removed x86 override for msbuild tasks in CI, publish
* Switch from MSBuild to VSBuild
* Added `<AppxGeneratePrisForPortableLibrariesEnabled>false</AppxGeneratePrisForPortableLibrariesEnabled>` to C# app projects to fix build issues with msbuild x64
* Added `/p:AppxGeneratePrisForPortableLibrariesEnabled=false` for testcli build task

* Some Direct Debugging fixes (#4440)

* Fix direct debugging

* formatting

* Change files

* Add timeout to certificate generation on project init (#4430)

* Add a timeout to catch hangs during cert generation

* Change files

* Update change files to use patch version bumping

* publishing fix

Co-authored-by: Vladimir Morozov <vmoroz@users.noreply.github.com>
Co-authored-by: Jon Thysell <jthysell@microsoft.com>
NickGerleman added a commit to NickGerleman/react-native-windows that referenced this pull request Apr 3, 2020
microsoft#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 microsoft#3889, but this should theoretically fix the issue.

Tested locally that we can build Playground.
ghost pushed a commit that referenced this pull request Apr 4, 2020
* 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.

* Change files
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants