Skip to content

Commit ba564c7

Browse files
committed
Converted to use Datacute.IncrementalGeneratorExtensions and Datacute.AdditionalTextConstantGenerator
1 parent ed817f3 commit ba564c7

File tree

31 files changed

+400
-951
lines changed

31 files changed

+400
-951
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,36 @@ jobs:
3535
with:
3636
dotnet-version: '8.0.x'
3737

38+
- name: Get tag for current commit
39+
id: get_tag
40+
# Check for tags when triggered by main branch push (with tag) or direct tag push
41+
# Can't use github.ref_name because it's "main" when pushing branch+tag together
42+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
43+
uses: olegtarasov/[email protected]
44+
45+
- name: Set Version Profile
46+
run: |
47+
if [[ "${{ steps.get_tag.outputs.tag }}" != "" ]]; then
48+
echo "VERSION_PROFILE=release" >> $GITHUB_ENV
49+
else
50+
echo "VERSION_PROFILE=ci" >> $GITHUB_ENV
51+
fi
52+
3853
- name: Restore dependencies
3954
run: dotnet restore $SOLUTION
4055

4156
- name: Build
42-
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore
57+
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore -p:GeneratePackageOnBuild=false -p:VersionProfile=${{ env.VERSION_PROFILE }}
4358

4459
- name: Run tests
45-
run: dotnet test --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal
60+
run: dotnet test --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal -p:VersionProfile=${{ env.VERSION_PROFILE }}
4661

4762
- name: Pack NuGet packages
4863
run: |
49-
dotnet pack $SOLUTION --configuration $BUILD_CONFIG --no-build --output ./artifacts
64+
dotnet pack $SOLUTION --configuration $BUILD_CONFIG --no-build --output ./artifacts -p:VersionProfile=${{ env.VERSION_PROFILE }}
5065
echo "=== Packages created ==="
5166
ls -la ./artifacts/
5267
53-
- name: Get tag for current commit
54-
id: get_tag
55-
# Check for tags when triggered by main branch push (with tag) or direct tag push
56-
# Can't use github.ref_name because it's "main" when pushing branch+tag together
57-
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
58-
uses: olegtarasov/[email protected]
59-
6068
- name: Extract release notes from CHANGELOG.md
6169
if: steps.get_tag.outputs.tag != ''
6270
id: extract_notes

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
- name: Restore, Build, and Pack
2222
run: |
2323
dotnet restore *.sln
24-
dotnet build *.sln --configuration Release --no-restore
25-
dotnet pack *.sln --configuration Release --no-build --output ./artifacts
24+
dotnet build *.sln --configuration Release --no-restore -p:ContinuousIntegrationBuild=true -p:GeneratePackageOnBuild=false -p:VersionProfile=release
25+
dotnet pack *.sln --configuration Release --no-build --output ./artifacts -p:ContinuousIntegrationBuild=true -p:VersionProfile=release
2626
2727
- name: Publish to NuGet
2828
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Copyright>Copyright © Stephen Denne 2024, 2025</Copyright>
88
<Company>Datacute</Company>
99
<PackageProjectUrl>https://github.com/datacute/EmbeddedResourcePropertyGenerator</PackageProjectUrl>
10-
<PackageReleaseNotes>See full release notes and changelog: $(PackageProjectUrl)/blob/main/CHANGELOG.md</PackageReleaseNotes>
10+
<PackageReleaseNotes>See full release notes and changelog: $(PackageProjectUrl)/blob/main/CHANGELOG.md</PackageReleaseNotes>
1111
<CheckEolTargetFramework>false</CheckEolTargetFramework>
1212
</PropertyGroup>
1313

