Skip to content

Commit

Permalink
mark generated objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
sang-hyeon committed Nov 16, 2023
1 parent 6b4ef64 commit 694237a
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/PlasticCommand/GeneratedByPlasticCommandAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;

namespace PlasticCommand;

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
public class GeneratedByPlasticCommandAttribute : Attribute
{
public GeneratedByPlasticCommandAttribute()
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ namespace Templates // replace: to {{ Namespace }}
using TargetCommandSpec = PlasticCommand.Generator.TTFFCommandSpec;

// replace: internal to public
[GeneratedByPlasticCommand]
internal interface TTFFGeneratedCommandInterface : ICommandSpecification<Generator.TTFFParameter, Generator.TTFFResult>
{
/// <inheritdoc cref="{{XmlComment}}"/>
Task<Generator.TTFFResult> ExecuteAsync(
Generator.TTFFParameter TTFFParamName, CancellationToken token = default);
}

// replace: internal to public
[GeneratedByPlasticCommand]
internal class TTFFCommand : TTFFGeneratedCommandInterface
{
private readonly IServiceProvider _provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ namespace {{ Namespace }}
using Generator = PlasticCommand.Generator;
using TargetCommandSpec = PlasticCommand.Generator.TTFFCommandSpec;

[GeneratedByPlasticCommand]
public interface TTFFGeneratedCommandInterface : ICommandSpecification<Generator.TTFFParameter, Generator.TTFFResult>
{
/// <inheritdoc cref="{{XmlComment}}"/>
Task<Generator.TTFFResult> ExecuteAsync(
Generator.TTFFParameter TTFFParamName, CancellationToken token = default);
}

[GeneratedByPlasticCommand]
public sealed class TTFFCommand : TTFFGeneratedCommandInterface
{
private readonly IServiceProvider _provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ namespace Templates // replace: to {{ Namespace }}
using TargetCommandSpec = PlasticCommand.Generator.TTFFValidatableCommandSpec;

// replace: internal to public
[GeneratedByPlasticCommand]
internal interface TTFFGeneratedValidatableCommandInterface
: ICommandSpecificationWithValidation<Generator.TTFFParameter, Generator.TTFFResult, Generator.TTFFValidationResult>
{
}

// replace: internal to public
[GeneratedByPlasticCommand]
internal class TTFFValidatableCommand : TTFFGeneratedValidatableCommandInterface
{
private readonly IServiceProvider _provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ namespace {{ Namespace }}
using Generator = PlasticCommand.Generator;
using TargetCommandSpec = PlasticCommand.Generator.TTFFValidatableCommandSpec;

[GeneratedByPlasticCommand]
public interface TTFFGeneratedValidatableCommandInterface
: ICommandSpecificationWithValidation<Generator.TTFFParameter, Generator.TTFFResult, Generator.TTFFValidationResult>
{
}

[GeneratedByPlasticCommand]
public class TTFFValidatableCommand : TTFFGeneratedValidatableCommandInterface
{
private readonly IServiceProvider _provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace PlasticCommand.Generated.Group
{
// replace: internal to public
[GeneratedByPlasticCommand]
internal class TTFFCommands
{
// {{Members}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#nullable enable
namespace PlasticCommand.Generated.Group
{
[GeneratedByPlasticCommand]
public class TTFFCommands
{
{{Members}}
Expand Down
2 changes: 1 addition & 1 deletion src/PlasticCommand/PlasticCommand.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<!-- metadata -->
<PropertyGroup>
<Version>2.5.1</Version>
<Version>2.6.1</Version>
<NeutralLanguage>en-US</NeutralLanguage>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>SangHyeon.Kim</Authors>
Expand Down

0 comments on commit 694237a

Please sign in to comment.