Merge pull request #18 from nventive/dev/cdb/xml-comments

Added _xml comments_ into generated nuget packages
This commit is contained in:
Carl de Billy 2018-02-15 15:39:21 -05:00 коммит произвёл GitHub
Родитель e0247335df ec3a5ccb37
Коммит a3e927b6c9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
20 изменённых файлов: 93 добавлений и 14 удалений

Просмотреть файл

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard1.0;netstandard2.0;net46</TargetFrameworks>
<Product>Object life cycle declaration</Product>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@ -13,6 +13,7 @@
<Description>This package provides attributes for object's life cycle source code generation.
This package is part of the Uno.CodeGen to generate object life cycle methods in your project.</Description>
<RootNamespace>Uno</RootNamespace>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<Copyright>Copyright (C) 2015-2018 nventive inc. - all rights reserved</Copyright>
<PackageProjectUrl>https://github.com/nventive/Uno.CodeGen</PackageProjectUrl>
<RepositoryUrl>https://github.com/nventive/Uno.CodeGen</RepositoryUrl>

Просмотреть файл

@ -28,6 +28,12 @@ using Uno.SourceGeneration;
namespace Uno
{
/// <summary>
/// Responsible to generate equality members.
/// </summary>
/// <remarks>
/// The trigger for this generator is <see cref="GeneratedEqualityAttribute"/>.
/// </remarks>
[GenerateAfter("Uno.ImmutableGenerator")]
public class EqualityGenerator : SourceGenerator
{

Просмотреть файл

@ -15,9 +15,7 @@
//
// ******************************************************************
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
@ -25,14 +23,18 @@ using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.VisualBasic.Syntax;
using Uno.Helpers;
using Uno.RoslynHelpers;
using Uno.SourceGeneration;
using TypeSymbolExtensions = Uno.Helpers.TypeSymbolExtensions;
namespace Uno
{
/// <summary>
/// Responsible for the code generation of immutable types.
/// </summary>
/// <remarks>
/// The trigger for this generator is <see cref="GeneratedImmutableAttribute"/>.
/// </remarks>
public class ImmutableGenerator : SourceGenerator
{
private SourceGeneratorContext _context;

Просмотреть файл

@ -6,6 +6,7 @@
<NoWarn>1701;1702;1705;NU1701</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RootNamespace>Uno</RootNamespace>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<PackageProjectUrl>https://github.com/nventive/Uno.CodeGen</PackageProjectUrl>
<PackageIconUrl>https://nv-assets.azurewebsites.net/logos/uno.png</PackageIconUrl>
<RepositoryUrl>https://github.com/nventive/Uno.CodeGen</RepositoryUrl>

Просмотреть файл

@ -21,11 +21,17 @@ namespace Uno
/// </summary>
public enum CollectionComparerMode : int
{
/// <summary>
/// No special mode for comparer
/// </summary>
Default = 0,
/// <summary>
/// Use a comparer which allows for a different ordering between collections.
/// </summary>
/// <remarks>
/// This is not a flag, the flag is on `Sorted`
/// </remarks>
Unsorted = 0b0000,
/// <summary>

Просмотреть файл

@ -28,6 +28,9 @@ namespace Uno.Equality
private readonly bool _nullIsEmpty;
private readonly IEqualityComparer<TValue> _valueComparer;
/// <summary>
/// Default instance of the comparer with a default equality comparer for values.
/// </summary>
public static IEqualityComparer<TDict> Default { get; } = new DictionaryEqualityComparer<TDict, TKey, TValue>();
/// <summary>

Просмотреть файл

@ -25,8 +25,20 @@ namespace Uno
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public class EqualityComparerOptionsAttribute : Attribute
{
/// <summary>
/// Specify a special mode when it's a collection.
/// </summary>
/// <remarks>
/// No effect on non-collection fields/properties
/// </remarks>
public CollectionComparerMode CollectionMode { get; set; } = CollectionComparerMode.Default;
/// <summary>
/// Specify a special mode when it's a string.
/// </summary>
/// <remarks>
/// No effect on non-string fields/properties
/// </remarks>
public StringComparerMode StringMode { get; set; } = StringComparerMode.Default;
}
}

Просмотреть файл

@ -29,11 +29,5 @@ namespace Uno
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public class EqualityHashAttribute : Attribute
{
public EqualityMode Mode { get; }
public EqualityHashAttribute(EqualityMode mode = EqualityMode.UseEquality)
{
Mode = mode;
}
}
}

Просмотреть файл

@ -29,9 +29,13 @@ namespace Uno
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public class EqualityKeyAttribute : Attribute
{
public EqualityMode Mode { get; }
/// <summary>
/// Override for equality mode
/// </summary>
public KeyEqualityMode Mode { get; }
public EqualityKeyAttribute(EqualityMode mode = EqualityMode.UseEquality)
/// <summary />
public EqualityKeyAttribute(KeyEqualityMode mode = KeyEqualityMode.Auto)
{
Mode = mode;
}

Просмотреть файл

@ -16,9 +16,31 @@
// ******************************************************************
namespace Uno
{
public enum EqualityMode
/// <summary>
/// Mode to use for <see cref="EqualityKeyAttribute"/>
/// </summary>
public enum KeyEqualityMode
{
/// <summary>
/// Will use the KeyEquality if found on type, fallback to normal equality
/// </summary>
/// <remarks>
/// This is the default mode.
/// </remarks>
Auto,
/// <summary>
/// Delegate the key equality to the _KeyEquality_ of the member type
/// </summary>
/// <remarks>
/// Will fail if type is not implementing KeyEquality. If you're not sure
/// which you want, use `Auto`.
/// </remarks>
UseKeyEquality,
/// <summary>
/// Delegate the key equality to the _Equality_ of the member type.
/// </summary>
UseEquality
}
}

Просмотреть файл

@ -28,6 +28,9 @@ namespace Uno.Equality
private readonly bool _nullIsEmpty;
private readonly IEqualityComparer<TValue> _valueComparer;
/// <summary>
/// Default instance of the comparer with a default equality comparer for values.
/// </summary>
public static IEqualityComparer<TDict> Default { get; } = new ReadonlyDictionaryEqualityComparer<TDict, TKey, TValue>();
/// <summary>

Просмотреть файл

@ -29,6 +29,9 @@ namespace Uno.Equality
private readonly IEqualityComparer<T> _itemComparer;
private readonly bool _nullIsEmpty;
/// <summary>
/// Default instance of the comparer with a default equality comparer for items.
/// </summary>
public static IEqualityComparer<TCollection> Default { get; } = new SortedCollectionEqualityComparer<TCollection, T>();
/// <summary>

Просмотреть файл

@ -29,6 +29,9 @@ namespace Uno.Equality
private readonly IEqualityComparer<T> _itemComparer;
private readonly bool _nullIsEmpty;
/// <summary>
/// Default instance of the comparer with a default equality comparer for items.
/// </summary>
public static IEqualityComparer<TCollection> Default { get; } = new SortedReadonlyCollectionEqualityComparer<TCollection, T>();
/// <summary>

Просмотреть файл

@ -13,6 +13,7 @@
<Description>This package provides attributes for Equality source code generation.
This package is part of the Uno.CodeGen to generate equality members in your project.</Description>
<RootNamespace>Uno</RootNamespace>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<Copyright>Copyright (C) 2015-2018 nventive inc. - all rights reserved</Copyright>
<PackageProjectUrl>https://github.com/nventive/Uno.CodeGen</PackageProjectUrl>
<RepositoryUrl>https://github.com/nventive/Uno.CodeGen</RepositoryUrl>

Просмотреть файл

@ -32,6 +32,9 @@ namespace Uno.Equality
private readonly IEqualityComparer<T> _itemComparer;
private readonly bool _nullIsEmpty;
/// <summary>
/// Default instance of the comparer with a default equality comparer for items.
/// </summary>
public static IEqualityComparer<TCollection> Default { get; } = new UnsortedCollectionEqualityComparer<TCollection, T>();
/// <summary>

Просмотреть файл

@ -32,6 +32,9 @@ namespace Uno.Equality
private readonly IEqualityComparer<T> _itemComparer;
private readonly bool _nullIsEmpty;
/// <summary>
/// Default instance of the comparer with a default equality comparer for items.
/// </summary>
public static IEqualityComparer<TCollection> Default { get; } = new UnsortedReadonlyCollectionEqualityComparer<TCollection, T>();
/// <summary>

Просмотреть файл

@ -21,6 +21,9 @@ namespace Uno
/// </summary>
public interface IImmutableBuilder<out TImmutable>
{
/// <summary>
/// Get an immutable version from the current state of the mutable object.
/// </summary>
#if !NETSTANDARD1_0
[System.Diagnostics.Contracts.Pure]
#endif

Просмотреть файл

@ -32,6 +32,7 @@ namespace Uno
/// </summary>
public string AttributeToIgnoreRegex { get; }
/// <summary />
public ImmutableAttributeCopyIgnoreAttribute(string attributeToIgnoreRegex)
{
AttributeToIgnoreRegex = attributeToIgnoreRegex;

Просмотреть файл

@ -29,8 +29,15 @@ namespace Uno
[System.AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
public sealed class ImmutableBuilderAttribute : Attribute
{
/// <summary>
/// Type to use to build this entity.
/// </summary>
/// <remarks>
/// The type must implement <see cref="IImmutableBuilder{TImmutable}"/>.
/// </remarks>
public Type BuilderType { get; }
/// <summary />
public ImmutableBuilderAttribute(Type builderType)
{
BuilderType = builderType;

Просмотреть файл

@ -13,6 +13,7 @@
<Description>This package provides attributes for immutable entities source code generation.
This package is part of the Uno.CodeGen to generate immutable entities in your project.</Description>
<RootNamespace>Uno</RootNamespace>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<PackageProjectUrl>https://github.com/nventive/Uno.CodeGen</PackageProjectUrl>
<RepositoryUrl>https://github.com/nventive/Uno.CodeGen</RepositoryUrl>
<PackageIconUrl>https://nv-assets.azurewebsites.net/logos/uno.png</PackageIconUrl>