Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
beakona committed Mar 27, 2022
1 parent 16dc8a6 commit 45cec73
Show file tree
Hide file tree
Showing 47 changed files with 2,065 additions and 2,267 deletions.
7 changes: 1 addition & 6 deletions AutoInterface.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ VisualStudioVersion = 17.1.32319.34
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeaKona.AutoInterfaceGenerator", "BeaKona.AutoInterfaceGenerator\BeaKona.AutoInterfaceGenerator.csproj", "{FF7DF2CF-FA1C-4655-B451-B6FD1E374E3A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeaKona.AutoInterfaceGeneratorTest", "BeaKona.AutoInterfaceGeneratorTest\BeaKona.AutoInterfaceGeneratorTest.csproj", "{5879D401-B910-4377-BD93-DFAF5CCCAAD0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoInterfaceSample", "AutoInterfaceSample\AutoInterfaceSample.csproj", "{D80AD027-6463-4CBB-91B5-4952AE0204B3}"
ProjectSection(ProjectDependencies) = postProject
{FF7DF2CF-FA1C-4655-B451-B6FD1E374E3A} = {FF7DF2CF-FA1C-4655-B451-B6FD1E374E3A}
Expand All @@ -19,7 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeaKona.AutoInterfaceAttributes", "BeaKona.AutoInterfaceAttributes\BeaKona.AutoInterfaceAttributes.csproj", "{8EB5E4A3-F09E-42A8-9846-C000B2D5286C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeaKona.AutoInterfaceAttributes", "BeaKona.AutoInterfaceAttributes\BeaKona.AutoInterfaceAttributes.csproj", "{8EB5E4A3-F09E-42A8-9846-C000B2D5286C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -31,9 +29,6 @@ Global
{FF7DF2CF-FA1C-4655-B451-B6FD1E374E3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF7DF2CF-FA1C-4655-B451-B6FD1E374E3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF7DF2CF-FA1C-4655-B451-B6FD1E374E3A}.Release|Any CPU.Build.0 = Release|Any CPU
{5879D401-B910-4377-BD93-DFAF5CCCAAD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5879D401-B910-4377-BD93-DFAF5CCCAAD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5879D401-B910-4377-BD93-DFAF5CCCAAD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D80AD027-6463-4CBB-91B5-4952AE0204B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D80AD027-6463-4CBB-91B5-4952AE0204B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D80AD027-6463-4CBB-91B5-4952AE0204B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
11 changes: 6 additions & 5 deletions AutoInterfaceSample/AutoInterfaceSample.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand All @@ -14,9 +14,10 @@
<AdditionalFiles Include="mytemplate.scriban" />
</ItemGroup>

<ItemGroup>
<Analyzer Include="..\BeaKona.AutoInterfaceGenerator\bin\Debug\netstandard2.0\BeaKona.AutoInterfaceGenerator.dll" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\BeaKona.AutoInterfaceGenerator\bin\Debug\netstandard2.0\BeaKona.AutoInterfaceGenerator.dll" />
<ProjectReference Include="..\BeaKona.AutoInterfaceAttributes\BeaKona.AutoInterfaceAttributes.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="true" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\TestInterfaces\TestInterfaces.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions AutoInterfaceSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public class Program
public static void Main()
{
//System.Diagnostics.Debug.WriteLine(BeaKona.Output.Debug_Person.Info);
IPrintable<int> p = new Person();
p.Print1();
//IPrintable<int> p = new Person();
//p.Print1();
}
}

Expand Down
2 changes: 1 addition & 1 deletion BeaKona.AutoInterfaceAttributes/AutoInterfaceAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ public AutoInterfaceAttribute(Type type)
public string? TemplateLanguage { get; set; }
public string? TemplateBody { get; set; }
public string? TemplateFileName { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ public AutoInterfaceTemplateAttribute(AutoInterfaceTargets targets)
public string? Language { get; set; }
public string? Body { get; set; }
public string? FileName { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<PackageId>BeaKona.AutoInterfaceAttributes</PackageId>
<Authors>BeaKona</Authors>
<Description>Shared BeaKona.AutoInterface source generator attributes.</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/beakona/AutoInterface</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>1.0.0</Version>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
</PropertyGroup>

</Project>
37 changes: 17 additions & 20 deletions BeaKona.AutoInterfaceGenerator/AutoInterfaceRecord.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
using BeaKona.AutoInterfaceGenerator.Templates;
using Microsoft.CodeAnalysis;
using System.Collections.Generic;

namespace BeaKona.AutoInterfaceGenerator
namespace BeaKona.AutoInterfaceGenerator;

internal sealed class AutoInterfaceRecord : IMemberInfo
{
internal sealed class AutoInterfaceRecord : IMemberInfo
public AutoInterfaceRecord(ISymbol member, ITypeSymbol receiverType, INamedTypeSymbol interfaceType, TemplateDefinition? template, List<PartialTemplate> templateParts)
{
public AutoInterfaceRecord(ISymbol member, ITypeSymbol receiverType, INamedTypeSymbol interfaceType, TemplateDefinition? template, List<PartialTemplate> templateParts)
{
this.Member = member;
this.ReceiverType = receiverType;
this.InterfaceType = interfaceType;
this.Template = template;
this.TemplateParts = templateParts?.ToArray() ?? new PartialTemplate[0];
}

public ISymbol Member { get; }
public ITypeSymbol ReceiverType { get; }
public INamedTypeSymbol InterfaceType { get; }
public TemplateDefinition? Template { get; }
public PartialTemplate[] TemplateParts { get; }
public bool CastRequired => this.InterfaceType.Equals(this.ReceiverType, SymbolEqualityComparer.Default) == false;
this.Member = member;
this.ReceiverType = receiverType;
this.InterfaceType = interfaceType;
this.Template = template;
this.TemplateParts = templateParts?.ToArray() ?? new PartialTemplate[0];
}
}

public ISymbol Member { get; }
public ITypeSymbol ReceiverType { get; }
public INamedTypeSymbol InterfaceType { get; }
public TemplateDefinition? Template { get; }
public PartialTemplate[] TemplateParts { get; }
public bool CastRequired => this.InterfaceType.Equals(this.ReceiverType, SymbolEqualityComparer.Default) == false;
}
Loading

0 comments on commit 45cec73

Please sign in to comment.