Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make SwiftPattern fully internal, instead of public in DEBUG. #213

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/IbanNet.CodeGen/IbanNet.CodeGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
<PackageReference Include="CsvHelper" Version="30.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\IbanNet\IbanNet.csproj" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Globalization;
using CsvHelper.Configuration.Attributes;
using IbanNet.CodeGen.Swift.Converters;
using IbanNet.Registry.Patterns;
using IbanNet.Registry.Swift;

namespace IbanNet.CodeGen.Swift;

Expand Down Expand Up @@ -78,6 +80,8 @@ public record IbanCsvData
[Name("IBAN structure")]
public string Pattern { get; set; } = default!;

public Pattern SwiftPattern => new SwiftPattern(Pattern);

[Name("IBAN length")]
public int Length { get; set; }

Expand Down
3 changes: 3 additions & 0 deletions src/IbanNet/Properties/AssemblyInfoAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@

[assembly: InternalsVisibleTo("IbanNet.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
#if DEBUG
[assembly: InternalsVisibleTo("IbanNet.CodeGen")]
#endif
[assembly: NeutralResourcesLanguage("en")]
[assembly: CLSCompliant(true)]
7 changes: 1 addition & 6 deletions src/IbanNet/Registry/Swift/SwiftPattern.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
namespace IbanNet.Registry.Swift;

/// <inheritdoc />
#if DEBUG
public
#else
internal
#endif
class SwiftPattern : Pattern
internal class SwiftPattern : Pattern
{
private static readonly SwiftPatternTokenizer Tokenizer = new();
private string? _pattern;
Expand Down
2 changes: 1 addition & 1 deletion src/IbanNet/Registry/Swift/SwiftRegistryProvider.tt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public class SwiftRegistryProvider : IIbanRegistryProvider
<#
foreach (var record in records)
{
var pattern = new SwiftPattern(record.Iban.Pattern);
var pattern = record.Iban.SwiftPattern;
#>

[GeneratedCode("SwiftRegistryProviderT4", "1.1-<#= registryReleaseVersion #>")]
Expand Down
Loading