EmbeddedResourceProperty.sln

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1919
Pipelines.md = Pipelines.md
2020
EndProjectSection
2121
EndProject
22-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmbeddedResourcePropertyGenerator.Attributes", "EmbeddedResourcePropertyGenerator.Attributes\EmbeddedResourcePropertyGenerator.Attributes.csproj", "{73A7F255-8275-41A3-8A2A-E70FE85DD0B5}"
23-
EndProject
2422
Global
2523
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2624
Debug|Any CPU = Debug|Any CPU
@@ -39,10 +37,6 @@ Global
3937
{5B687AED-BC94-489C-87EF-46E9C859BA74}.Debug|Any CPU.Build.0 = Debug|Any CPU
4038
{5B687AED-BC94-489C-87EF-46E9C859BA74}.Release|Any CPU.ActiveCfg = Release|Any CPU
4139
{5B687AED-BC94-489C-87EF-46E9C859BA74}.Release|Any CPU.Build.0 = Release|Any CPU
42-
{73A7F255-8275-41A3-8A2A-E70FE85DD0B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43-
{73A7F255-8275-41A3-8A2A-E70FE85DD0B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
44-
{73A7F255-8275-41A3-8A2A-E70FE85DD0B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
45-
{73A7F255-8275-41A3-8A2A-E70FE85DD0B5}.Release|Any CPU.Build.0 = Release|Any CPU
4640
EndGlobalSection
4741
GlobalSection(SolutionProperties) = preSolution
4842
HideSolutionNode = FALSE

EmbeddedResourcePropertyExample/EmbeddedResourcePropertyExample.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<ProjectReference Include="..\EmbeddedResourcePropertyGenerator.Attributes\EmbeddedResourcePropertyGenerator.Attributes.csproj" />
1716
<ProjectReference Include="..\EmbeddedResourcePropertyGenerator\EmbeddedResourcePropertyGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
1817
</ItemGroup>
1918

EmbeddedResourcePropertyGenerator.Attributes/EmbeddedResourcePropertyGenerator.Attributes.csproj

Lines changed: 0 additions & 17 deletions
This file was deleted.

EmbeddedResourcePropertyGenerator.Tests/EmbeddedResourcePropertyGenerator.Tests.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" />
12+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
1313
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
1414
<PackageReference Include="Shouldly" Version="4.3.0" />
1515
<PackageReference Include="Verify.SourceGenerators" Version="2.5.0" />
@@ -26,7 +26,6 @@
2626
</ItemGroup>
2727

2828
<ItemGroup>
29-
<ProjectReference Include="..\EmbeddedResourcePropertyGenerator.Attributes\EmbeddedResourcePropertyGenerator.Attributes.csproj" />
3029
<ProjectReference Include="..\EmbeddedResourcePropertyGenerator\EmbeddedResourcePropertyGenerator.csproj" />
3130
</ItemGroup>
3231

EmbeddedResourcePropertyGenerator.Tests/GeneratorSnapshotTests.AlternateFolderSelectedCorrectly#Query.g.verified.cs renamed to EmbeddedResourcePropertyGenerator.Tests/GeneratorSnapshotTests.AlternateFolderSelectedCorrectly#Query.EmbeddedResourceProperties.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//HintName: Query.g.cs
1+
//HintName: Query.EmbeddedResourceProperties.g.cs
22
//------------------------------------------------------------------------------
33
// <auto-generated>
44
// This code was generated by the Datacute.EmbeddedResourcePropertyGenerator.

EmbeddedResourcePropertyGenerator.Tests/GeneratorSnapshotTests.GeneratesEmbeddedResourcePropertiesCorrectly#Queries.g.verified.cs renamed to EmbeddedResourcePropertyGenerator.Tests/GeneratorSnapshotTests.GeneratesEmbeddedResourcePropertiesCorrectly#Queries.EmbeddedResourceProperties.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//HintName: Queries.g.cs
1+
//HintName: Queries.EmbeddedResourceProperties.g.cs
22
//------------------------------------------------------------------------------
33
// <auto-generated>
44
// This code was generated by the Datacute.EmbeddedResourcePropertyGenerator.

EmbeddedResourcePropertyGenerator.Tests/GeneratorSnapshotTests.GeneratesEmbeddedResourcePropertiesForInnerAndGenericClasses#OuterClass_T_.InnerClass.g.verified.cs renamed to EmbeddedResourcePropertyGenerator.Tests/GeneratorSnapshotTests.GeneratesEmbeddedResourcePropertiesForInnerAndGenericClasses#OuterClass_T.InnerClass.EmbeddedResourceProperties.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//HintName: OuterClass_T_.InnerClass.g.cs
1+
//HintName: OuterClass_T.InnerClass.EmbeddedResourceProperties.g.cs
22
//------------------------------------------------------------------------------
33
// <auto-generated>
44
// This code was generated by the Datacute.EmbeddedResourcePropertyGenerator.

0 commit comments

Comments
 (0)