Releases: smdn/Smdn.Reflection.ReverseGenerating
Releases · smdn/Smdn.Reflection.ReverseGenerating
Smdn.Reflection.ReverseGenerating version 1.1.2
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-19 update assembly version
- 2022-07-19 bump Smdn.Fundamental.Reflection up to 3.3.1
- 2022-07-19 add GeneratorOptions.MemberDeclaration.WithEnumTypeName and refer it instead of WithDeclaringTypeName if member's declaring type is enum
- 2022-07-19 add support for formatting ref properties
- 2022-07-19 add support for formatting parameter type of by-ref pointers
- 2022-07-17 make the workaround for nullability of by-ref types configurable with DefineConstants
- 2022-07-17 add workaround for by-ref parameter types
- 2022-07-16 refactor
- 2022-07-16 add support for formatting Nullable<GenericValueType<...>> with nullability annotations
- 2022-07-14 bump Smdn.MSBuild.DefineConstants.NETSdkApi up to 1.3.4
API changes
API changes in this release:
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
index 071d776..7044626 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
@@ -1,122 +1,123 @@
-// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.1)
+// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.2)
// Name: Smdn.Reflection.ReverseGenerating
-// AssemblyVersion: 1.1.1.0
-// InformationalVersion: 1.1.1+9c1ed7379f1b7fe2562a51f0283b02332d84584f
+// AssemblyVersion: 1.1.2.0
+// InformationalVersion: 1.1.2+775287448dc58ab1c9fb7f0618d8c8bb6de9e775
// TargetFramework: .NETFramework,Version=v4.5
// Configuration: Release
#nullable enable annotations
using System;
using System.Collections.Generic;
using System.Reflection;
using Smdn.Reflection;
using Smdn.Reflection.ReverseGenerating;
namespace Smdn.Reflection.ReverseGenerating {
public delegate bool AttributeTypeFilter(Type type, ICustomAttributeProvider attributeProvider);
public enum AttributeSectionFormat : int {
Discrete = 1,
List = 0,
}
public enum MethodBodyOption : int {
EmptyImplementation = 1,
None = 0,
ThrowNotImplementedException = 2,
ThrowNull = 3,
}
public static class CSharpFormatter {
public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
public static string FormatAccessibility(Accessibility accessibility) {}
public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
public static string FormatTypeName(this EventInfo ev, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
public static string FormatTypeName(this FieldInfo f, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
public static string FormatTypeName(this ParameterInfo p, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
public static string FormatTypeName(this PropertyInfo p, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
public static string FormatTypeName(this Type t, ICustomAttributeProvider? attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
public static string FormatValueDeclaration(object? val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
public static bool IsLanguagePrimitiveType(Type t, out string primitiveTypeName) {}
public static IEnumerable<string> ToNamespaceList(Type t) {}
}
public static class Generator {
public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
public static string? GenerateMemberDeclaration(MemberInfo member, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
public static string GenerateTypeDeclaration(Type t, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
}
public class GeneratorOptions : ICloneable {
public class AttributeDeclarationOptions {
public AttributeDeclarationOptions() {}
public AttributeSectionFormat AccessorFormat { get; set; }
public AttributeSectionFormat AccessorParameterFormat { get; set; }
public AttributeSectionFormat BackingFieldFormat { get; set; }
public AttributeSectionFormat DelegateParameterFormat { get; set; }
public AttributeSectionFormat GenericParameterFormat { get; set; }
public AttributeSectionFormat MethodParameterFormat { get; set; }
public bool OmitAttributeSuffix { get; set; }
public AttributeTypeFilter? TypeFilter { get; set; }
public bool WithDeclaringTypeName { get; set; }
public bool WithNamedArguments { get; set; }
public bool WithNamespace { get; set; }
}
public class MemberDeclarationOptions {
public MemberDeclarationOptions() {}
public MethodBodyOption AccessorBody { get; set; }
public MethodBodyOption MethodBody { get; set; }
public bool OmitEndOfStatement { get; set; }
public bool WithAccessibility { get; set; }
public bool WithDeclaringTypeName { get; set; }
+ public bool WithEnumTypeName { get; set; }
public bool WithNamespace { get; set; }
}
public class ParameterDeclarationOptions {
public ParameterDeclarationOptions() {}
public bool WithDeclaringTypeName { get; set; }
public bool WithNamespace { get; set; }
}
public class TypeDeclarationOptions {
public TypeDeclarationOptions() {}
public bool OmitEndOfStatement { get; set; }
public bool WithAccessibility { get; set; }
public bool WithDeclaringTypeName { get; set; }
public bool WithNamespace { get; set; }
}
public class ValueDeclarationOptions {
public ValueDeclarationOptions() {}
public bool UseDefaultLiteral { get; set; }
public bool WithDeclaringTypeName { get; set; }
public bool WithNamespace { get; set; }
}
public GeneratorOptions() {}
public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; init; }
public bool IgnorePrivateOrAssembly { get; set; }
public string? Indent { get; set; }
public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; init; }
public GeneratorOptions.ParameterDeclarationOptions ParameterDeclaration { get; init; }
public bool TranslateLanguagePrimitiveTypeDeclaration { get; set; }
public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; init; }
public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; init; }
public virtual GeneratorOptions Clone() {}
object ICloneable.Clone() {}
}
}
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs
index d725878..c5584e3 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection....
Smdn.Reflection.ReverseGenerating.ListApi version 1.1.0
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-12 revert updating assembly version
- 2022-07-12 set APIListEnableGenerating false
- 2022-07-12 remove unused package reference
- 2022-07-12 fix typo
- 2022-07-12 update assembly version
- 2022-07-12 remove net5.0 from target frameworks
- 2022-07-12 bump Smdn.Reflection.ReverseGenerating.ListApi.Core up to 1.1.1
- 2022-07-12 add option '--generate-nullableanotations'
- 2022-07-12 enable nullability annotations
- 2022-07-09 update assembly version
- 2022-07-09 bump Smdn.Reflection.ReverseGenerating.ListApi.Core up to 1.1.0
- 2022-07-09 disable warning CA1848 'use the LoggerMessage delegates'
- 2022-07-09 fix warning CA2254
- 2022-07-09 make lambda static
- 2022-07-08 add setting NullabilityInfoContext to GeneratorOptions
- 2022-03-15 use Smdn.MSBuild.DefineConstants.NETSdkApi
- 2022-03-08 refactor
- 2022-03-08 rename property
- 2022-03-08 update package tags
- 2022-03-08 update assembly descriptions
- 2022-03-08 split property groups
- 2022-01-31 disable README.md auto-generation
Full changes
Full changes in this release:
diff --git a/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Build/MSBuildExePath.cs b/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Build/MSBuildExePath.cs
index 89c74a1..1935148 100644
--- a/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Build/MSBuildExePath.cs
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Build/MSBuildExePath.cs
@@ -1,5 +1,6 @@
// SPDX-FileCopyrightText: 2021 smdn <smdn@smdn.jp>
// SPDX-License-Identifier: MIT
+#pragma warning disable CA1848
#if FEATURE_BUILD_PROJ
using System;
@@ -16,7 +17,7 @@ public static class MSBuildExePath {
private static string JoinPath(string path1, string path2)
{
#pragma warning disable SA1114
-#if NETCOREAPP3_1_OR_GREATER || NET5_0_OR_GREATER
+#if SYSTEM_IO_PATH_JOIN
return Path.Join(
#else
return Path.Combine(
@@ -60,7 +61,7 @@ public static class MSBuildExePath {
RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled
);
- private static string GetSdkBasePath(out string sdkVersion)
+ private static string? GetSdkBasePath(out string? sdkVersion)
{
sdkVersion = default;
@@ -77,7 +78,7 @@ public static class MSBuildExePath {
return null;
}
- private static string GetMSBuildExePath(out string sdkVersion)
+ private static string GetMSBuildExePath(out string? sdkVersion)
{
#if true
sdkVersion = default;
@@ -133,14 +134,14 @@ public static class MSBuildExePath {
#endif
}
- public static void EnsureSetEnvVar(ILogger logger = null)
+ public static void EnsureSetEnvVar(ILogger? logger = null)
{
const string MSBUILD_EXE_PATH = nameof(MSBUILD_EXE_PATH);
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable(MSBUILD_EXE_PATH)))
Environment.SetEnvironmentVariable(MSBUILD_EXE_PATH, GetMSBuildExePath(out _));
- logger?.LogDebug($"{MSBUILD_EXE_PATH}: {Environment.GetEnvironmentVariable(MSBUILD_EXE_PATH)}");
+ logger?.LogDebug("{MSBUILD_EXE_PATH}: {ENVVAR_MSBUILD_EXE_PATH}", MSBUILD_EXE_PATH, Environment.GetEnvironmentVariable(MSBUILD_EXE_PATH));
}
}
#endif
diff --git a/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Build/ProjectBuilder.cs b/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Build/ProjectBuilder.cs
index 2ea3231..995132e 100644
--- a/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Build/ProjectBuilder.cs
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Build/ProjectBuilder.cs
@@ -1,5 +1,6 @@
// SPDX-FileCopyrightText: 2021 smdn <smdn@smdn.jp>
// SPDX-License-Identifier: MIT
+#pragma warning disable CA1848
#if FEATURE_BUILD_PROJ
using System;
@@ -20,18 +21,18 @@ public static class ProjectBuilder {
public class Options {
public const string DefaultConfiguration = "Debug";
- public string Configuration { get; init; } = DefaultConfiguration;
- public string TargetFramework { get; init; } = null;
- // public string OS { get; init; }
- public string RuntimeIdentifier { get; init; } = null;
- public string[] TargetsToBuild { get; init; } = new[] { "Restore", "Build" };
+ public string? Configuration { get; init; } = DefaultConfiguration;
+ public string? TargetFramework { get; init; } = null;
+ // public string? OS { get; init; }
+ public string? RuntimeIdentifier { get; init; } = null;
+ public string[]? TargetsToBuild { get; init; } = new[] { "Restore", "Build" };
public LoggerVerbosity LoggerVerbosity { get; init; } = LoggerVerbosity.Minimal;
}
public static IEnumerable<FileInfo> Build(
FileInfo projectFile,
- Options options = null,
- Microsoft.Extensions.Logging.ILogger logger = null
+ Options? options = null,
+ Microsoft.Extensions.Logging.ILogger? logger = null
)
{
if (projectFile is null)
@@ -53,14 +54,14 @@ public static class ProjectBuilder {
globalProps["RuntimeIdentifier"] = options.RuntimeIdentifier;
logger?.LogDebug("Build requested");
- logger?.LogDebug($" project: {projectFile}");
+ logger?.LogDebug(" project: {ProjectFile}", projectFile);
- logger?.LogDebug($" targets: {string.Join(";", options.TargetsToBuild)}");
+ logger?.LogDebug(" targets: {Targets}", string.Join(";", options.TargetsToBuild ?? Array.Empty<string>()));
logger?.LogDebug(" global properties:");
foreach (var globalProp in globalProps) {
- logger?.LogDebug($" {globalProp.Key}: '{globalProp.Value}'");
+ logger?.LogDebug(" {GlobalPropKey}: '{GlobalPropValue}'", globalProp.Key, globalProp.Value);
}
var proj = new Project(
@@ -98,11 +99,11 @@ public static class ProjectBuilder {
// retrieve %(InnerOutput.Identity) / for in case of building with multiple target frameworks
var innerOutputFullPaths = result.ProjectStateAfterBuild
.Items
- .Where(item => item.ItemType == "InnerOutput")
- .Select(item => item.GetMetadataValue("Identity"));
+ .Where(static item => item.ItemType == "InnerOutput")
+ .Select(static item => item.GetMetadataValue("Identity"));
foreach (var innerOutputFullPath in innerOutputFullPaths) {
- logger?.LogDebug($"build output file: {innerOutputFullPath}");
+ logger?.LogDebug("build output file: {InnerOutputFullPath}", innerOutputFullPath);
yield return new FileInfo(innerOutputFullPath);
}
@@ -113,10 +114,10 @@ public static class ProjectBuilder {
var buildOutputFullPaths = buildTargetResult
.Items
- .Select(item => item.GetMetadata("Identity"));
+ .Select(static item => item.GetMetadata("Identity"));
foreach (var buildOutputFullPath in buildOutputFullPaths) {
- logger?.LogDebug($"build output file: {buildOutputFullPath}");
+ logger?.LogDebug("build...
Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks version 1.1.1
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-12 update assembly version
- 2022-07-12 bump Smdn.Reflection.ReverseGenerating.ListApi.Core up to 1.1.2
- 2022-07-12 expose more ApiListWriterOptions properties
API changes
API changes in this release:
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-net6.0.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-net6.0.apilist.cs
index 1714147..cf0e594 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-net6.0.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-net6.0.apilist.cs
@@ -1,26 +1,31 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.1.0)
+// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.1.1)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks
-// AssemblyVersion: 1.1.0.0
-// InformationalVersion: 1.1.0+64b5c72527e2ce0705ed5d9ed2328179311a4c94
+// AssemblyVersion: 1.1.1.0
+// InformationalVersion: 1.1.1+eb4f4a6e529b87faf061f136793c18a560867f3b
// TargetFramework: .NETCoreApp,Version=v6.0
// Configuration: Release
#nullable enable annotations
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks {
public class GenerateApiList : Task {
public GenerateApiList() {}
[Required]
public ITaskItem[]? Assemblies { get; set; }
+ public bool GenerateAttributeWithNamedArguments { get; set; }
public bool GenerateFullTypeName { get; set; }
+ public bool GenerateLanguagePrimitiveType { get; set; }
public string? GenerateMethodBody { get; set; }
+ public bool GenerateNullableAnnotations { get; set; }
public bool GenerateStaticMembersFirst { get; set; }
+ public bool GenerateTypeNameWithDeclaringTypeName { get; set; }
+ public bool GenerateValueWithDefaultLiteral { get; set; }
[Output]
public ITaskItem[]? GeneratedFiles { get; }
public override bool Execute() {}
}
}
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-netcoreapp3.1.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-netcoreapp3.1.apilist.cs
index e56e8da..65b4fcc 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-netcoreapp3.1.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-netcoreapp3.1.apilist.cs
@@ -1,26 +1,31 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.1.0)
+// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.1.1)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks
-// AssemblyVersion: 1.1.0.0
-// InformationalVersion: 1.1.0+64b5c72527e2ce0705ed5d9ed2328179311a4c94
+// AssemblyVersion: 1.1.1.0
+// InformationalVersion: 1.1.1+eb4f4a6e529b87faf061f136793c18a560867f3b
// TargetFramework: .NETCoreApp,Version=v3.1
// Configuration: Release
#nullable enable annotations
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks {
public class GenerateApiList : Task {
public GenerateApiList() {}
[Required]
public ITaskItem[]? Assemblies { get; set; }
+ public bool GenerateAttributeWithNamedArguments { get; set; }
public bool GenerateFullTypeName { get; set; }
+ public bool GenerateLanguagePrimitiveType { get; set; }
public string? GenerateMethodBody { get; set; }
+ public bool GenerateNullableAnnotations { get; set; }
public bool GenerateStaticMembersFirst { get; set; }
+ public bool GenerateTypeNameWithDeclaringTypeName { get; set; }
+ public bool GenerateValueWithDefaultLiteral { get; set; }
[Output]
public ITaskItem[]? GeneratedFiles { get; }
public override bool Execute() {}
}
}
Full changes
Full changes in this release:
diff --git a/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.csproj b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.csproj
index ea4267e..1c2a770 100644
--- a/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.csproj
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.csproj
@@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT
<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<RootNamespace>Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks</RootNamespace>
- <VersionPrefix>1.1.0</VersionPrefix>
+ <VersionPrefix>1.1.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
@@ -39,7 +39,7 @@ SPDX-License-Identifier: MIT
<ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.0.0" PrivateAssets="All" />
- <ProjectReference VersionRange="[1.1.1,2.0.0)" Include="..\Smdn.Reflection.ReverseGenerating.ListApi.Core\Smdn.Reflection.ReverseGenerating.ListApi.Core.csproj" PrivateAssets="All" />
+ <ProjectReference VersionRange="[1.1.2,2.0.0)" Include="..\Smdn.Reflection.ReverseGenerating.ListApi.Core\Smdn.Reflection.ReverseGenerating.ListApi.Core.csproj" PrivateAssets="All" />
<!-- remove this package itself from PackageReference to avoid duplicate references during the running of 'Pack' target -->
<PackageReference Remove="$(PackageId)" />
diff --git a/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/GenerateApiList.cs b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/GenerateApiList.cs
index fe7589c..4f50678 100644
--- a/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/GenerateApiList.cs
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/GenerateApiList.cs
@@ -18,9 +18,14 @@ public class GenerateApiList : Task {
[Required]
public ITaskItem[]? Assemblies { get; set; }
+ public bool GenerateLanguagePrimitiveType { get; set; } = true;
public bool GenerateFullTypeName { get; set; }
- public string? GenerateMethodBody { get; set; }
+ public bool GenerateTypeNameWithDeclaringTypeName { get; set; }
+ public string? GenerateMethodBody { get; set; } = nameof(MethodBodyOption.EmptyImplementation);
+ public bool GenerateAttributeWithNamedArguments { get; set; }
public bool GenerateStaticMembersFirst { get; set; }
+ public bool GenerateNullableAnnotations { get; set; } = true;
+ public bool GenerateValueWithDefaultLiteral { get; set; } = true;
[Output]
public ITaskItem[]? GeneratedFiles { get; private set; }
@@ -66,6 +71,7 @@ public class GenerateApiList : Task {
outputApiListFilePath,
options,
loadIntoReflectionOnlyContext,
+ GenerateNullableAnnotations,
logger: new LoggerAdapter(Log)
);
}
@@ -96,22 +102,37 @@ public class GenerateApiList : Task {
private ApiListWriterOptions BuildApiListWriterOptions()
{
+#pragma warning disable IDE0017
var options = new ApiListWriterOptions();
+#pragma warning restore IDE0017
#pragma warning disable IDE0055
- options.TypeDeclaration.WithNamespace = GenerateFullTypeName;
- options.MemberDeclaration.WithNamespace = GenerateFullTypeName;
+ options.TranslateLanguagePrimitiveTypeDeclaration = GenerateLanguagePrimitiveType;
+
+ options.TypeDeclaration.WithNamespace = false;
+ options.MemberDeclaration.WithNamespace = false;
options.AttributeDeclaration.WithNamespace = GenerateFullTypeName;
+ options.ValueDeclaration.WithNamespace = GenerateFullTypeName;
+ options.ParameterDeclaration.WithNamespace = GenerateFullTypeName;
+
+ options.TypeDeclaration.WithDeclaringTypeName = false;
+ options.MemberDeclaration.WithDeclaringTypeName = false;
+ options.AttributeDeclaration.WithDeclaringTypeName = GenerateTypeNameWithDeclaringTypeName;
+ options.ValueDeclaration.WithDeclaringTypeName = GenerateTypeNameWithDe...
Smdn.Reflection.ReverseGenerating.ListApi.Core version 1.1.2
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-12 update assembly version
- 2022-07-12 bump Smdn.Reflection.ReverseGenerating up to 1.1.1
- 2022-07-10 remove net5.0 targetted ones
API changes
API changes in this release:
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs
index b9b46d1..62fd64f 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs
@@ -1,67 +1,83 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.1)
+// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.2)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.Core
-// AssemblyVersion: 1.1.1.0
-// InformationalVersion: 1.1.1+c427f8c147936a9aec90fa59918071264114150c
+// AssemblyVersion: 1.1.2.0
+// InformationalVersion: 1.1.2+3059a983a624895dd6329f952eac8aad840a581f
// TargetFramework: .NETCoreApp,Version=v6.0
// Configuration: Release
-#nullable enable annotations
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
+using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Microsoft.Extensions.Logging;
using Smdn.Reflection.ReverseGenerating;
using Smdn.Reflection.ReverseGenerating.ListApi;
namespace Smdn.Reflection.ReverseGenerating.ListApi {
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class ApiListWriter {
public ApiListWriter(TextWriter baseWriter, Assembly assembly, ApiListWriterOptions options) {}
public TextWriter BaseWriter { get; }
public void WriteAssemblyInfoHeader() {}
public void WriteExportedTypes() {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class ApiListWriterOptions : GeneratorOptions {
+ [NullableContext(byte.MinValue)]
public class WriterOptions {
public WriterOptions() {}
public bool OrderStaticMembersFirst { get; set; }
public bool WriteNullableAnnotationDirective { get; set; }
}
public ApiListWriterOptions() {}
public ApiListWriterOptions.WriterOptions Writer { get; }
}
public static class AssemblyExtensions {
- [return: MaybeNull] public static TValue? GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
+ [NullableContext(1)]
+ [return: MaybeNull] public static TValue GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public static class AssemblyLoader {
- [return: MaybeNull] public static TResult? UsingAssembly<TArg, TResult>(FileInfo assemblyFile, bool loadIntoReflectionOnlyContext, TArg? arg, Func<Assembly, TArg?, TResult?> actionWithLoadedAssembly, out WeakReference? context, ILogger? logger = null) {}
+ [return: MaybeNull] public static TResult UsingAssembly<TArg, TResult>(FileInfo assemblyFile, bool loadIntoReflectionOnlyContext, TArg arg, Func<Assembly, TArg, TResult> actionWithLoadedAssembly, [Nullable(2)] out WeakReference context, [Nullable(2)] ILogger logger = null) {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public static class AttributeFilter {
public static readonly AttributeTypeFilter Default; // = "Smdn.Reflection.ReverseGenerating.AttributeTypeFilter"
}
public static class FrameworkMonikers {
- public static bool TryGetMoniker(FrameworkName frameworkName, string? osSpecifier, [NotNullWhen(true)] out string? frameworkMoniker) {}
+ [NullableContext(2)]
+ public static bool TryGetMoniker([Nullable(1)] FrameworkName frameworkName, string osSpecifier, [NotNullWhen(true)] out string frameworkMoniker) {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class MemberInfoComparer : IComparer<MemberInfo> {
public static readonly MemberInfoComparer Default; // = "Smdn.Reflection.ReverseGenerating.ListApi.MemberInfoComparer"
public static readonly MemberInfoComparer StaticMembersFirst; // = "Smdn.Reflection.ReverseGenerating.ListApi.MemberInfoComparer"
public MemberInfoComparer(int orderOfStaticMember, int orderOfInstanceMember) {}
- public int Compare(MemberInfo? x, MemberInfo? y) {}
- public int GetOrder(MemberInfo? member) {}
+ [NullableContext(2)]
+ public int Compare(MemberInfo x, MemberInfo y) {}
+ [NullableContext(2)]
+ public int GetOrder(MemberInfo member) {}
}
}
+
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-netcoreapp3.1.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-netcoreapp3.1.apilist.cs
index f21db1d..0498487 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-netcoreapp3.1.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-netcoreapp3.1.apilist.cs
@@ -1,67 +1,83 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.1)
+// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.2)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.Core
-// AssemblyVersion: 1.1.1.0
-// InformationalVersion: 1.1.1+c427f8c147936a9aec90fa59918071264114150c
+// AssemblyVersion: 1.1.2.0
+// InformationalVersion: 1.1.2+3059a983a624895dd6329f952eac8aad840a581f
// TargetFramework: .NETCoreApp,Version=v3.1
// Configuration: Release
-#nullable enable annotations
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
+using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Microsoft.Extensions.Logging;
using Smdn.Reflection.ReverseGenerating;
using Smdn.Reflection.ReverseGenerating.ListApi;
namespace Smdn.Reflection.ReverseGenerating.ListApi {
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class ApiListWriter {
public ApiListWriter(TextWriter baseWriter, Assembly assembly, ApiListWriterOptions options) {}
public TextWriter BaseWriter { get; }
public void WriteAssemblyInfoHeader() {}
public void WriteExportedTypes() {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class ApiListWriterOptions : GeneratorOptions {
+ [NullableContext(byte.MinValue)]
public class WriterOptions {
public WriterOptions() {}
public bool OrderStaticMembersFirst { get; set; }
public bool WriteNullableAnnotationDirective { get; set; }
}
public ApiListWriterOptions() {}
public ApiListWriterOptions.WriterOptions Writer { get; }
}
public static class AssemblyExtensions {
- [return: MaybeNull] public static TValue? GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
+ [NullableContext(1)]
+ [return: MaybeNull] public static TValue GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public static class AssemblyLoader {
- [return: MaybeNull] public static TResult? UsingAssembly<TArg, TResult>(FileInfo assemblyFile, bool loadIntoReflectionOnlyContext, TArg? arg, Func<Assembly, TArg?, TResult?> actionWithLoadedAssembly, out WeakReference? context, ILogger? logger = null) {}
+ [return: MaybeNull] public static TResult UsingAssembly<TArg, TResult>(FileInfo assemblyFile, bool loadIntoReflectionOnlyContext, TArg arg, Func<Assembly, TArg, TResult> actionWithLoadedAssembly, [Nullable(2)] out WeakReference context, [Nullable(2)] ILogger logger = null) {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public static class AttributeFilter {
public static readonly AttributeTypeFilter Default; // = "Smdn.Reflection.ReverseGenerating.AttributeTypeFilter"
}
public static class FrameworkMonikers {
- public static bool TryGetMoniker(FrameworkName frameworkName, string? osSpecifier, [NotNullWhen(true)] out string? frameworkMoniker) {}
+ [NullableContext(2)]
+ public static bool TryGetMoniker([Nullable(1)] FrameworkName frameworkName, string osSpecifier, [NotNullWhen(true)] out string frameworkMoniker) {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class MemberInfoComparer : IComparer<MemberInfo> {
public static readonly MemberInfoComparer Default; // = "Smdn.Reflection.ReverseGenerating.ListAp...
Smdn.Reflection.ReverseGenerating version 1.1.1
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-12 add fallback implementation
- 2022-07-12 update assembly version
- 2022-07-12 fix not to set nullability annotation to generic parameters which have no constraints
- 2022-07-12 split implementations relevant to nullable metadata into extension class TypeGenericParameterExtensions
- 2022-07-12 remove redundant typename modification
- 2022-07-12 fix estimating the
notnull
constraints with optimized nullable metadata of nested types - 2022-07-11 fix formatting type name of Nullable<GenericValueType<...>>
API changes
API changes in this release:
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
index f0f5273..f993af6 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
@@ -1,122 +1,136 @@
-// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.0)
+// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.1)
// Name: Smdn.Reflection.ReverseGenerating
-// AssemblyVersion: 1.1.0.0
-// InformationalVersion: 1.1.0+074a83ab64ee9e829c2f3835cf0c03af8af0f59d
+// AssemblyVersion: 1.1.1.0
+// InformationalVersion: 1.1.1+9c1ed7379f1b7fe2562a51f0283b02332d84584f
// TargetFramework: .NETFramework,Version=v4.5
// Configuration: Release
-#nullable enable annotations
using System;
using System.Collections.Generic;
using System.Reflection;
+using System.Runtime.CompilerServices;
using Smdn.Reflection;
using Smdn.Reflection.ReverseGenerating;
namespace Smdn.Reflection.ReverseGenerating {
public delegate bool AttributeTypeFilter(Type type, ICustomAttributeProvider attributeProvider);
public enum AttributeSectionFormat : int {
Discrete = 1,
List = 0,
}
public enum MethodBodyOption : int {
EmptyImplementation = 1,
None = 0,
ThrowNotImplementedException = 2,
ThrowNull = 3,
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public static class CSharpFormatter {
public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
public static string FormatAccessibility(Accessibility accessibility) {}
public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
public static string FormatTypeName(this EventInfo ev, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
public static string FormatTypeName(this FieldInfo f, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
public static string FormatTypeName(this ParameterInfo p, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
public static string FormatTypeName(this PropertyInfo p, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
- public static string FormatTypeName(this Type t, ICustomAttributeProvider? attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
- public static string FormatValueDeclaration(object? val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
+ public static string FormatTypeName(this Type t, [Nullable(2)] ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
+ public static string FormatValueDeclaration([Nullable(2)] object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
public static bool IsLanguagePrimitiveType(Type t, out string primitiveTypeName) {}
public static IEnumerable<string> ToNamespaceList(Type t) {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public static class Generator {
- public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
- public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
- public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
- public static string? GenerateMemberDeclaration(MemberInfo member, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
- public static string GenerateTypeDeclaration(Type t, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
- public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
+ public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
+ public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
+ public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
+ [return: Nullable(2)] public static string GenerateMemberDeclaration(MemberInfo member, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
+ public static string GenerateTypeDeclaration(Type t, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
+ public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, [Nullable] ISet<string> referencingNamespaces, GeneratorOptions options) {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class GeneratorOptions : ICloneable {
+ [Nullable(byte.MinValue)]
+ [NullableContext(2)]
public class AttributeDeclarationOptions {
public AttributeDeclarationOptions() {}
public AttributeSectionFormat AccessorFormat { get; set; }
public AttributeSectionFormat AccessorParameterFormat { get; set; }
public AttributeSectionFormat BackingFieldFormat { get; set; }
public AttributeSectionFormat DelegateParameterFormat { get; set; }
public AttributeSectionFormat GenericParameterFormat { get; set; }
public AttributeSectionFormat MethodParameterFormat { get; set; }
public bool OmitAttributeSuffix { get; set; }
- public AttributeTypeFilter? TypeFilter { get; set; }
+ public AttributeTypeFilter TypeFilter { get; set; }
public bool WithDeclaringTypeName { get; set; }
public bool WithNamedArguments { get; set; }
public bool WithNamespace { get; set; }
}
+ [NullableContext(byte.MinValue)]
public class MemberDeclarationOptions {
public MemberDeclarationOptions() {}
public MethodBodyOption AccessorBody { get; set; }
public MethodBodyOption MethodBody { get; set; }
public bool OmitEndOfStatement { get; set; }
public bool WithAccessibility { get; set; }
public bool WithDeclaringTypeName { get; set; }
public bool WithNamespace { get; set; }
}
+ [NullableContext(byte.MinValue)]
public class ParameterDeclarationOptions {
public ParameterDeclarationOptions() {}
public bool WithDeclaringTypeName { get; set; }
public bool WithNamespace { get; set; }
}
+ [NullableContext(byte.MinValue)]
public class TypeDeclarationOptions {
public TypeDeclarationOptions() {}
public bool OmitEndOfStatement { get; set; }
public bool WithAccessibility { get; set; }
public bool WithDeclaringTypeName { get; set; }
public bool WithNamespace { get; set; }
}
+ [NullableContext(byte.MinValue)]
public class ValueDeclarationOptions {
public ValueDeclarationOptions() {}
...
Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks version 1.1.0
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-10 bump Smdn.Reflection.ReverseGenerating.ListApi.Core up to 1.1.1
- 2022-07-10 add support for importing tasks on .NET 7.0
- 2022-07-10 remove net5.0 from target frameworks
- 2022-07-10 move targets into individual .targets files
- 2022-07-10 use tasks from the built assembly during packing instead of from the project asset package
- 2022-07-10 add comment
- 2022-07-09 update assembly version
- 2022-07-09 bump Smdn.Reflection.ReverseGenerating.ListApi.Core up to 1.1.0
- 2022-07-09 add support for nullability annotations
- 2022-07-09 make non-public class sealed
- 2022-03-08 update package tags
- 2022-03-08 update assembly descriptions
- 2022-03-08 split property groups
- 2022-01-31 disable README.md auto-generation
API changes
API changes in this release:
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-net6.0.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-net6.0.apilist.cs
index 532361a..1714147 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-net6.0.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-net6.0.apilist.cs
@@ -1,30 +1,26 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.0.3 (net6.0))
+// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.1.0)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks
-// AssemblyVersion: 1.0.3.0
-// InformationalVersion: 1.0.3 (net6.0)
+// AssemblyVersion: 1.1.0.0
+// InformationalVersion: 1.1.0+64b5c72527e2ce0705ed5d9ed2328179311a4c94
// TargetFramework: .NETCoreApp,Version=v6.0
// Configuration: Release
+#nullable enable annotations
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks {
- [Nullable(byte.MinValue)]
- [NullableContext(2)]
public class GenerateApiList : Task {
public GenerateApiList() {}
[Required]
- [Nullable]
- public ITaskItem[] Assemblies { get; set; }
+ public ITaskItem[]? Assemblies { get; set; }
public bool GenerateFullTypeName { get; set; }
- public string GenerateMethodBody { get; set; }
+ public string? GenerateMethodBody { get; set; }
public bool GenerateStaticMembersFirst { get; set; }
[Output]
- [Nullable]
- public ITaskItem[] GeneratedFiles { get; }
+ public ITaskItem[]? GeneratedFiles { get; }
public override bool Execute() {}
}
}
-
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-netcoreapp3.1.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-netcoreapp3.1.apilist.cs
index 00547df..e56e8da 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-netcoreapp3.1.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-netcoreapp3.1.apilist.cs
@@ -1,30 +1,26 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.0.3 (netcoreapp3.1))
+// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.1.0)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks
-// AssemblyVersion: 1.0.3.0
-// InformationalVersion: 1.0.3 (netcoreapp3.1)
+// AssemblyVersion: 1.1.0.0
+// InformationalVersion: 1.1.0+64b5c72527e2ce0705ed5d9ed2328179311a4c94
// TargetFramework: .NETCoreApp,Version=v3.1
// Configuration: Release
+#nullable enable annotations
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks {
- [Nullable(byte.MinValue)]
- [NullableContext(2)]
public class GenerateApiList : Task {
public GenerateApiList() {}
[Required]
- [Nullable]
- public ITaskItem[] Assemblies { get; set; }
+ public ITaskItem[]? Assemblies { get; set; }
public bool GenerateFullTypeName { get; set; }
- public string GenerateMethodBody { get; set; }
+ public string? GenerateMethodBody { get; set; }
public bool GenerateStaticMembersFirst { get; set; }
[Output]
- [Nullable]
- public ITaskItem[] GeneratedFiles { get; }
+ public ITaskItem[]? GeneratedFiles { get; }
public override bool Execute() {}
}
}
-
Full changes
Full changes in this release:
diff --git a/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Directory.Build.targets b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Directory.Build.targets
new file mode 100644
index 0000000..1a8f8a4
--- /dev/null
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Directory.Build.targets
@@ -0,0 +1,10 @@
+<!--
+SPDX-FileCopyrightText: 2022 smdn <smdn@smdn.jp>
+SPDX-License-Identifier: MIT
+-->
+<Project>
+ <ImportGroup>
+ <Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.targets" />
+ <Import Project="$(MSBuildThisFileDirectory)UsingExportedTasks.targets" />
+ </ImportGroup>
+</Project>
diff --git a/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/GenerateMSBuildTargetsFile.targets b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/GenerateMSBuildTargetsFile.targets
new file mode 100644
index 0000000..f00e3c9
--- /dev/null
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/GenerateMSBuildTargetsFile.targets
@@ -0,0 +1,57 @@
+<!--
+SPDX-FileCopyrightText: 2021 smdn <smdn@smdn.jp>
+SPDX-License-Identifier: MIT
+-->
+<Project>
+ <Target
+ Name="GenerateMSBuildTargetsFile"
+ DependsOnTargets="GenerateTaskFiles"
+ >
+ <ItemGroup>
+ <TaskTargetFrameworks Include="$(TargetFrameworks.Split(';'))" />
+ <TaskFiles
+ Include="@(ExportTaskNames)"
+ TargetFramework="%(TaskTargetFrameworks.Identity)"
+ />
+ <TaskFiles
+ ImportLine="<Import Project="..\$(BuildOutputTargetFolder)\%(TargetFramework)\%(Identity).task" />"
+ />
+ </ItemGroup>
+
+ <PropertyGroup>
+ <GenerateMSBuildTargetsFileOutputPath>$(OutputPath)\$(AssemblyName).targets</GenerateMSBuildTargetsFileOutputPath>
+ <!-- TODO: MSBuildRuntimeType == Full, Mono and otherwise -->
+ <GenerateMSBuildTargetsFileLines><![CDATA[
+<Project>
+ <ImportGroup Condition=" '%24(MSBuildRuntimeType)' == 'Core' and %24([System.Runtime.InteropServices.RuntimeInformation]::FrameworkDescription.StartsWith('.NET Core 3.')) ">
+ <!-- .NET Core 3.x -->
+ @(TaskFiles->WithMetadataValue('TargetFramework', 'netcoreapp3.1')->'%(ImportLine)', '%0D%0A ')
+ </ImportGroup>
+ <ImportGroup Condition=" '%24(MSBuildRuntimeType)' == 'Core' and %24([System.Runtime.InteropServices.RuntimeInformation]::FrameworkDescription.StartsWith('.NET 5.')) ">
+ <!-- .NET 5.x -->
+ @(TaskFiles->WithMetadataValue('TargetFramework', 'netcoreapp3.1')->'%(ImportLine)', '%0D%0A ')
+ </ImportGroup>
+ <ImportGroup Condition=" '%24(MSBuildRuntimeType)' == 'Core' and %24([System.Runtime.InteropServices.RuntimeInformation]::FrameworkDescription.StartsWith('.NET 6.')) ">
+ <!-- .NET 6.x -->
+ @(TaskFiles->WithMetadataValue('TargetFramework', 'net6.0')->'%(ImportLine)', '%0D%0A ')
+ </ImportGroup>
+ <ImportGroup Condition=" '%24(MSBuildRuntimeType)' == 'Core' and %24([System.Runtime.InteropServic...
Smdn.Reflection.ReverseGenerating.ListApi.Core version 1.1.1
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-10 update assembly version
- 2022-07-10 enable nullable
- 2022-07-10 remove net5.0 from target frameworks
API changes
API changes in this release:
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs
index f59d148..8321ef2 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs
@@ -1,66 +1,83 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.0)
+// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.1)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.Core
-// AssemblyVersion: 1.1.0.0
-// InformationalVersion: 1.1.0+074a83ab64ee9e829c2f3835cf0c03af8af0f59d
+// AssemblyVersion: 1.1.1.0
+// InformationalVersion: 1.1.1+c427f8c147936a9aec90fa59918071264114150c
// TargetFramework: .NETCoreApp,Version=v6.0
// Configuration: Release
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
+using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Microsoft.Extensions.Logging;
using Smdn.Reflection.ReverseGenerating;
using Smdn.Reflection.ReverseGenerating.ListApi;
namespace Smdn.Reflection.ReverseGenerating.ListApi {
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class ApiListWriter {
public ApiListWriter(TextWriter baseWriter, Assembly assembly, ApiListWriterOptions options) {}
public TextWriter BaseWriter { get; }
public void WriteAssemblyInfoHeader() {}
public void WriteExportedTypes() {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class ApiListWriterOptions : GeneratorOptions {
+ [NullableContext(byte.MinValue)]
public class WriterOptions {
public WriterOptions() {}
public bool OrderStaticMembersFirst { get; set; }
public bool WriteNullableAnnotationDirective { get; set; }
}
public ApiListWriterOptions() {}
public ApiListWriterOptions.WriterOptions Writer { get; }
}
public static class AssemblyExtensions {
- public static TValue GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
+ [NullableContext(1)]
+ [return: MaybeNull] public static TValue GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public static class AssemblyLoader {
- public static TResult UsingAssembly<TArg, TResult>(FileInfo assemblyFile, bool loadIntoReflectionOnlyContext, TArg arg, Func<Assembly, TArg, TResult> actionWithLoadedAssembly, out WeakReference context, ILogger logger = null) {}
+ [return: MaybeNull] public static TResult UsingAssembly<TArg, TResult>(FileInfo assemblyFile, bool loadIntoReflectionOnlyContext, TArg arg, Func<Assembly, TArg, TResult> actionWithLoadedAssembly, [Nullable(2)] out WeakReference context, [Nullable(2)] ILogger logger = null) {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public static class AttributeFilter {
public static readonly AttributeTypeFilter Default; // = "Smdn.Reflection.ReverseGenerating.AttributeTypeFilter"
}
public static class FrameworkMonikers {
- public static bool TryGetMoniker(FrameworkName frameworkName, string osSpecifier, out string frameworkMoniker) {}
+ [NullableContext(2)]
+ public static bool TryGetMoniker([Nullable(1)] FrameworkName frameworkName, string osSpecifier, [NotNullWhen(true)] out string frameworkMoniker) {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class MemberInfoComparer : IComparer<MemberInfo> {
public static readonly MemberInfoComparer Default; // = "Smdn.Reflection.ReverseGenerating.ListApi.MemberInfoComparer"
public static readonly MemberInfoComparer StaticMembersFirst; // = "Smdn.Reflection.ReverseGenerating.ListApi.MemberInfoComparer"
public MemberInfoComparer(int orderOfStaticMember, int orderOfInstanceMember) {}
+ [NullableContext(2)]
public int Compare(MemberInfo x, MemberInfo y) {}
+ [NullableContext(2)]
public int GetOrder(MemberInfo member) {}
}
}
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-netcoreapp3.1.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-netcoreapp3.1.apilist.cs
index 79799d1..e9ed99f 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-netcoreapp3.1.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-netcoreapp3.1.apilist.cs
@@ -1,66 +1,83 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.0)
+// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.1)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.Core
-// AssemblyVersion: 1.1.0.0
-// InformationalVersion: 1.1.0+074a83ab64ee9e829c2f3835cf0c03af8af0f59d
+// AssemblyVersion: 1.1.1.0
+// InformationalVersion: 1.1.1+c427f8c147936a9aec90fa59918071264114150c
// TargetFramework: .NETCoreApp,Version=v3.1
// Configuration: Release
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
+using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Microsoft.Extensions.Logging;
using Smdn.Reflection.ReverseGenerating;
using Smdn.Reflection.ReverseGenerating.ListApi;
namespace Smdn.Reflection.ReverseGenerating.ListApi {
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class ApiListWriter {
public ApiListWriter(TextWriter baseWriter, Assembly assembly, ApiListWriterOptions options) {}
public TextWriter BaseWriter { get; }
public void WriteAssemblyInfoHeader() {}
public void WriteExportedTypes() {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class ApiListWriterOptions : GeneratorOptions {
+ [NullableContext(byte.MinValue)]
public class WriterOptions {
public WriterOptions() {}
public bool OrderStaticMembersFirst { get; set; }
public bool WriteNullableAnnotationDirective { get; set; }
}
public ApiListWriterOptions() {}
public ApiListWriterOptions.WriterOptions Writer { get; }
}
public static class AssemblyExtensions {
- public static TValue GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
+ [NullableContext(1)]
+ [return: MaybeNull] public static TValue GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public static class AssemblyLoader {
- public static TResult UsingAssembly<TArg, TResult>(FileInfo assemblyFile, bool loadIntoReflectionOnlyContext, TArg arg, Func<Assembly, TArg, TResult> actionWithLoadedAssembly, out WeakReference context, ILogger logger = null) {}
+ [return: MaybeNull] public static TResult UsingAssembly<TArg, TResult>(FileInfo assemblyFile, bool loadIntoReflectionOnlyContext, TArg arg, Func<Assembly, TArg, TResult> actionWithLoadedAssembly, [Nullable(2)] out WeakReference context, [Nullable(2)] ILogger logger = null) {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public static class AttributeFilter {
public static readonly AttributeTypeFilter Default; // = "Smdn.Reflection.ReverseGenerating.AttributeTypeFilter"
}
public static class FrameworkMonikers {
- public static bool TryGetMoniker(FrameworkName frameworkName, string osSpecifier, out string frameworkMoniker) {}
+ [NullableContext(2)]
+ public static bool TryGetMoniker([Nullable(1)] FrameworkName frameworkName, string osSpecifier, [NotNullWhen(true)] out string frameworkMoniker) {}
}
+ [Nullable(byte.MinValue)]
+ [NullableContext(1)]
public class MemberInfoComparer : IComparer<MemberInfo> {
public static readonly MemberInfoComparer Default; // = "Smdn.Reflection.ReverseGenerating.ListApi.MemberInfoComparer"
public static readonly MemberInfoComparer StaticMembersFirst; // = "Smdn.Reflection.ReverseGenerating.ListApi.MemberInfoComparer"
public MemberInfoComparer(int orderOfStaticMember, int orderOfInstanceMember) {}
+ [NullableContext(2)]
public int Compare(MemberInfo x, MemberInfo y) {}
+ ...
Smdn.Reflection.ReverseGenerating.ListApi.Core version 1.1.0
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-09 update assembly version
- 2022-07-09 bump Smdn.Reflection.ReverseGenerating up to 1.1.0
- 2022-07-09 add fallback implementation for target framework which does not have NullabilityInfoContext
- 2022-07-09 add support for output #nullable directives according to the configurations of TypeDeclarationOptions and MemberDeclarationOptions
- 2022-07-09 reduce writing redundant newline
- 2022-07-09 disable warning CA1848 'use the LoggerMessage delegates'
- 2022-07-09 fix warning CA2254
- 2022-07-09 add partial support for net7.0
- 2022-07-09 make private class sealed
- 2022-07-09 suppress warning IDE0060 and SA1305
- 2022-07-09 make lambda static
- 2022-07-08 add more target attributes to AttributeFilter.Default
- 2022-07-02 remove TODO comment
- 2022-06-23 improve to filter Nullable/NullableContext attributes
- 2022-06-23 improve to filter AsyncStateMachine attributes
- 2022-06-23 fix AttributeFilter.Default to exclude DefaultMemberAttribute only for Type
- 2022-06-23 fix AttributeFilter.Default to exclude TupleElementNamesAttribute for FieldInfo and PropertyInfo as well
- 2022-04-08 bump Smdn.MSBuild.DefineConstants.NETSdkApi up to 1.2.2
- 2022-03-08 update package tags
- 2022-03-08 update assembly descriptions
- 2022-03-08 split property groups
- 2022-01-31 update version
- 2021-12-30 use Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.GenerateApiList to generate API list
- 2021-12-27 define PackageValidationBaselineVersion
API changes
API changes in this release:
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net5.0.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net5.0.apilist.cs
index d904e13..fd64db3 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net5.0.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net5.0.apilist.cs
@@ -1,65 +1,66 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.0.0 (net5.0))
+// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.0)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.Core
-// AssemblyVersion: 1.0.0.0
-// InformationalVersion: 1.0.0 (net5.0)
+// AssemblyVersion: 1.1.0.0
+// InformationalVersion: 1.1.0+074a83ab64ee9e829c2f3835cf0c03af8af0f59d
// TargetFramework: .NETCoreApp,Version=v5.0
// Configuration: Release
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.Versioning;
using Microsoft.Extensions.Logging;
using Smdn.Reflection.ReverseGenerating;
using Smdn.Reflection.ReverseGenerating.ListApi;
namespace Smdn.Reflection.ReverseGenerating.ListApi {
public class ApiListWriter {
public ApiListWriter(TextWriter baseWriter, Assembly assembly, ApiListWriterOptions options) {}
public TextWriter BaseWriter { get; }
public void WriteAssemblyInfoHeader() {}
public void WriteExportedTypes() {}
}
public class ApiListWriterOptions : GeneratorOptions {
public class WriterOptions {
public WriterOptions() {}
public bool OrderStaticMembersFirst { get; set; }
+ public bool WriteNullableAnnotationDirective { get; set; }
}
public ApiListWriterOptions() {}
public ApiListWriterOptions.WriterOptions Writer { get; }
}
public static class AssemblyExtensions {
public static TValue GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
}
public static class AssemblyLoader {
public static TResult UsingAssembly<TArg, TResult>(FileInfo assemblyFile, bool loadIntoReflectionOnlyContext, TArg arg, Func<Assembly, TArg, TResult> actionWithLoadedAssembly, out WeakReference context, ILogger logger = null) {}
}
public static class AttributeFilter {
public static readonly AttributeTypeFilter Default; // = "Smdn.Reflection.ReverseGenerating.AttributeTypeFilter"
}
public static class FrameworkMonikers {
public static bool TryGetMoniker(FrameworkName frameworkName, string osSpecifier, out string frameworkMoniker) {}
}
public class MemberInfoComparer : IComparer<MemberInfo> {
public static readonly MemberInfoComparer Default; // = "Smdn.Reflection.ReverseGenerating.ListApi.MemberInfoComparer"
public static readonly MemberInfoComparer StaticMembersFirst; // = "Smdn.Reflection.ReverseGenerating.ListApi.MemberInfoComparer"
public MemberInfoComparer(int orderOfStaticMember, int orderOfInstanceMember) {}
public int Compare(MemberInfo x, MemberInfo y) {}
public int GetOrder(MemberInfo member) {}
}
}
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs
index afa1c12..f59d148 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-net6.0.apilist.cs
@@ -1,65 +1,66 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.0.0 (net6.0))
+// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.0)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.Core
-// AssemblyVersion: 1.0.0.0
-// InformationalVersion: 1.0.0 (net6.0)
+// AssemblyVersion: 1.1.0.0
+// InformationalVersion: 1.1.0+074a83ab64ee9e829c2f3835cf0c03af8af0f59d
// TargetFramework: .NETCoreApp,Version=v6.0
// Configuration: Release
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.Versioning;
using Microsoft.Extensions.Logging;
using Smdn.Reflection.ReverseGenerating;
using Smdn.Reflection.ReverseGenerating.ListApi;
namespace Smdn.Reflection.ReverseGenerating.ListApi {
public class ApiListWriter {
public ApiListWriter(TextWriter baseWriter, Assembly assembly, ApiListWriterOptions options) {}
public TextWriter BaseWriter { get; }
public void WriteAssemblyInfoHeader() {}
public void WriteExportedTypes() {}
}
public class ApiListWriterOptions : GeneratorOptions {
public class WriterOptions {
public WriterOptions() {}
public bool OrderStaticMembersFirst { get; set; }
+ public bool WriteNullableAnnotationDirective { get; set; }
}
public ApiListWriterOpti...
Smdn.Reflection.ReverseGenerating version 1.1.0
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-09 update assembly version
- 2022-07-08 bump Smdn.Fundamental.Reflection up to 3.3.0
- 2022-07-05 suppress warning CS8602
- 2022-07-05 fix generating 'virtual' modifier of properties with non-public accessor
- 2022-07-05 fix argument name
- 2022-07-05 add support for showing
new
modifier on member declarations - 2022-07-05 add GeneratorOptions.AttributeDeclarationOptions.OmitAttributeSuffix
- 2022-07-04 add support for generating generic attributes
- 2022-07-04 reduce allocations
- 2022-07-04 simplify generating member modifiers
- 2022-07-04 add support for generating implementation members of static interface member
- 2022-07-04 bump Smdn.Fundamental.Reflection up to 3.2.0
- 2022-07-03 add support for static interface members and TSelf constraints
- 2022-07-02 mark as
sealed
- 2022-07-02 add support for showing
readonly
modifier on struct property declarations - 2022-07-02 add support for showing
new
modifier on type declarations - 2022-07-02 add support for generating array and param array attribute args
- 2022-07-01 add workaround for .NET Framework
- 2022-07-01 reduce duplicate codes
- 2022-07-01 apply ValueFormatOptions.TranslateLanguagePrimitiveType on default value and constant field value
- 2022-07-01 add support for formatting values of System.Type
- 2022-07-01 add GeneratorOptions.ParameterDeclarationOptions for formatting parameter type names
- 2022-07-01 fix formatting nested type full name
- 2022-07-01 add GeneratorOptions.ValueDeclarationOptions.WithNamespace/WithDeclaringTypeName for formatting type name of values
- 2022-06-30 add GeneratorOptions.MethodDeclarationOptions.AccessorBody
- 2022-06-30 add support for generating attribute list of event accessor parameters
- 2022-06-30 reduce duplicate codes
- 2022-06-30 add support for specifying attribute section format of method and delegate (return) parameters
- 2022-06-30 remove unusing codes
- 2022-06-30 add support for specifying attribute section format of property and event accessors
- 2022-06-30 add support for generating event accessor methods
- 2022-06-29 add support for specifying attribute section format of accessor parameters, backing fields and generic parameters
- 2022-06-29 add GeneratorOptions.AttributeDeclarationOptions.WithDeclaringTypeName for formatting nested attribute type names
- 2022-06-29 add support for generating attribute list of generic method parameter
- 2022-06-29 add support for generating attribute list of generic type parameter
- 2022-06-29 reduce specifying 'showVariance' arguments
- 2022-06-29 use record struct instead
- 2022-06-29 add support for generating attribute list of event backing fields
- 2022-06-29 use StringBuilder.Append+String.Join if StringBuilder.AppendJoin is not available
- 2022-06-27 add support for generating attribute list of property accessor methods and backing fields
- 2022-06-26 fix not to generate constant field of primitive types on attribute arguments
- 2022-06-26 add support for cloning GeneratorOptions
- 2022-06-26 commonize process of generating method and delegate declarations
- 2022-06-22 fix formatting result of single-elemented value tuples
- 2022-06-22 add support for formatting delegates with nullability annotation
- 2022-06-22 add GeneratorOptions.TypeDeclarationOptions.NullabilityInfoContext
- 2022-06-22 add GeneratorOptions.MemberDeclarationOptions.NullabilityInfoContext
- 2022-06-22 add overloads of CSharpFormatter.FormatParameter/FormatParameterList() which accepts NullabilityInfoContext
- 2022-06-22 rename parameter of NullabilityInfoContext
- 2022-06-22 make parameter nullable
- 2022-06-22 add overloads of FormatTypeName()
- 2022-06-22 specify attribute provider of target
- 2022-06-22 add support for formatting property type name with nullability annotations
- 2022-06-21 [add support for formatting event type name with nullability annotatio...
Smdn.Reflection.ReverseGenerating version 1.0.5
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
API changes
API changes in this release:
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
index 6355e5f..c02a07a 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
@@ -1,90 +1,90 @@
-// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.4 (net45))
+// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.5)
// Name: Smdn.Reflection.ReverseGenerating
-// AssemblyVersion: 1.0.4.0
-// InformationalVersion: 1.0.4 (net45)
+// AssemblyVersion: 1.0.5.0
+// InformationalVersion: 1.0.5+dd9591cbed8623f61349f46c833f14f1578db406
// TargetFramework: .NETFramework,Version=v4.5
// Configuration: Release
using System;
using System.Collections.Generic;
using System.Reflection;
using Smdn.Reflection;
using Smdn.Reflection.ReverseGenerating;
namespace Smdn.Reflection.ReverseGenerating {
public delegate bool AttributeTypeFilter(Type type, ICustomAttributeProvider attributeProvider);
public enum MethodBodyOption : int {
EmptyImplementation = 1,
None = 0,
ThrowNotImplementedException = 2,
}
public static class CSharpFormatter {
public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
public static string FormatAccessibility(Accessibility accessibility) {}
public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
public static string FormatTypeName(this Type t, ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
public static string FormatValueDeclaration(object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
public static bool IsLanguagePrimitiveType(Type t, out string primitiveTypeName) {}
public static IEnumerable<string> ToNamespaceList(Type t) {}
}
public static class Generator {
public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string> referencingNamespaces, GeneratorOptions options) {}
public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string> referencingNamespaces, GeneratorOptions options) {}
public static string GenerateMemberDeclaration(MemberInfo member, ISet<string> referencingNamespaces, GeneratorOptions options) {}
public static string GenerateTypeDeclaration(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
}
public class GeneratorOptions {
public class AttributeDeclarationOptions {
public AttributeDeclarationOptions() {}
public AttributeTypeFilter TypeFilter { get; set; }
public bool WithNamedArguments { get; set; }
public bool WithNamespace { get; set; }
}
public class MemberDeclarationOptions {
public MemberDeclarationOptions() {}
public MethodBodyOption MethodBody { get; set; }
public bool OmitEndOfStatement { get; set; }
public bool WithAccessibility { get; set; }
public bool WithDeclaringTypeName { get; set; }
public bool WithNamespace { get; set; }
}
public class TypeDeclarationOptions {
public TypeDeclarationOptions() {}
public bool OmitEndOfStatement { get; set; }
public bool WithAccessibility { get; set; }
public bool WithDeclaringTypeName { get; set; }
public bool WithNamespace { get; set; }
}
public class ValueDeclarationOptions {
public ValueDeclarationOptions() {}
public bool UseDefaultLiteral { get; set; }
}
public GeneratorOptions() {}
public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; }
public bool IgnorePrivateOrAssembly { get; set; }
public string Indent { get; set; }
public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; }
public bool TranslateLanguagePrimitiveTypeDeclaration { get; set; }
public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; }
public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; }
}
}
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs
index 18975c9..6e7284d 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs
@@ -1,90 +1,90 @@
-// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.4 (net47))
+// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.5)
// Name: Smdn.Reflection.ReverseGenerating
-// AssemblyVersion: 1.0.4.0
-// InformationalVersion: 1.0.4 (net47)
+// AssemblyVersion: 1.0.5.0
+// InformationalVersion: 1.0.5+dd9591cbed8623f61349f46c833f14f1578db406
// TargetFramework: .NETFramework,Version=v4.7
// Configuration: Release
using System;
using System.Collections.Generic;
using System.Reflection;
using Smdn.Reflection;
using Smdn.Reflection.ReverseGenerating;
namespace Smdn.Reflection.ReverseGenerating {
public delegate bool AttributeTypeFilter(Type type, ICustomAttributeProvider attributeProvider);
public enum MethodBodyOption : int {
EmptyImplementation = 1,
None = 0,
ThrowNotImplementedException = 2,
}
public static class CSharpFormatter {
public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
public static string FormatAccessibility(Accessibility accessibility) {}
public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
public static string FormatTypeName(this Type t, ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
public static string FormatValueDeclaration(object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
public static bool IsLanguagePrimitiveType(Type t, out string primitiveTypeName) {}
public static IEnumerable<string> ToNamespaceList(Type t) {}
}
public static class Generator {
public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string> referencingNamespaces, GeneratorOptions options) {}
public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string> referencingNamespaces, GeneratorOptions options) {}
public static string GenerateMemberDeclaration(MemberInfo member, ISet<string> referencingNamespaces, GeneratorOptions options) {}
public static string GenerateTypeDeclaration(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencing...