401416f637
## Description SourceLink is needed to ensure that our NuGet packages have matching source information when symbols are resolved. So we have an `EnableSourceLink` property which tells some of our projects to add source link, and we enable that when doing CI/PR/official builds by setting the property to true when we call msbuild in our pipelines. This PR makes it so that instead of having to pass that property, the projects themselves automatically build with source link when they need to. ### Type of Change - New feature (non-breaking change which adds functionality) ### Why This makes it so that local builds of RNW are closer to the the same nuget restore behavior / packages.lock.json file as when they're built in pipelines. This is part is working toward resolving #12004 and this functionality was extracted from PR #13634. ### What Instead of requiring us to call msbuild with `/p:EnableSourceLink=true` for every solution (or relying on setting it in `ExperimentalFeatures.props`) we now detect when our library projects are being built within the repo (detecting the `src-win` folder which isn't present in the NPM publish) and enable source link then. ## Screenshots N/A ## Testing N/A ## Changelog Should this change be included in the release notes: _yes_ Automatically set EnableSourceLink for in-repo builds only |
||
---|---|---|
.. | ||
JSValueReaderTest.cpp | ||
JSValueTest.cpp | ||
JsiTest.cpp | ||
JsonJSValueReader.cpp | ||
JsonJSValueReader.h | ||
JsonReader.cpp | ||
JsonReader.h | ||
Microsoft.ReactNative.Cxx.UnitTests.vcxproj | ||
NativeModuleTest.cpp | ||
NoAttributeNativeModuleTest.cpp | ||
Point.h | ||
PropertySheet.props | ||
ReactContextTest.cpp | ||
ReactModuleBuilderMock.cpp | ||
ReactModuleBuilderMock.h | ||
ReactPromiseTest.cpp | ||
TurboModuleTest.cpp | ||
main.cpp | ||
packages.lock.json | ||
pch.cpp | ||
pch.h | ||
readme.txt |
readme.txt
======================================================================== C++/WinRT Microsoft.ReactNative.Cxx.UnitTests Project Overview ======================================================================== This project demonstrates how to get started consuming Windows Runtime classes directly from standard C++, using platform projection headers generated from Windows SDK metadata files. Steps to generate and consume SDK platform projection: 1. Build project initally to generate platform projection headers into your Generated Files folder. 2. Include a projection namespace header in your pch.h, such as <winrt/Windows.Foundation.h>. 3. Consume winrt namespace and any Windows Runtime namespaces, such as winrt::Windows::Foundation, from source code. 4. Initialize apartment via init_apartment() and consume winrt classes. Steps to generate and consume a projection from third party metadata: 1. Add a WinMD reference by right-clicking the References project node and selecting "Add Reference...". In the Add References dialog, browse to the component WinMD you want to consume and add it. 2. Build the project once to generate projection headers for the referenced WinMD file under the "Generated Files" subfolder. 3. As above, include projection headers in pch or source code to consume projected Windows Runtime classes. ======================================================================== Learn more about C++/WinRT here: http://aka.ms/cppwinrt/ ========================================================================