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 support for Directory.Build.props #44

Closed
samsmithnz opened this issue Aug 8, 2022 · 0 comments · Fixed by #45
Closed

Add support for Directory.Build.props #44

samsmithnz opened this issue Aug 8, 2022 · 0 comments · Fixed by #45

Comments

@samsmithnz
Copy link
Owner

samsmithnz commented Aug 8, 2022

This allows you to set variables at a top level, that are used in projects.

e.g.
Directory.Build.props

    <NetCoreTargetFramework>net6.0</NetCoreTargetFramework>
    <NetStandardTargetFramework>netstandard2.0</NetStandardTargetFramework>
    <NetFrameworkTargetFramework>net472</NetFrameworkTargetFramework>

a project file in a sub-directory

    <TargetFramework>$(NetCoreTargetFramework)</TargetFramework>

More details about how Directory.Build.props works in docs: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2022

To solve:

  1. When a variable is detected, lookup the value in a parent directory via Directory.Build.props
  2. Use the variable value as the counter

or

  1. detect Directory.Build.props file.
  2. Save variables/state of file
  3. When a variable is found in a project file, in a sub-dir, attempt to substitute in the correct value
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 a pull request may close this issue.

1 participant