react-native-windows/vnext/Microsoft.ReactNative.Cxx.U...
Jon Thysell 401416f637
Automatically set EnableSourceLink for in-repo builds only (#13666)
## 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
2024-09-09 20:37:17 +00:00
..
JSValueReaderTest.cpp Fix typos and add `cspell` configuration (#11536) 2023-05-05 13:12:29 -07:00
JSValueTest.cpp Fix typos and add `cspell` configuration (#11536) 2023-05-05 13:12:29 -07:00
JsiTest.cpp Migrate NapiJsiRuntime from V8-JSI (#8617) 2021-09-18 02:01:46 +00:00
JsonJSValueReader.cpp
JsonJSValueReader.h
JsonReader.cpp
JsonReader.h
Microsoft.ReactNative.Cxx.UnitTests.vcxproj Bump minimum VS version to 17.11.0 (#13455) 2024-08-15 15:52:58 -07:00
NativeModuleTest.cpp Add REACT_MODULE_NOREG which is REACT_MODULE but without auto registration (#11849) 2023-07-09 07:11:30 -07:00
NoAttributeNativeModuleTest.cpp Update clang-format version to 1.5.0 (#6870) 2021-01-14 14:02:27 -08:00
Point.h
PropertySheet.props Set ToolsVersion to "Current" (#8212) 2021-07-13 16:19:08 -07:00
ReactContextTest.cpp Add option to load ship bundles from metro (#11595) 2023-05-11 13:09:37 -07:00
ReactModuleBuilderMock.cpp Add support for turbomodule eventemitters, and codegen (#13555) 2024-08-13 07:35:57 -07:00
ReactModuleBuilderMock.h Add support for turbomodule eventemitters, and codegen (#13555) 2024-08-13 07:35:57 -07:00
ReactPromiseTest.cpp Fix typos and add `cspell` configuration (#11536) 2023-05-05 13:12:29 -07:00
TurboModuleTest.cpp MakeTurboModuleProvider<TModule> uses TModule::ModuleSpec as the spec (#9049) 2021-11-03 16:30:44 -07:00
main.cpp
packages.lock.json Automatically set EnableSourceLink for in-repo builds only (#13666) 2024-09-09 20:37:17 +00:00
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/
========================================================================