Skip to content

Commit

Permalink
Merge pull request #79 from nenoNaninu/tapper_v1.8.0
Browse files Browse the repository at this point in the history
update Tapper v1.8.0
  • Loading branch information
nenoNaninu authored Feb 1, 2023
2 parents 10008cc + b4f11c2 commit f4ad01e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Tapper.Attributes" Version="1.7.1" />
<PackageReference Include="Tapper.Attributes" Version="1.8.0" />
<PackageReference Include="TypedSignalR.Client.Attributes" Version="1.1.0" />
</ItemGroup>
</Project>
13 changes: 9 additions & 4 deletions src/TypedSignalR.Client.TypeScript.Generator/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public async Task Transpile(
[Option("n", "camelCase (default) / PascalCase / none (The name in C# is used as it is.)")]
NamingStyle namingStyle = NamingStyle.CamelCase,
[Option("en", "value (default) / nameString / nameCamel / NamePascal / union / unionCamel / UnionPascal")]
EnumStyle @enum = EnumStyle.Value)
EnumStyle @enum = EnumStyle.Value,
[Option("attr", "The flag whether attributes such as JsonPropertyName should affect transpilation.")]
bool attribute = true)
{
_logger.Log(LogLevel.Information, "Start loading the csproj of {path}.", Path.GetFullPath(project));

Expand All @@ -48,7 +50,7 @@ public async Task Transpile(
{
var compilation = await this.CreateCompilationAsync(project);

await TranspileCore(compilation, output, newLine, 4, assemblies, serializer, namingStyle, @enum);
await TranspileCore(compilation, output, newLine, 4, assemblies, serializer, namingStyle, @enum, attribute);

_logger.Log(LogLevel.Information, "======== Transpilation is completed. ========");
_logger.Log(LogLevel.Information, "Please check the output folder: {output}", output);
Expand Down Expand Up @@ -86,7 +88,8 @@ private async Task TranspileCore(
bool referencedAssembliesTranspilation,
SerializerOption serializerOption,
NamingStyle namingStyle,
EnumStyle enumStyle)
EnumStyle enumStyle,
bool enableAttributeReference)
{
var typeMapperProvider = new DefaultTypeMapperProvider(compilation, referencedAssembliesTranspilation);

Expand All @@ -96,13 +99,15 @@ private async Task TranspileCore(
typeMapperProvider.AddTypeMapper(new ChannelReaderTypeMapper(compilation));

var options = new TranspilationOptions(
compilation,
typeMapperProvider,
serializerOption,
namingStyle,
enumStyle,
newLine,
indent,
referencedAssembliesTranspilation
referencedAssembliesTranspilation,
enableAttributeReference
);

// Tapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Tapper" Version="1.7.1" />
<PackageReference Include="Tapper" Version="1.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit f4ad01e

Please sign in to comment.