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 relative working directory to NerdbankGitVersioning attribute #1200

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Sam13
Copy link
Contributor

@Sam13 Sam13 commented Jun 14, 2023

Adds support for mono repos by allowing usage of different configuration files in subdirectories.
See https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/doc/pathFilters.md for documentation about multiple NBGV configuration files in same repository.

Usage:

[NerdbankGitVersioning(WorkingDirectoryRelativePath = @"subdir\different-config\")]
readonly NerdbankGitVersioning Nbgv;

I confirm that the pull-request:

  • Follows the contribution guidelines
  • Is based on my own work
  • Is in compliance with my employer

@Sam13 Sam13 force-pushed the feature/nbgv-attribute-working-dir branch from c2ffc94 to 0c13515 Compare June 14, 2023 07:27
@Sam13
Copy link
Contributor Author

Sam13 commented Jun 15, 2023

@matkoch I don't think I'm responsible for all those Quodana errors during PR build :-|

public override object GetValue(MemberInfo member, object instance)
{
var version = NerdbankGitVersioningTasks.NerdbankGitVersioningGetVersion(s => s
.DisableProcessLogOutput()
.SetFormat(NerdbankGitVersioningFormat.json))
.SetFormat(NerdbankGitVersioningFormat.json)
.When(WorkingDirectoryRelativePath != null, x => x.SetProcessWorkingDirectory(Build.RootDirectory / WorkingDirectoryRelativePath)))
Copy link
Member

Choose a reason for hiding this comment

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

When is not needed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intention is to fallback to default working directory determination of ProcessTasks.StartProcess when not providing a relative configuration file directory via the attribute

@matkoch matkoch force-pushed the develop branch 4 times, most recently from e652c9a to 6ed9e4d Compare July 14, 2024 18:27
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.

5 participants