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
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: dotnet test JsonSubTypes.Text.Json.Tests/JsonSubTypes.Text.Json.Tests.csproj -c Release

- name: Test Aot (net8 + net10)
run: dotnet test JsonSubTypes.Aot.Tests/JsonSubTypes.Aot.Tests.csproj -c Release
run: dotnet test JsonSubTypes.Text.Json.Aot.Tests/JsonSubTypes.Text.Json.Aot.Tests.csproj -c Release

# The Newtonsoft tests run on net10 too (the library targets netstandard1.3/2.0),
# which lets coverlet measure the JsonSubTypes package on Linux.
Expand All @@ -42,10 +42,10 @@ jobs:
run: dotnet test JsonSubTypes.Text.Json.Tests/JsonSubTypes.Text.Json.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/textjson

- name: Test Aot with coverage (net10)
run: dotnet test JsonSubTypes.Aot.Tests/JsonSubTypes.Aot.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/aot
run: dotnet test JsonSubTypes.Text.Json.Aot.Tests/JsonSubTypes.Text.Json.Aot.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/aot

- name: Test Aot generator with coverage (net10)
run: dotnet test JsonSubTypes.Aot.Generator.Tests/JsonSubTypes.Aot.Generator.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/generator
run: dotnet test JsonSubTypes.Text.Json.Aot.Generator.Tests/JsonSubTypes.Text.Json.Aot.Generator.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/generator

- name: Install gpg (required by codecov-action v5)
run: sudo apt-get install -y gpg
Expand All @@ -67,16 +67,16 @@ jobs:
# building it catches generated-code conflicts that unit tests cannot (e.g. a
# top-level `_` variable colliding with `out _` emitted by the generator).
- name: Build Aot sample (top-level statements consumer)
run: dotnet build JsonSubTypes.Aot.Sample/JsonSubTypes.Aot.Sample.csproj -c Release -f net8.0
run: dotnet build JsonSubTypes.Text.Json.Aot.Sample/JsonSubTypes.Text.Json.Aot.Sample.csproj -c Release -f net8.0

# Native AOT end-to-end check: publish the sample as a native binary and run
# it. This is the only check that proves the generated converters work in a
# trimmed/AOT binary, not just under the JIT.
- name: Publish Aot sample as native binary
run: dotnet publish JsonSubTypes.Aot.Sample/JsonSubTypes.Aot.Sample.csproj -c Release -f net8.0 -r linux-x64 -p:StripSymbols=true
run: dotnet publish JsonSubTypes.Text.Json.Aot.Sample/JsonSubTypes.Text.Json.Aot.Sample.csproj -c Release -f net8.0 -r linux-x64 -p:StripSymbols=true

- name: Run the native Aot sample
run: ./JsonSubTypes.Aot.Sample/bin/Release/net8.0/linux-x64/publish/JsonSubTypes.Aot.Sample
run: ./JsonSubTypes.Text.Json.Aot.Sample/bin/Release/net8.0/linux-x64/publish/JsonSubTypes.Text.Json.Aot.Sample

framework:
# The Newtonsoft library targets net35/40/45/46/47 (.NET Framework), which runs
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
if [ "${{ github.event_name }}" = "pull_request" ]; then
pr_args="/d:sonar.pullrequest.key=$PR_KEY /d:sonar.pullrequest.branch=$PR_BRANCH /d:sonar.pullrequest.base=$PR_BASE"
fi
dotnet-sonarscanner begin /k:manuc66_JsonSubTypes /o:manuc66-github /d:sonar.token="$SONAR_TOKEN" /d:sonar.host.url=https://sonarcloud.io /d:sonar.cs.cobertura.reportsPaths=TestResults/**/coverage.cobertura.xml /d:sonar.exclusions=**/*Tests*/**/*,**/JsonSubTypes.Benchmarks/**/*,**/JsonSubTypes.Aot.Sample/**/*,**/JsonSubTypes.Aot.Generated/TestDomain.cs /d:sonar.cpd.exclusions=**/*.g.cs $pr_args
dotnet-sonarscanner begin /k:manuc66_JsonSubTypes /o:manuc66-github /d:sonar.token="$SONAR_TOKEN" /d:sonar.host.url=https://sonarcloud.io /d:sonar.cs.cobertura.reportsPaths=TestResults/**/coverage.cobertura.xml /d:sonar.exclusions=**/*Tests*/**/*,**/JsonSubTypes.Benchmarks/**/*,**/JsonSubTypes.Text.Json.Aot.Sample/**/*,**/JsonSubTypes.Text.Json.Aot.Generated/TestDomain.cs /d:sonar.cpd.exclusions=**/*.g.cs $pr_args

