Skip to content

Commit

Permalink
Sync Directory.Build.props
Browse files Browse the repository at this point in the history
  • Loading branch information
SyncFileContents authored and SyncFileContents committed Jun 13, 2024
1 parent 77b84f6 commit f0153c1
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,44 @@
<SolutionName>$([System.IO.Path]::GetFileNameWithoutExtension($(SolutionPath)))</SolutionName>
<SolutionDirectory>$([System.IO.Path]::GetDirectoryName($(SolutionPath)))</SolutionDirectory>

<Authors>$([System.IO.File]::ReadAllText($([MSBuild]::GetPathOfFileAbove("AUTHORS"))).Trim())</Authors>
<Version>$([System.IO.File]::ReadAllText($([MSBuild]::GetPathOfFileAbove("VERSION"))).Trim())</Version>
<Description>$([System.IO.File]::ReadAllText($([MSBuild]::GetPathOfFileAbove("DESCRIPTION"))).Trim())</Description>

<VersionFileName>VERSION</VersionFileName>
<AuthorsFileName>AUTHORS</AuthorsFileName>
<DescriptionFileName>DESCRIPTION</DescriptionFileName>
<LicenseFileName>LICENSE</LicenseFileName>
<ChangelogFileName>CHANGELOG</ChangelogFileName>
<ReadmeFileName>README</ReadmeFileName>

<MetadataFileExtension></MetadataFileExtension>
<VersionFilePath>$([MSBuild]::ValueOrDefault($(VersionFilePath),$([MSBuild]::GetPathOfFileAbove("$(VersionFileName)$(MetadataFileExtension)"))))</VersionFilePath>
<AuthorsFilePath>$([MSBuild]::ValueOrDefault($(AuthorsFilePath),$([MSBuild]::GetPathOfFileAbove("$(AuthorsFileName)$(MetadataFileExtension)"))))</AuthorsFilePath>
<DescriptionFilePath>$([MSBuild]::ValueOrDefault($(DescriptionFilePath),$([MSBuild]::GetPathOfFileAbove("$(DescriptionFileName)$(MetadataFileExtension)"))))</DescriptionFilePath>
<LicenseFilePath>$([MSBuild]::ValueOrDefault($(LicenseFilePath),$([MSBuild]::GetPathOfFileAbove("$(LicenseFileName)$(MetadataFileExtension)"))))</LicenseFilePath>
<ChangelogFilePath>$([MSBuild]::ValueOrDefault($(ChangelogFilePath),$([MSBuild]::GetPathOfFileAbove("$(ChangelogFileName)$(MetadataFileExtension)"))))</ChangelogFilePath>
<ReadmeFilePath>$([MSBuild]::ValueOrDefault($(ReadmeFilePath),$([MSBuild]::GetPathOfFileAbove("$(ReadmeFileName)$(MetadataFileExtension)"))))</ReadmeFilePath>

<MetadataFileExtension>.md</MetadataFileExtension>
<VersionFilePath>$([MSBuild]::ValueOrDefault($(VersionFilePath),$([MSBuild]::GetPathOfFileAbove("$(VersionFileName)$(MetadataFileExtension)"))))</VersionFilePath>
<AuthorsFilePath>$([MSBuild]::ValueOrDefault($(AuthorsFilePath),$([MSBuild]::GetPathOfFileAbove("$(AuthorsFileName)$(MetadataFileExtension)"))))</AuthorsFilePath>
<DescriptionFilePath>$([MSBuild]::ValueOrDefault($(DescriptionFilePath),$([MSBuild]::GetPathOfFileAbove("$(DescriptionFileName)$(MetadataFileExtension)"))))</DescriptionFilePath>
<LicenseFilePath>$([MSBuild]::ValueOrDefault($(LicenseFilePath),$([MSBuild]::GetPathOfFileAbove("$(LicenseFileName)$(MetadataFileExtension)"))))</LicenseFilePath>
<ChangelogFilePath>$([MSBuild]::ValueOrDefault($(ChangelogFilePath),$([MSBuild]::GetPathOfFileAbove("$(ChangelogFileName)$(MetadataFileExtension)"))))</ChangelogFilePath>
<ReadmeFilePath>$([MSBuild]::ValueOrDefault($(ReadmeFilePath),$([MSBuild]::GetPathOfFileAbove("$(ReadmeFileName)$(MetadataFileExtension)"))))</ReadmeFilePath>

<MetadataFileExtension>.txt</MetadataFileExtension>
<VersionFilePath>$([MSBuild]::ValueOrDefault($(VersionFilePath),$([MSBuild]::GetPathOfFileAbove("$(VersionFileName)$(MetadataFileExtension)"))))</VersionFilePath>
<AuthorsFilePath>$([MSBuild]::ValueOrDefault($(AuthorsFilePath),$([MSBuild]::GetPathOfFileAbove("$(AuthorsFileName)$(MetadataFileExtension)"))))</AuthorsFilePath>
<DescriptionFilePath>$([MSBuild]::ValueOrDefault($(DescriptionFilePath),$([MSBuild]::GetPathOfFileAbove("$(DescriptionFileName)$(MetadataFileExtension)"))))</DescriptionFilePath>
<LicenseFilePath>$([MSBuild]::ValueOrDefault($(LicenseFilePath),$([MSBuild]::GetPathOfFileAbove("$(LicenseFileName)$(MetadataFileExtension)"))))</LicenseFilePath>
<ChangelogFilePath>$([MSBuild]::ValueOrDefault($(ChangelogFilePath),$([MSBuild]::GetPathOfFileAbove("$(ChangelogFileName)$(MetadataFileExtension)"))))</ChangelogFilePath>
<ReadmeFilePath>$([MSBuild]::ValueOrDefault($(ReadmeFilePath),$([MSBuild]::GetPathOfFileAbove("$(ReadmeFileName)$(MetadataFileExtension)"))))</ReadmeFilePath>

<Authors Condition="Exists('$(AuthorsFilePath)')">$([System.IO.File]::ReadAllText($(AuthorsFilePath)).Trim())</Authors>
<Description Condition="Exists('$(DescriptionFilePath)')">$([System.IO.File]::ReadAllText($(DescriptionFilePath)).Trim())</Description>
<License Condition="Exists('$(LicenseFilePath)')">$([System.IO.File]::ReadAllText($(LicenseFilePath)).Trim())</License>
<Changelog Condition="Exists('$(ChangelogFilePath)')">$([System.IO.File]::ReadAllText($(ChangelogFilePath)).Trim())</Changelog>
<Readme Condition="Exists('$(ReadmeFilePath)')">$([System.IO.File]::ReadAllText($(ReadmeFilePath)).Trim())</Readme>
<Version Condition="Exists('$(VersionFilePath)')">$([System.IO.File]::ReadAllText($(VersionFilePath)).Trim())</Version>

<AuthorsNamespace>$(Authors.Replace(" ", ""))</AuthorsNamespace>
<SolutionNamespace>$(SolutionName.Replace(" ", ""))</SolutionNamespace>
<ProjectNamespace>$(MSBuildProjectName.Replace(" ", "").Replace($(SolutionNamespace), "").Trim("."))</ProjectNamespace>
Expand Down

0 comments on commit f0153c1

Please sign in to comment.