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 .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"rollForward": false
},
"purview.build": {
"version": "0.5.4",
"version": "0.7.1",
"commands": [
"purview-build"
],
Expand Down
8 changes: 5 additions & 3 deletions .config/purview-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"Solution": "src/ResourceKit.slnx",
"TestRoot": "src/tests",
"TestPatterns": "*Tests.csproj",
"TestFilter": "/*/*/*/*[Category=Unit]"
"TestFilter": "/*/*/*/*"
},
"PackValidation": {
// Explicit because Purview.Build 0.5.3 defaults RequiredCompilerFlags to empty. Earlier
// versions forced this check on and could not be configured off, so these packages have
// always been validated against it; declaring it keeps that behaviour.
"RequiredCompilerFlags": ["optimization=release"],
"RequiredCompilerFlags": [
"optimization=release"
],
"RequireSymbolPackage": true,
"RequireSymbolFiles": true,
"RequiredContent": {
Expand All @@ -26,4 +28,4 @@
"Release": {
"Mode": "None"
}
}
}
158 changes: 88 additions & 70 deletions .editorconfig

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
push:
branches: [main]

permissions:
contents: write
# The shared release workflow pushes the same packages to nuget.org and, when
# PURVIEW_PUBLISH_GITHUB_PACKAGES=true, to GitHub Packages. A reusable workflow cannot grant
# more than its caller, so the permission is declared here.
packages: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
12 changes: 6 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<RoslynVersion>5.9.0</RoslynVersion>
<TUnitVersion>1.75.0</TUnitVersion>
<PurviewSourceGeneratorFrameworkVersion>1.1.1</PurviewSourceGeneratorFrameworkVersion>
<PurviewTelemetryVersion>5.0.4</PurviewTelemetryVersion>
<TUnitVersion>1.76.0</TUnitVersion>
<PurviewSourceGeneratorFrameworkVersion>1.2.0</PurviewSourceGeneratorFrameworkVersion>
<PurviewTelemetryVersion>5.0.5</PurviewTelemetryVersion>
<DotNetRuntimeVersion>10.0.13</DotNetRuntimeVersion>
<MSExtensionVersion>10.11.0</MSExtensionVersion>
<OTelVersion>1.20.0</OTelVersion>
<AspireVersion>13.6.1</AspireVersion>
<OTelVersion>1.20.1</OTelVersion>
<AspireVersion>13.6.3</AspireVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="$(RoslynVersion)" />
Expand Down Expand Up @@ -52,7 +52,7 @@
<PackageVersion Include="TUnit.Core" Version="$(TUnitVersion)" />
<PackageVersion Include="TUnit.Aspire" Version="$(TUnitVersion)" />
<PackageVersion Include="TUnit.Mocks" Version="$(TUnitVersion)" />
<PackageVersion Include="Purview.Skills.Testing" Version="1.0.6" />
<PackageVersion Include="Purview.Skills.Testing" Version="1.1.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="$(MSExtensionVersion)" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="$(MSExtensionVersion)" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="$(OTelVersion)" />
Expand Down
6 changes: 4 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"sdk": {
"allowPrerelease": false
"version": "11.0.100-rc.2.26504.105",
"rollForward": "latestMajor",
"allowPrerelease": true
},
"msbuild-sdks": {
"Purview.BuildSdk": "1.0.6"
"Purview.BuildSdk": "1.1.0"
},
"test": {
"runner": "Microsoft.Testing.Platform"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aspire-resourcekit",
"version": "1.0.1",
"version": "1.0.2",
"description": "Source-generator-powered framework for structuring .NET Aspire AppHost resource composition as strongly typed, test-friendly classes.",
"keywords": [],
"homepage": "https://purview.dev/projects/aspire-resourcekit/",
Expand Down
2 changes: 1 addition & 1 deletion src/src/Example.AppHost/Example.AppHost.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.6.1">
<Project Sdk="Aspire.AppHost.Sdk/13.6.3">
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
2 changes: 1 addition & 1 deletion src/src/Example.ManualAppHost/Example.ManualAppHost.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.6.1">
<Project Sdk="Aspire.AppHost.Sdk/13.6.3">
<PropertyGroup>
<!--
This isn't required, but it proves the point that it all works
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Microsoft.AspNetCore.Builder;

[EditorBrowsable(EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible")]
public static class WebApplicationExtensions
{
extension(WebApplication app)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Microsoft.Extensions.Hosting;

[EditorBrowsable(EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible")]
public static class HostApplicationBuilderExtensions
{
extension<TBuilder>(TBuilder builder)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System.ComponentModel;
using System.ComponentModel;

namespace Aspire.Hosting.ApplicationModel;

[EditorBrowsable(EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible")]
public static class IResourceBuilderExtensions
{
extension<T>(IResourceBuilder<T> builder)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.ComponentModel;
using System.ComponentModel;
using Microsoft.Extensions.DependencyInjection;

namespace Aspire.Hosting;
Expand All @@ -7,6 +7,7 @@ namespace Aspire.Hosting;
/// Provides extension methods for registering a ResourceKit host application.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible")]
public static class DistributedApplicationBuilderExtensions
{
extension(IDistributedApplicationBuilder builder)
Expand Down
10 changes: 5 additions & 5 deletions src/src/SourceGeneration/HostKitGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
.RegisterEmbeddedAttribute<HostKitGenerator>()
.RegisterPostInitializationOutput(static postInitContext =>
{
foreach (var (HintName, Source) in CodeGenEmiiter.EmitAttributes())
postInitContext.AddSource(HintName, Source);
foreach (var (hintName, source) in CodeGenEmiiter.EmitAttributes())
postInitContext.AddSource(hintName, source);
});

var pipelines = SourceGenLibrary.GetGeneratorValueProviders(context);
Expand Down Expand Up @@ -61,8 +61,8 @@ .. m

static bool ReportDiagnostics(SourceProductionContext sourceProductionContext, KitGenerationModel outputContext)
{
var (IsFatal, Diagnostics) = outputContext.GetAllDiagnostics();
foreach (var diagnostic in Diagnostics)
var (isFatal, diagnostics) = outputContext.GetAllDiagnostics();
foreach (var diagnostic in diagnostics)
{
// Rules owned by ResourceKitDiagnosticAnalyzer are reported by the analyzer; the source
// generator only raises diagnostics the analyzers cannot determine.
Expand All @@ -72,6 +72,6 @@ static bool ReportDiagnostics(SourceProductionContext sourceProductionContext, K
sourceProductionContext.ReportDiagnostic(diagnostic.ToDiagnostic());
}

return IsFatal;
return isFatal;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CancellationToken cancellationToken
var harnessCompilation = (await GenerateAsync(sources, cancellationToken)).CompilationResult.Compilation;

var parseOptions = (CSharpParseOptions)harnessCompilation.SyntaxTrees.First().Options;
const string Usings =
const string usings =
"using Purview.Aspire.ResourceKit;\n"
+ "using Aspire.Hosting.ApplicationModel;\n"
+ "using Aspire.Hosting;\n"
Expand All @@ -56,7 +56,7 @@ CancellationToken cancellationToken
+ "using Microsoft.Extensions.Configuration;\n";
var userTrees = sources
.Select(
(source, index) => CSharpSyntaxTree.ParseText(Usings + source, parseOptions, path: $"Source{index}.cs")
(source, index) => CSharpSyntaxTree.ParseText(usings + source, parseOptions, path: $"Source{index}.cs")
)
.ToArray();
var cleanCompilation = CSharpCompilation.Create(
Expand Down
Loading