Skip to content

Commit

Permalink
Fixed generating class names from razor files containing dash ('-') c…
Browse files Browse the repository at this point in the history
…haracters
  • Loading branch information
yugabe committed Jul 7, 2023
1 parent 289d43a commit ea9b4fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/cd-nuget.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
on: { push: { tags: ["*"] } }
on: { push: { tags: ["v[0-9]+.[0-9]+.[0-9]+*"] } }

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- run: dotnet pack -c:Release -p:Version=${{ github.ref_name }} -p:RepositoryCommit=${{ github.sha }}
- env: { NUGET_API_KEY: "${{ secrets.NUGET_API_KEY }}" }
run: dotnet nuget push ./src/TypedRoutes/bin/Release/PodNet.Blazor.TypedRoutes.*.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json
- run: dotnet pack -c:Release -p:Version=$(echo ${{ github.ref_name }} | sed 's/^v//') -p:RepositoryCommit=${{ github.sha }}
- run: dotnet nuget push ./src/TypedRoutes/bin/Release/PodNet.Blazor.TypedRoutes.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
6 changes: 3 additions & 3 deletions src/TypedRoutes/PodNet.Blazor.TypedRoutes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<TargetFramework>netstandard2.0</TargetFramework>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<!-- Version is set via Git tagging triggering the build and supplying that tag to `dotnet pack -p:Version`. -->
<Version>0.0.0-unset</Version>
<Version Condition="('$(Version)' == '') And ('$(Configuration)' == 'Debug')">0.0.0-debug</Version>

<IsPackable>true</IsPackable>
<IncludeSymbols>false</IncludeSymbols>
<IncludeBuildOutput>false</IncludeBuildOutput>
<DevelopmentDependency>true</DevelopmentDependency>
<NoWarn>$(NoWarn);NU5128</NoWarn>

<PackageId>PodNet.Blazor.TypedRoutes</PackageId>
<Product>PodNet.Blazor.TypedRoutes</Product>
<PackageVersion>$(Version)</PackageVersion>
Expand All @@ -33,7 +33,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.6.0" PrivateAssets="all" />

<None Include="..\..\images\icon.png" Pack="true" PackagePath="" />
<None Include="..\..\README.md" Pack="true" PackagePath="" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/TypedRoutes/TypedRoutesGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static IEnumerable<RouteInfo> GetRoutesFromPageDirectives((AdditionalText Additi
@namespace = input.Build.RootNamespace;
}

var @className = Path.GetFileNameWithoutExtension(input.AdditionalText.Path);
var @className = Path.GetFileNameWithoutExtension(input.AdditionalText.Path).Replace('-', '_');
if (typeparam != null)
@className += $"<{typeparam}>";

Expand Down

0 comments on commit ea9b4fe

Please sign in to comment.