Skip to content

Commit

Permalink
Document inclusion of SL v2 in readme
Browse files Browse the repository at this point in the history
This comes from the bump to ThisAssembly.Constants 2.0.6, which now considers GitInfo as a direct reference and will trigger the in-IDE requirement of sponsorship (direct, indirect or implicit).
  • Loading branch information
kzu committed Nov 1, 2024
1 parent 5759b38 commit 5a6e3d4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
13 changes: 7 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ Git Info from MSBuild, C# and VB
[![License](https://img.shields.io/:license-MIT-blue.svg)](https://opensource.org/licenses/mit-license.php)
[![Build status](https://ci.appveyor.com/api/projects/status/p9e5xdd86vnfe0q8?svg=true)](https://ci.appveyor.com/project/MobileEssentials/gitinfo)

## Usage

After installing via [NuGet](https://www.nuget.org/packages/GitInfo):
Install via [NuGet](https://www.nuget.org/packages/GitInfo):

```pwsh
PM> Install-Package GitInfo
```

<!-- include https://github.com/devlooped/.github/raw/main/sponsorlinkr.md -->

## Usage
<!-- #content -->
By default, if the containing project is a C#, F# or VB project, a compile-time generated
source file will contain all the git information and can be accessed from anywhere within
the assembly, as constants in a `ThisAssembly` (partial) class and its nested `Git` static class:
Expand Down Expand Up @@ -105,8 +107,7 @@ VB:
> the relevant properties to false: `GenerateAssemblyVersionAttribute`,
> `GenerateAssemblyFileVersionAttribute` and `GenerateAssemblyInformationalVersionAttribute`.

MSBuild:
You can also just build your own versioning logic in a target that depends on GitInfo using plain MSBuild:

```xml
<PropertyGroup>
Expand Down Expand Up @@ -255,7 +256,7 @@ to customize the behavior:
included in the [NuGet package](https://www.nuget.org/packages/GitInfo)
- 100% incremental build-friendly and high-performing (all proper Inputs/Outputs in place, smart caching of Git info, etc.)


<!-- #content -->
<!-- include https://github.com/devlooped/sponsors/raw/main/footer.md -->
# Sponsors

Expand Down
9 changes: 9 additions & 0 deletions src/Directory.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<Project InitialTargets="SetLocalVersion">

<PropertyGroup>
<Description>
$(Description)

> This project uses SponsorLink to attribute sponsor status (direct, indirect or implicit). For IDE usage, sponsor status is required.
> IDE-only warnings will be emitted after a grace period otherwise. Learn more at https://github.com/devlooped#sponsorlink.
</Description>
</PropertyGroup>

<Target Name="SetLocalVersion" Condition="!$(CI)">
<GetVersion>
<Output TaskParameter="Version" PropertyName="Version" />
Expand Down
3 changes: 1 addition & 2 deletions src/GitInfo/GitInfo.msbuildproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
<ItemGroup>
<PackageReference Include="NuGetizer" Version="1.2.3" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="ThisAssembly.Constants" Version="2.0.5" Pack="true" TargetFramework="netstandard2.0" />
<PackageReference Include="ThisAssembly.Constants" Version="2.0.6" Pack="true" TargetFramework="netstandard2.0" />
</ItemGroup>
<ItemGroup>
<None Include="build/**/*.*" />
<None Include="buildMultiTargeting/**/*.*" />
<None Include="buildTransitive/**/*.*" />
<None Include="..\..\readme.md" PackagePath="readme.md" />
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions src/GitInfo/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- include https://github.com/devlooped/.github/raw/main/sponsorlinkr.md -->
<!-- include ../../readme.md#content -->
<!-- include https://github.com/devlooped/sponsors/raw/main/footer.md -->
<!-- prevent expansion via CI markdown includes -->
<!-- exclude -->

0 comments on commit 5a6e3d4

Please sign in to comment.