- name: Build for SonarCloud analysis
run: dotnet build JsonSubTypes.sln -c Release
Expand All @@ -149,8 +149,8 @@ jobs:
run: |
dotnet test JsonSubTypes.Tests/JsonSubTypes.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/newtonsoft
dotnet test JsonSubTypes.Text.Json.Tests/JsonSubTypes.Text.Json.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/textjson
dotnet test JsonSubTypes.Aot.Tests/JsonSubTypes.Aot.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/aot
dotnet test JsonSubTypes.Aot.Generator.Tests/JsonSubTypes.Aot.Generator.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/generator
dotnet test JsonSubTypes.Text.Json.Aot.Tests/JsonSubTypes.Text.Json.Aot.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/aot
dotnet test JsonSubTypes.Text.Json.Aot.Generator.Tests/JsonSubTypes.Text.Json.Aot.Generator.Tests.csproj -c Release -f net10.0 --collect:"XPlat Code Coverage" --results-directory TestResults/generator

- name: End SonarCloud analysis
run: dotnet-sonarscanner end /d:sonar.token="$SONAR_TOKEN"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
- name: Build + pack JsonSubTypes.Text.Json
run: dotnet build JsonSubTypes.Text.Json/JsonSubTypes.Text.Json.csproj -c Release

- name: Build + pack JsonSubTypes.Aot
run: dotnet build JsonSubTypes.Aot/JsonSubTypes.Aot.csproj -c Release
- name: Build + pack JsonSubTypes.Text.Json.Aot
run: dotnet build JsonSubTypes.Text.Json.Aot/JsonSubTypes.Text.Json.Aot.csproj -c Release

# Trusted publishing: exchange the GitHub OIDC token for a short-lived
# NuGet API key (no long-lived secret). Requires a trusted publishing
Expand Down Expand Up @@ -78,12 +78,12 @@ jobs:
dotnet nuget push "JsonSubTypes.Text.Json/bin/Release/*.nupkg" "JsonSubTypes.Text.Json/bin/Release/*.snupkg" --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
fi

- name: Publish JsonSubTypes.Aot
- name: Publish JsonSubTypes.Text.Json.Aot
run: |
id=jsonSubTypes.aot
version=$(dotnet msbuild JsonSubTypes.Aot/JsonSubTypes.Aot.csproj -getProperty:Version -p:Configuration=Release | tail -n 1)
version=$(dotnet msbuild JsonSubTypes.Text.Json.Aot/JsonSubTypes.Text.Json.Aot.csproj -getProperty:Version -p:Configuration=Release | tail -n 1)
if curl -sf -o /dev/null "https://api.nuget.org/v3-flatcontainer/$id/$version/$id.$version.nupkg"; then
echo "JsonSubTypes.Aot $version already on nuget.org, skipping"
echo "JsonSubTypes.Text.Json.Aot $version already on nuget.org, skipping"
else
dotnet nuget push "JsonSubTypes.Aot/bin/Release/*.nupkg" --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push "JsonSubTypes.Text.Json.Aot/bin/Release/*.nupkg" --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
fi
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### JsonSubTypes.Text.Json
#### Added
- New `JsonSubTypesAotConverterAttribute` opting a base type into the `JsonSubTypes.Aot` source generator.
- New `JsonSubTypesAotConverterAttribute` opting a base type into the `JsonSubTypes.Text.Json.Aot` source generator.

### JsonSubTypes.Aot
### JsonSubTypes.Text.Json.Aot
#### Added
- New package `JsonSubTypes.Aot` (1.0.0-rc.1): a Roslyn source generator emitting compiled subtype converters. Routing (property presence, fallback, enums, nested hierarchies, dynamic registration) is compiled, so it works in Native AOT / trimmed binaries without reflection.
- New package `JsonSubTypes.Text.Json.Aot` (1.0.0-rc.1): a Roslyn source generator emitting compiled subtype converters. Routing (property presence, fallback, enums, nested hierarchies, dynamic registration) is compiled, so it works in Native AOT / trimmed binaries without reflection.

## [1.0.0-rc.2] - 2026-08-10
### Changed
Expand Down

This file was deleted.

152 changes: 0 additions & 152 deletions JsonSubTypes.Aot.Generator.Tests/CommittedGeneratedConverterTests.cs

This file was deleted.

Loading
Loading