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

Directory.Build.props is ignored if there are no projects or solutions #865

Closed
nhirschey opened this issue Nov 8, 2023 · 3 comments
Closed

Comments

@nhirschey
Copy link
Collaborator

It is useful to build a blog-style site using this tool, with configuration handled by Directory.Build.props. This is not possible with the default theme because Directory.Build.props is ignored when there is no project or solution. The generated site thus has broken links for FsDocsLicenseLink, FsDocsReleaseNotes, and RespositoryLink. The command line tool also says the values aren't set even when they are:

For instance with this in directory build props, I get the below error:

  <PropertyGroup>
    <FsDocsLicenseLink>https://github.com/nhirschey/Teaching/blob/main/LICENSE.md</FsDocsLicenseLink>
    <FsDocsReleaseNotesLink>https://github.com/nhirschey/Teaching/blob/main/CHANGELOG.md</FsDocsReleaseNotesLink>
    <RepositoryUrl>https://github.com/nhirschey/Teaching</RepositoryUrl>
  </PropertyGroup>
> dotnet fsdocs watch --noapidocs --ignoreprojects --clean
project files are ignored, no API docs will be generated
cracking projects...
please set '<FsDocsLicenseLink>' in 'Directory.Build.props'
please set '<FsDocsReleaseNotesLink>' in 'Directory.Build.props'
please set '<Version>' in 'Directory.Build.props'
please set '<RepositoryUrl>' in 'Directory.Build.props'
using extra content from C:\Users\Nicholas Hirschey\.nuget\packages\fsdocs-tool\19.1.1\extras
Building docs first time...
@nojaf
Copy link
Collaborator

nojaf commented Nov 8, 2023

Yes, this is expected. The way a Directory.Build.props file works is that it adds everything it contains to all the child *proj files in that directory. Only actual projects are being cracked, and so these properties won't flow through as globals if there is nothing to crack.

We could probably try and find a Directory.Build.props and process it as XML if there were no projects.

@nojaf
Copy link
Collaborator

nojaf commented Nov 10, 2023

There should be a fix for this in https://www.nuget.org/packages/fsdocs-tool/20.0.0-alpha-007.

@nhirschey
Copy link
Collaborator Author

Works great. Thank you! With this and other improvements I can now use the default theme on my teaching site.

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

No branches or pull requests

2 participants