mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 14:51:41 +01:00
enabled SourceLink for generator assembly
added documentation
This commit is contained in:
parent
5085a1d017
commit
62f57fbdf6
1
.gitignore
vendored
1
.gitignore
vendored
@ -339,3 +339,4 @@ ASALocalRun/
|
|||||||
|
|
||||||
# Coverage results folder
|
# Coverage results folder
|
||||||
coverage/
|
coverage/
|
||||||
|
*.snupkg
|
||||||
|
@ -3,14 +3,19 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netstandard2.0;netcoreapp2.1</TargetFrameworks>
|
<TargetFrameworks>netstandard2.0;netcoreapp2.1</TargetFrameworks>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.2.1" />
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.2.1" />
|
||||||
|
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Capnp.Net.Runtime\Capnp.Net.Runtime.csproj" />
|
<ProjectReference Include="..\Capnp.Net.Runtime\Capnp.Net.Runtime.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,42 +1,189 @@
|
|||||||
namespace CapnpC.CSharp.Generator.CodeGen
|
namespace CapnpC.CSharp.Generator.CodeGen
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provides options properties defining how the generated code will look like.
|
||||||
|
/// </summary>
|
||||||
public class GeneratorOptions
|
public class GeneratorOptions
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Default namespace if .capnp file does not specify any.
|
||||||
|
/// </summary>
|
||||||
public string TopNamespaceName { get; set; } = "CapnpGen";
|
public string TopNamespaceName { get; set; } = "CapnpGen";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Type name of generated struct reader
|
||||||
|
/// </summary>
|
||||||
public string ReaderStructName { get; set; } = "READER";
|
public string ReaderStructName { get; set; } = "READER";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Type name of generated struct writer
|
||||||
|
/// </summary>
|
||||||
public string WriterStructName { get; set; } = "WRITER";
|
public string WriterStructName { get; set; } = "WRITER";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parameter name when struct reader is passed as argument
|
||||||
|
/// </summary>
|
||||||
public string ReaderParameterName { get; set; } = "reader";
|
public string ReaderParameterName { get; set; } = "reader";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parameter name when struct writer is passed as argument
|
||||||
|
/// </summary>
|
||||||
public string WriterParameterName { get; set; } = "writer";
|
public string WriterParameterName { get; set; } = "writer";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Struct reader creation method name
|
||||||
|
/// </summary>
|
||||||
public string ReaderCreateMethodName { get; set; } = "create";
|
public string ReaderCreateMethodName { get; set; } = "create";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of struct reader's underlying DeserializerState field
|
||||||
|
/// </summary>
|
||||||
public string ReaderContextFieldName { get; set; } = "ctx";
|
public string ReaderContextFieldName { get; set; } = "ctx";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of struct writer's underlying SerializerState field
|
||||||
|
/// </summary>
|
||||||
public string ContextParameterName { get; set; } = "ctx";
|
public string ContextParameterName { get; set; } = "ctx";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of group reader's underlying DeserializerState field
|
||||||
|
/// </summary>
|
||||||
public string GroupReaderContextArgName { get; set; } = "ctx";
|
public string GroupReaderContextArgName { get; set; } = "ctx";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of union discriminator enum
|
||||||
|
/// </summary>
|
||||||
public string UnionDiscriminatorEnumName { get; set; } = "WHICH";
|
public string UnionDiscriminatorEnumName { get; set; } = "WHICH";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of union discriminator property
|
||||||
|
/// </summary>
|
||||||
public string UnionDiscriminatorPropName { get; set; } = "which";
|
public string UnionDiscriminatorPropName { get; set; } = "which";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of private union dicriminator field
|
||||||
|
/// </summary>
|
||||||
public string UnionDiscriminatorFieldName { get; set; } = "_which";
|
public string UnionDiscriminatorFieldName { get; set; } = "_which";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Literal name for undetermined union discriminators
|
||||||
|
/// </summary>
|
||||||
public string UnionDiscriminatorUndefinedName { get; set; } = "undefined";
|
public string UnionDiscriminatorUndefinedName { get; set; } = "undefined";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of union content field
|
||||||
|
/// </summary>
|
||||||
public string UnionContentFieldName { get; set; } = "_content";
|
public string UnionContentFieldName { get; set; } = "_content";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Domain class method name for serializing its contents to the writer class
|
||||||
|
/// </summary>
|
||||||
public string SerializeMethodName { get; set; } = "serialize";
|
public string SerializeMethodName { get; set; } = "serialize";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Domain class method name for applying default values
|
||||||
|
/// </summary>
|
||||||
public string ApplyDefaultsMethodName { get; set; } = "applyDefaults";
|
public string ApplyDefaultsMethodName { get; set; } = "applyDefaults";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default input-arguments parameter name for interface methods
|
||||||
|
/// </summary>
|
||||||
public string AnonymousParameterName { get; set; } = "arg_";
|
public string AnonymousParameterName { get; set; } = "arg_";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parameter name for passing a CancellationToken to interface methods
|
||||||
|
/// </summary>
|
||||||
public string CancellationTokenParameterName { get; set; } = "cancellationToken_";
|
public string CancellationTokenParameterName { get; set; } = "cancellationToken_";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Local name for usage in generated proxy/skeleton code.
|
||||||
|
/// </summary>
|
||||||
public string ParamsLocalName { get; set; } = "in_";
|
public string ParamsLocalName { get; set; } = "in_";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Local name for usage in generated proxy/skeleton code.
|
||||||
|
/// </summary>
|
||||||
public string DeserializerLocalName { get; set; } = "d_";
|
public string DeserializerLocalName { get; set; } = "d_";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Local name for usage in generated proxy/skeleton code.
|
||||||
|
/// </summary>
|
||||||
public string SerializerLocalName { get; set; } = "s_";
|
public string SerializerLocalName { get; set; } = "s_";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Local name for usage in generated proxy/skeleton code.
|
||||||
|
/// </summary>
|
||||||
public string ResultLocalName { get; set; } = "r_";
|
public string ResultLocalName { get; set; } = "r_";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pattern for generating method input struct name
|
||||||
|
/// </summary>
|
||||||
public string ParamsStructFormat { get; set; } = "Params_{0}";
|
public string ParamsStructFormat { get; set; } = "Params_{0}";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pattern for generating method output struct name
|
||||||
|
/// </summary>
|
||||||
public string ResultStructFormat { get; set; } = "Result_{0}";
|
public string ResultStructFormat { get; set; } = "Result_{0}";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Renaming pattern when a generated property would happen to have the same name like its surrounding type
|
||||||
|
/// (which is illegal in C#)
|
||||||
|
/// </summary>
|
||||||
public string PropertyNamedLikeTypeRenameFormat { get; set; } = "The{0}";
|
public string PropertyNamedLikeTypeRenameFormat { get; set; } = "The{0}";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pattern for generating generic type parameter names
|
||||||
|
/// </summary>
|
||||||
public string GenericTypeParameterFormat { get; set; } = "T{0}";
|
public string GenericTypeParameterFormat { get; set; } = "T{0}";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pattern for generating pipelining-related support classes
|
||||||
|
/// </summary>
|
||||||
public string PipeliningExtensionsClassFormat { get; set; } = "PipeliningSupportExtensions_{0}";
|
public string PipeliningExtensionsClassFormat { get; set; } = "PipeliningSupportExtensions_{0}";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pattern for generating proxy class name
|
||||||
|
/// </summary>
|
||||||
public string ProxyClassFormat { get; set; } = "{0}_Proxy";
|
public string ProxyClassFormat { get; set; } = "{0}_Proxy";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pattern for generating skeleton class name
|
||||||
|
/// </summary>
|
||||||
public string SkeletonClassFormat { get; set; } = "{0}_Skeleton";
|
public string SkeletonClassFormat { get; set; } = "{0}_Skeleton";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pattern for generating member access path objects used in pipelining-related support classes
|
||||||
|
/// </summary>
|
||||||
public string MemberAccessPathNameFormat { get; set; } = "Path_{0}_{1}_{2}_{3}";
|
public string MemberAccessPathNameFormat { get; set; } = "Path_{0}_{1}_{2}_{3}";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parameter name for passing a Task
|
||||||
|
/// </summary>
|
||||||
public string TaskParameterName { get; set; } = "task";
|
public string TaskParameterName { get; set; } = "task";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Field name for type ID
|
||||||
|
/// </summary>
|
||||||
public string TypeIdFieldName { get; set; } = "typeId";
|
public string TypeIdFieldName { get; set; } = "typeId";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Local method name used in generated code.
|
||||||
|
/// </summary>
|
||||||
public string AwaitProxyName { get; set; } = "AwaitProxy";
|
public string AwaitProxyName { get; set; } = "AwaitProxy";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether to generate nullable reference types if not explicitly specified
|
||||||
|
/// </summary>
|
||||||
public bool NullableEnableDefault { get; set; } = false;
|
public bool NullableEnableDefault { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Generator tool name for GeneratedCodeAttribute
|
||||||
|
/// </summary>
|
||||||
public string GeneratorToolName { get; set; } = "capnpc-csharp";
|
public string GeneratorToolName { get; set; } = "capnpc-csharp";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Generator tool version for GeneratedCodeAttribute
|
||||||
|
/// </summary>
|
||||||
public string GeneratorToolVersion = ThisAssembly.AssemblyVersion;
|
public string GeneratorToolVersion = ThisAssembly.AssemblyVersion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ using System.Text;
|
|||||||
|
|
||||||
namespace CapnpC.CSharp.Generator.Model
|
namespace CapnpC.CSharp.Generator.Model
|
||||||
{
|
{
|
||||||
public class IdentifierRenamer
|
class IdentifierRenamer
|
||||||
{
|
{
|
||||||
public static bool IsAnyKeyword(string str)
|
public static bool IsAnyKeyword(string str)
|
||||||
{
|
{
|
||||||
|
@ -741,7 +741,7 @@ namespace CapnpC.CSharp.Generator.Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum NodeKind
|
enum NodeKind
|
||||||
{
|
{
|
||||||
Unknown,
|
Unknown,
|
||||||
Annotation,
|
Annotation,
|
||||||
@ -753,7 +753,7 @@ namespace CapnpC.CSharp.Generator.Model
|
|||||||
Group
|
Group
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SchemaExtensions
|
static class SchemaExtensions
|
||||||
{
|
{
|
||||||
public static string StrId(this Schema.Node.READER node)
|
public static string StrId(this Schema.Node.READER node)
|
||||||
=> $"0x{node.Id:X}";
|
=> $"0x{node.Id:X}";
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<NoPackageAnalysis>true</NoPackageAnalysis>
|
<NoPackageAnalysis>true</NoPackageAnalysis>
|
||||||
|
|
||||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
|
||||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||||
|
|
||||||
<NuspecFile>$(MSBuildThisFileDirectory)CapnpC.CSharp.MsBuild.Generation.nuspec</NuspecFile>
|
<NuspecFile>$(MSBuildThisFileDirectory)CapnpC.CSharp.MsBuild.Generation.nuspec</NuspecFile>
|
||||||
@ -42,6 +41,7 @@
|
|||||||
<PackageReference Update="Microsoft.VisualStudio.Threading" Version="16.3.52" />
|
<PackageReference Update="Microsoft.VisualStudio.Threading" Version="16.3.52" />
|
||||||
<PackageReference Update="Microsoft.Xaml" Version="4.0.0.1" />
|
<PackageReference Update="Microsoft.Xaml" Version="4.0.0.1" />
|
||||||
<PackageReference Update="System.Collections.Immutable" Version="1.5.0" />
|
<PackageReference Update="System.Collections.Immutable" Version="1.5.0" />
|
||||||
|
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -17,11 +17,16 @@
|
|||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<PackageTags>capnp capnpc RPC serialization cerealization</PackageTags>
|
<PackageTags>capnp capnpc RPC serialization cerealization</PackageTags>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.2.1" />
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.2.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
|
||||||
|
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user