Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmarbach committed Nov 8, 2019
1 parent 31a2932 commit ccb5a3a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
32 changes: 32 additions & 0 deletions src/PublicApiGenerator/ApiGeneratorOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,46 @@

namespace PublicApiGenerator
{
/// <summary>
/// Options to influence the ApiGenerator
/// </summary>
public class ApiGeneratorOptions
{
/// <summary>
/// Allows to control which types of the generated assembly should be included. If this option is specified all other types found in the assembly that are not present here will be exclude.
/// </summary>
public Type[]? IncludeTypes { get; set; }

/// <summary>
/// Instructs the generator to include assembly level attributes.
/// </summary>
/// <remarks>Defaults to true</remarks>
public bool IncludeAssemblyAttributes { get; set; } = true;

/// <summary>
/// Allows to whitelist certain namespace prefixes. For example by default types found in Microsoft or System namespaces are not treated as part of the public API.
/// </summary>
/// <example>
/// <code>
/// var options = new DefaultApiGeneratorOptions
/// {
/// WhitelistedNamespacePrefixes = new[] {"Microsoft.Whitelisted" }
/// };
/// </code>
/// </example>
public string[] WhitelistedNamespacePrefixes { get; set; } = DefaultWhitelistedNamespacePrefixes;

/// <summary>
/// Allows to exclude attributes by specifying the fullname of the attribute to exclude.
/// </summary>
/// <example>
///<code>
/// var options = new DefaultApiGeneratorOptions
/// {
/// ExcludeAttributes = new[] { "PublicApiGeneratorTests.Examples.SimpleAttribute" }
/// };
/// </code>
/// </example>
public string[]? ExcludeAttributes { get; set; }

static readonly string[] DefaultWhitelistedNamespacePrefixes = Array.Empty<string>();
Expand Down
1 change: 0 additions & 1 deletion src/PublicApiGeneratorTests/Interface_event_attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public void Should_skip_excluded_attribute()
ExcludeAttributes = new[] { "PublicApiGeneratorTests.Examples.SimpleAttribute" }
};


AssertPublicApi<IInterfaceWithEventWithAttribute>(
@"namespace PublicApiGeneratorTests.Examples
{
Expand Down

0 comments on commit ccb5a3a

Please sign in to comment.