Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add target to optionally run CodeGen before ReactNativeXaml build #234

Merged
merged 5 commits into from
Nov 4, 2022

Conversation

jonthysell
Copy link
Contributor

@jonthysell jonthysell commented Nov 2, 2022

This PR adds some new MSBuild properties and targets within ReactNativeXaml.vcxproj to support re-running the CodeGen before the build.

By setting a property in their ExperimentalFeatures.props file:

<RunReactNativeXamlCodeGenBeforeBuild>true</RunReactNativeXamlCodeGenBeforeBuild>

Customers can make sure the CodeGen tool runs before the native build. It's default to false since most customers don't need it. However, this will hopefully address microsoft/react-native-windows#10792, which was a hack to get the same effect.

Note that customers can also customize how the CodeGen runs, in particular, by specifying a different ReactNativeXamlTargetWinMD file if desired.

Microsoft Reviewers: Open in CodeFlow

This PR adds some new MSBuild properties and targets within
ReactNativeXaml.vcxproj to support re-running the CodeGen before the
build.

By setting a property in their ExperimentalFeatures.props file:

```xml
<RunReactNativeXamlCodeGenBeforeBuild>true</RunReactNativeXamlCodeGenBeforeBuild>
```

Customers can make sure the CodeGen tool runs before the native build.
It's default to `false` since most customers don't need it. However,
this will hopefully address
microsoft/react-native-windows#10792, which
was a hack to get the same effect.

Note that customers can also customize how the CodeGen runs, in
particular, by specifying a different `ReactNativeXamlTargetWinMD` file
if desired.
@jonthysell jonthysell requested a review from a team as a code owner November 2, 2022 00:18
@jonthysell
Copy link
Contributor Author

This works as-is, however it works better in combination with #232.

Looking to see if it's worth enhancing the target with the proper inputs/outputs so it's not run unnecessarily, and so can be set to run by default.

@jonthysell
Copy link
Contributor Author

Will merge main into this when #232 is checked in.

@jonthysell jonthysell merged commit 2bde6df into microsoft:main Nov 4, 2022
@jonthysell jonthysell deleted the codegentarget branch November 4, 2022 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants