Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ conventional-commits check.
| `just update-version` | Runs `.build/update-version.ts` to sync the version into docs/samples. |
| `just pack` | Updates the version then packs the NuGet package into `artifacts/`. |

The version lives in `package.json`. **Current Version:** 5.0.0-prerelease.11 — applied to `Version` /
The version lives in `package.json`. **Current Version:** 5.0.0-prerelease.13 — applied to `Version` /
`PackageVersion` via the SDK's package.json version detection.

### Pipelines (reusable `purview-build` tool)
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<RoslynVersion>5.9.0</RoslynVersion>
<TUnitVersion>1.67.0</TUnitVersion>
<PurviewSGFVersion>1.0.0-prerelease.47</PurviewSGFVersion>
<PurviewSGFVersion>1.0.0-prerelease.48</PurviewSGFVersion>
<DotnetRuntimeVersion>10.0.12</DotnetRuntimeVersion>
<MSExtensionVersion>10.10.0</MSExtensionVersion>
<OpenTelemetryVersion>1.18.0</OpenTelemetryVersion>
Expand Down
7 changes: 7 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ pipeline-tests *args:
echo "Running tests pipeline..."
"{{ pipeline_tool }}" --Build:RunTests=true --Release:Mode=None {{ args }}

# Run the pipeline through pack + validate (restore, build, lint, tests, pack, validate pack contents) without publishing/releasing
[group('Pipeline')]
pipeline-pack-validate *args:
just ensure-pipeline-tool
echo "Running pack + validate pipeline..."
"{{ pipeline_tool }}" --Build:RunPack=true --Build:ValidatePack=true --Release:Mode=None {{ args }}

# -----------------------------------------------------------------------------
# Build and Test
# -----------------------------------------------------------------------------
Expand Down
9 changes: 0 additions & 9 deletions LICENSE.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Generates [`ActivitySource`](https://learn.microsoft.com/en-us/dotnet/api/system
Add to your `Directory.Build.props` or `.csproj` file:

```xml
<PackageReference Include="Purview.Telemetry.SourceGenerator" Version="5.0.0-prerelease.11">
<PackageReference Include="Purview.Telemetry.SourceGenerator" Version="5.0.0-prerelease.13">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion docs/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Merging to `main` triggers `release.yml`, which runs the reusable `purview-relea

## Versioning

- The version lives in `package.json`. **Current Version:** 5.0.0-prerelease.11
- The version lives in `package.json`. **Current Version:** 5.0.0-prerelease.13
- It is applied to `Version` / `PackageVersion` by `Purview.BuildSdk` via package.json
version detection (`UsePackageJsonVersion`, default `true`).
- `just version` prints the current version.
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"allowPrerelease": false
},
"msbuild-sdks": {
"Purview.BuildSdk": "1.0.0-prerelease.57"
"Purview.BuildSdk": "1.0.0-prerelease.58"
},
"test": {
"runner": "Microsoft.Testing.Platform"
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "purview-telemetry-sourcegenerator",
"version": "5.0.0-prerelease.12",
"version": "5.0.0-prerelease.13",
"description": "Generates [`ActivitySource`](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.activitysource), [`ILogger`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger), and [`Metrics`](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics) based on interface methods.",
"license": "MIT",
"readme": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/purview-dev/telemetry-sourcegenerator.git"
},
"author": "Kieron Lanning (https://github.com/kieronlanning/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/purview-dev/telemetry-sourcegenerator/issues"
},
"homepage": "https://purview.dev/projects/telemetry-sourcegenerator/"
}
}
46 changes: 21 additions & 25 deletions purview-build.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
{
"Build": {
"Solution": "src/Telemetry.SourceGenerator.slnx",
"TestRoot": "src/tests",
"TestPatterns": "*Tests.csproj",
"TestFilter": "/*/*/*/*"
},
"PackValidation": {
"RequireSymbolPackage": true,
"RequireSymbolFiles": true,
"RequiredContent": {
"purview.valueobjects": [
"README.md",
"purview-logo-light.png",
"buildTransitive/Purview.ValueObjects.targets",
"analyzers/dotnet/cs/Purview.SourceGeneratorFramework.dll",
"analyzers/dotnet/cs/Purview.Telemetry.SourceGenerator.dll",
"analyzers/dotnet/cs/Purview.Telemetry.SourceGenerator.Refactorings.dll",
"lib/netstandard2.0/Purview.Telemetry.SourceGenerator.Refactorings.dll"
]
"Build": {
"Solution": "src/Telemetry.SourceGenerator.slnx",
"TestRoot": "src/tests",
"TestPatterns": "*Tests.csproj",
"TestFilter": "/*/*/*/*"
},
"ForbiddenContent": {}
},
"Release": {
"Mode": "None"
}
}
"PackValidation": {
"RequireSymbolPackage": false,
"RequiredContent": {
"purview.telemetry.sourcegenerator": [
".agents/**/*",
"analyzers/dotnet/cs/Purview.Telemetry.SourceGenerator.dll",
"analyzers/dotnet/cs/Purview.Telemetry.SourceGenerator.Refactorings.dll",
"README.md",
"purview-logo-light.png"
]
}
},
"Release": {
"Mode": "None"
}
}
6 changes: 1 addition & 5 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<NamespacePrefix>Purview.Telemetry</NamespacePrefix>
<!--
This comes from Purview.BuildSdk where we auto include the
telemetry... obviously we don't want that here!
telemetry... obviously we don't want that here!
-->
<ExcludePurviewTelemetry>true</ExcludePurviewTelemetry>
<!--
Expand All @@ -18,10 +18,6 @@

<Import Sdk="Purview.BuildSdk" Project="Sdk.props" />

<PropertyGroup>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<PropertyGroup Label="Purview site URL metadata">
<PurviewHomepage>https://purview.dev/</PurviewHomepage>
<PurviewProjectUrl>$(PurviewHomepage)projects/telemetry-sourcegenerator/</PurviewProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="..\Shared\TelemetryAttributeNames.cs" Link="Shared\TelemetryAttributeNames.cs" />
<Compile Include="..\SourceGenerator\Helpers\IsExternalInit.cs" Link="Helpers\IsExternalInit.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="bin\**" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,17 @@ static void EmitFields(ActivityOutputContext output, CodeWriter writer, SourcePr
activitySourceName = PropertyLibrary.Activities.DefaultActivitySourceName;
}

#pragma warning disable IDE0002 // Simplify Member Access
writer
.Field(
new FieldDeclarationOptions(
PropertyLibrary.Activities.ActivitySourceFieldName,
TypeLibrary.System.Diagnostics.ActivitySource.AsTypeReference()
)
{
IsStatic = true,
IsReadOnly = true,
Initializer =
$"new {(string)TypeLibrary.System.Diagnostics.ActivitySource}({activitySourceName!.Wrap()})",
IncludeGeneratedAttributes = false,
}
writer.Field(
new(
PropertyLibrary.Activities.ActivitySourceFieldName,
TypeLibrary.System.Diagnostics.ActivitySource.AsTypeReference()
)
.NewLine();
#pragma warning restore IDE0002 // Simplify Member Access
{
IsStatic = true,
IsReadOnly = true,
Initializer =
$"new {(string)TypeLibrary.System.Diagnostics.ActivitySource}({activitySourceName!.Wrap()})",
}
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ SourceProductionContext context
new ParameterDeclarationOptions("exception", TypeLibrary.System.Exception.MakeNullable(writer)),
new ParameterDeclarationOptions("escape", TypeLibrary.System.Boolean.AsTypeReference()),
],
IncludeGeneratedAttributes = false,
}
)
)
Expand Down Expand Up @@ -166,7 +165,6 @@ static void EmitThrowStub(CodeWriter writer, ActivityBasedGenerationTarget metho
],
GenericTypes = [.. methodTarget.TypeParameters],
ExpressionBody = "throw new global::System.NotSupportedException()",
IncludeGeneratedAttributes = false,
}
)
)
Expand Down Expand Up @@ -252,7 +250,6 @@ SourceProductionContext context
p.ParameterType
)),
],
IncludeGeneratedAttributes = false,
}
)
)
Expand Down Expand Up @@ -297,7 +294,6 @@ SourceProductionContext context
p.ParameterType
)),
],
IncludeGeneratedAttributes = false,
}
)
)
Expand Down Expand Up @@ -380,7 +376,6 @@ SourceProductionContext context
p.ParameterType
)),
],
IncludeGeneratedAttributes = false,
}
)
)
Expand Down
1 change: 0 additions & 1 deletion src/src/SourceGenerator/Emitters/ConstructorEmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ GenerationContext<TelemetryCapabilities> generationContext
new ConstructorDeclarationOptions(classNameToGenerate, TypeDeclarationAccessibility.Public)
{
Parameters = BuildParameters(generationType, interfaceType, generationContext),
IncludeGeneratedAttributes = false,
},
body => EmitBody(generationType, body, generationContext)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ CancellationToken token
IsThis = true,
},
],
IncludeGeneratedAttributes = false,
}
)
)
Expand Down
9 changes: 2 additions & 7 deletions src/src/SourceGenerator/Emitters/GeneratedTypesEmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,18 +393,13 @@ static void WriteNullableStringProperty(CodeWriter writer, string name, string s
hashWriter
.XmlSummary(summary)
.Property(
new(name, TypeLibrary.System.String, TypeDeclarationAccessibility.Public)
{
HasSetter = true,
IncludeGeneratedAttributes = false,
}
new(name, TypeLibrary.System.String, TypeDeclarationAccessibility.Public) { HasSetter = true }
)
.HashElse()
.Property(
new(name, TypeLibrary.System.String.MakeNullable(writer), TypeDeclarationAccessibility.Public)
{
HasSetter = true,
IncludeGeneratedAttributes = false,
}
)
);
Expand All @@ -424,7 +419,7 @@ static void WritePlainStringProperty(CodeWriter writer, string name, string summ
new(name, TypeLibrary.System.String, TypeDeclarationAccessibility.Public)
{
HasSetter = true,
IncludeGeneratedAttributes = false,

Initializer = initializer,
}
);
Expand Down
Loading
Loading