Skip to content

Commit 62d5fe8

Browse files
committed
expanded readme, removed attribute from analyzer portion of package
1 parent 6918417 commit 62d5fe8

File tree

3 files changed

+54
-4
lines changed

3 files changed

+54
-4
lines changed

README.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,54 @@
1-
# SourceGeneratorContext
1+
# Datacute Source Generator Context
22
A source generator to help creators of source generators, by creating doc-comments showing the available generation context.
3+
4+
# Audience
5+
6+
This source generator is intended for developers creating source generators,
7+
who want to understand the context available to them during the generation process.
8+
9+
# Installation
10+
11+
Add the NuGet package `Datacute.SourceGeneratorContext`
12+
13+
The package includes both the source generator and a marker attribute dll.
14+
The marker attribute is used to indicate whereabouts in your project that the
15+
source generator context should be generated.
16+
17+
The marker attribute does not need to be included in your project's output assembly,
18+
so the package reference in you `.csproj` file can be marked as `PrivateAssets="all" ExcludeAssets="runtime"` as follows:
19+
20+
```xml
21+
<ItemGroup>
22+
<PackageReference Include="Datacute.SourceGeneratorContext" Version="1.0.0"
23+
PrivateAssets="all" ExcludeAssets="runtime" />
24+
</ItemGroup>
25+
```
26+
27+
# Usage
28+
29+
To use the source generator, create a partial class in your project and decorate it with the `[SourceGeneratorContext]` attribute.
30+
31+
```csharp
32+
using Datacute.SourceGeneratorContext;
33+
34+
[SourceGeneratorContext]
35+
public partial class MySourceGeneratorContext
36+
{
37+
// This class will be populated with doc-comments showing the available context for source generation.
38+
}
39+
```
40+
41+
Many more examples of the flags available to the attribute can be found in the example project on GitHub:
42+
43+
https://github.com/datacute/SourceGeneratorContext/blob/main/SourceGeneratorContextExample/Program.cs
44+
45+
---
46+
<small>
47+
<small>
48+
<small>
49+
50+
###### Datacute - Acute Information Revelation Tools
51+
52+
</small>
53+
</small>
54+
</small>

SourceGeneratorContext/SourceGeneratorContext.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
</ItemGroup>
6262

6363
<ItemGroup>
64-
<!-- Pack the attributes dll in the analyzers/dotnet/cs path -->
65-
<None Include="..\SourceGeneratorContext.Attribute\bin\$(Configuration)\netstandard2.0\Datacute.SourceGeneratorContext.Attribute.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
6664
<!-- Explicitly pack the main DLL as an analyzer -->
6765
<None Include="$(TargetDir)$(TargetFileName)" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
6866
</ItemGroup>

version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
33
<VersionPrefix>0.0.2</VersionPrefix>
4-
<VersionSuffix>alpha</VersionSuffix>
4+
<VersionSuffix>dev-$([System.DateTime]::UtcNow.ToString("yyyyMMdd-HHmmss"))</VersionSuffix>
55
</PropertyGroup>
66
</Project>

0 commit comments

Comments
 (0)