Releases: smdn/Smdn.Reflection.ReverseGenerating
Releases · smdn/Smdn.Reflection.ReverseGenerating
Smdn.Reflection.ReverseGenerating.ListApi.Core version 1.1.2.1
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-22 update package version
- 2022-07-20 reformat
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 c372f0e..ff1b1a0 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,67 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.2)
+// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.2.1)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.Core
-// AssemblyVersion: 1.1.2.0
-// InformationalVersion: 1.1.2+3059a983a624895dd6329f952eac8aad840a581f
+// AssemblyVersion: 1.1.2.1
+// InformationalVersion: 1.1.2.1+59722f8c92dea887d08ff8f5e1066a73abebbcfd
// 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.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 {
[return: MaybeNull] public static TValue GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
}
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) {}
}
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) {}
}
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-netcoreapp3.1.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core-netcoreapp3.1.apilist.cs
index 94de56d..742b730 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,67 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.2)
+// Smdn.Reflection.ReverseGenerating.ListApi.Core.dll (Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.2.1)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.Core
-// AssemblyVersion: 1.1.2.0
-// InformationalVersion: 1.1.2+3059a983a624895dd6329f952eac8aad840a581f
+// AssemblyVersion: 1.1.2.1
+// InformationalVersion: 1.1.2.1+59722f8c92dea887d08ff8f5e1066a73abebbcfd
// 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.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 {
[return: MaybeNull] public static TValue GetAssemblyMetadataAttributeValue<TAssemblyMetadataAttribute, TValue>(this Assembly assm) where TAssemblyMetadataAttribute : Attribute {}
}
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) {}
}
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) {}
}
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) {}
}
}
Full changes
Full changes in this release:
diff --git a/src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core.csproj b/src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core.csproj
index de3659d..1ee78c3 100644
--- a/src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core.csproj
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core.csproj
@@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT
<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<RootNamespace>Smdn.Reflection.ReverseGenerating.ListApi.Core</RootNamespace>
- <VersionPrefix>1.1.2</VersionPrefix>
+ <VersionPrefix>1.1.2.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
<PackageValidationBaselineVersion>1.0.0</PackageValidationBaselineVersion>
<Nullable>enable</Nullable>
diff --git a/src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/AttributeFilter.cs b/src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/AttributeFilter.cs
index 67d6afd..a4e1be3 100644
--- a/src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/AttributeFilter.cs
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/AttributeFilter.cs
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2021 smdn <smdn@smdn.jp>
// SPDX-License-Identifier: MIT
using System;
-using System.Linq;
using System.Reflection;
namespace Smdn.Reflection.ReverseGenerating.ListApi;
Full Changelog: https://github.com/smdn/Smdn.Reflection.ReverseGenerating/comp...
Smdn.Reflection.ReverseGenerating.ListApi version 1.1.0.1
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-22 update package version
Full changes
Full changes in this release:
diff --git a/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.csproj b/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.csproj
index c4e9d4d..6a67fb6 100644
--- a/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.csproj
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.csproj
@@ -9,7 +9,7 @@ SPDX-License-Identifier: MIT
<TargetFrameworks>net6.0<!-- ;net472 --></TargetFrameworks>
<AssemblyName>Smdn.Reflection.ReverseGenerating.ListApi</AssemblyName>
<ToolCommandName>list-api</ToolCommandName>
- <VersionPrefix>1.1.0</VersionPrefix>
+ <VersionPrefix>1.1.0.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Nullable>enable</Nullable>
<EnableFeature_BuildProjectFile Condition=" '$(Configuration)' != 'Release' ">true</EnableFeature_BuildProjectFile>
Full Changelog: releases/Smdn.Reflection.ReverseGenerating.ListApi.Core-1.1.2.1...releases/Smdn.Reflection.ReverseGenerating.ListApi-1.1.0.1
Smdn.Reflection.ReverseGenerating version 1.1.3
Released package
Release notes
The full release notes are available at gist.
Change log
Change log in this release:
- 2022-07-22 update assembly version
- 2022-07-22 fix to validate option argument
- 2022-07-22 rename file according to declaring type name
- 2022-07-22 fix to validate arguments
- 2022-07-21 rename
GenerateGenericArgumentConstraintDeclaration
toGenerateGenericParameterConstraintDeclaration
and mark as obsolete - 2022-07-21 fix to use the term of 'generic parameter' instead of 'generic argument'
- 2022-07-20 reformat
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 7044626..bc58591 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,123 +1,125 @@
-// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.2)
+// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.3)
// Name: Smdn.Reflection.ReverseGenerating
-// AssemblyVersion: 1.1.2.0
-// InformationalVersion: 1.1.2+775287448dc58ab1c9fb7f0618d8c8bb6de9e775
+// AssemblyVersion: 1.1.3.0
+// InformationalVersion: 1.1.3+f6167551bdfd2449c464509449137c454604db0f
// 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) {}
+ [Obsolete("Use GenerateGenericParameterConstraintDeclaration instead.")]
public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string>? referencingNamespaces, GeneratorOptions options) {}
+ public static string GenerateGenericParameterConstraintDeclaration(Type genericParameter, 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 c5584e3..84062b4 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,123 +1,125 @@
-// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.2)
+// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.1.3)
// Name: Smdn.Reflection.ReverseGenerating
-// AssemblyVersion: 1.1.2.0
-// InformationalVersion: 1.1.2+775287448dc58ab1c9fb7f0618d8c8bb6de9e775
+// A...
Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks 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-20 update assembly version
- 2022-07-20 add support for generating and including README.md in nuget package
- 2022-07-20 set newly exposed option
- 2022-07-20 remove meaningless VersionRange in ProjectReference
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 cf0e594..f2f58a8 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,31 +1,31 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.1.1)
+// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.1.2)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks
-// AssemblyVersion: 1.1.1.0
-// InformationalVersion: 1.1.1+eb4f4a6e529b87faf061f136793c18a560867f3b
+// AssemblyVersion: 1.1.2.0
+// InformationalVersion: 1.1.2+2aea6159ebc902a97981020b839b6a5fd056489e
// 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 65b4fcc..9559e3a 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,31 +1,31 @@
-// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.1.1)
+// Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks.dll (Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks-1.1.2)
// Name: Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks
-// AssemblyVersion: 1.1.1.0
-// InformationalVersion: 1.1.1+eb4f4a6e529b87faf061f136793c18a560867f3b
+// AssemblyVersion: 1.1.2.0
+// InformationalVersion: 1.1.2+2aea6159ebc902a97981020b839b6a5fd056489e
// 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/Directory.Build.targets b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Directory.Build.targets
index 1a8f8a4..268af64 100644
--- a/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Directory.Build.targets
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/Directory.Build.targets
@@ -6,5 +6,6 @@ SPDX-License-Identifier: MIT
<ImportGroup>
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.targets" />
<Import Project="$(MSBuildThisFileDirectory)UsingExportedTasks.targets" />
+ <Import Project="$(MSBuildThisFileDirectory)ReadmeFile.targets" />
</ImportGroup>
</Project>
diff --git a/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/ReadmeFile.targets b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/ReadmeFile.targets
new file mode 100644
index 0000000..7020fb3
--- /dev/null
+++ b/src/Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks/ReadmeFile.targets
@@ -0,0 +1,90 @@
+<!--
+SPDX-FileCopyrightText: 2022 smdn <smdn@smdn.jp>
+SPDX-License-Identifier: MIT
+-->
+<Project>
+ <PropertyGroup>
+ <PackageReadmeFile>README.md</PackageReadmeFile>
+ <NupkgReadmeFileOutputPath>$(OutputPath)$(PackageReadmeFile)</NupkgReadmeFileOutputPath>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Include="$(NupkgReadmeFileOutputPath)" Pack="true" PackagePath="$(PackageReadmeFile)" />
+ </ItemGroup>
+
+ <!-- overrides the target GenerateNupkgReadmeFile from Smdn.MSBuild.ProjectAssets.Library -->
+ <Target
+ Name="GenerateNupkgReadmeFile"
+ BeforeTargets="GenerateNuspec"
+ >
+ <ItemGroup>
+ <CoreAssemblyOutputs Include="$(OutputPath)**\Smdn*.dll"/>
+ </ItemGroup>
+
+ <GetCoreAssemblyInformationsFromLoadedAssembly AssemblyNames="%(CoreAssemblyOutputs.Filename)" Condition="'$(UseExportedTasksFromOutputAssembly)' == 'true'">
+ <Output TaskParameter="AssemblyInformations" ItemName="CoreAssemblyInformations" />
+ </GetCoreAssemblyInformationsFromLoadedAssembly>
+
+ <ItemGroup>
+ <_NupkgReadmeLines Include="# $(AssemblyName)" />
+ <_NupkgReadmeLines Include="$(Description)" />
+ <_NupkgReadmeLines Include="## Included tasks" />
+ <_NupkgReadmeLines Include="This package contains the following MSBuild tasks." />
+ <_NupkgReadmeLines Include="- `%(ExportTaskNames.Identity)`" />
+ <_NupkgReadmeLines Include="## Included assemblies" />
+ <_NupkgReadmeLines Include="This package contains the following assemblies." />
+ <_NupkgReadmeLines Include="- %(CoreAssemblyInformations.Identity) %(CoreAssemblyInformations.InformationalVersion)" />
+ </ItemGroup>
+
+ <WriteLinesToFile
+ File="$(NupkgReadmeFileOutputPath)"
+ Lines="@(_NupkgReadmeLines)"
+ Overwrite="true"
+ />
+ </Target>
+
+ <UsingTask
+ TaskName="GetCoreAssemblyInformationsFromLoadedAssembly"
+ TaskFactory="RoslynCodeTaskFactory"
+ AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll"
+ >
+ <ParameterGroup>
+ <AssemblyNames ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
+ <AssemblyInformations ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
+ </ParameterGroup>
+ <Task>
+ <Using Namespace="System" />
+ <Using Namespace="System.Linq" />
+ <Using Namespace="System.Reflection" />
+ <Using Namespace="System.Runtime.Versioning" />
+ <Code Type="Fragment" Language="cs"><![CDATA[
+ AssemblyInformations = AssemblyNames
+ .Select(item =>
+ AppDomain
+ .CurrentDomain
+ .GetAssemblies()
+ .First(assm => assm.GetName().Name == item.ItemSpec)
+ )
+ .Select(static assm =>
+ (
+ Name: assm.GetName().Name,
+ InformationalVersion: assm.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion,
+ TargetFramework: assm.GetCustomAttribute<TargetFrameworkAttribute>().FrameworkName
+ )
+ )
+ .Distinct()
+ .OrderBy(static info => info.Name)
+ .Select(static info =>
+ new TaskItem(
+ info.Name,
+ new Dictionary<string, string>() {
+ { nameof(info.Info...
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...