Skip to content

Commit af99f41

Browse files
committed
0.0.34
1 parent b2ab22a commit af99f41

11 files changed

+92
-204
lines changed

Generate-ReleaseNotes.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
rem https://github.com/StefH/GitHubReleaseNotes
22

3-
SET version=0.0.33
3+
SET version=0.0.34
44

55
GitHubReleaseNotes --output "ReleaseNotes.md" --skip-empty-releases --exclude-labels question invalid doc --version %version%
66

PackageReleaseNotes.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 0.0.33 (24 February 2023)
1+
# 0.0.34 (25 February 2023)
22
- #58 Add support for public and internal ProxyClass [enhancement]
33
- #56 Internal proxies/Proxy factory [enhancement]
44

ProxyInterfaceSourceGenerator Solution.sln

+9-8
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProxyInterfaceSourceGenerat
2424
EndProject
2525
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProxyInterfaceConsumer", "src-examples\ProxyInterfaceConsumer\ProxyInterfaceConsumer.csproj", "{7E0A10EE-CCC3-4281-9541-B0AF037D3DF9}"
2626
EndProject
27-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProxyInterfaceConsumerViaNuGet", "src-examples\ProxyInterfaceConsumerViaNuGet\ProxyInterfaceConsumerViaNuGet.csproj", "{6BEBFEB9-635F-44A2-949C-15DDDF0B7740}"
28-
EndProject
2927
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProxyInterfaceSourceGeneratorTests", "tests\ProxyInterfaceSourceGeneratorTests\ProxyInterfaceSourceGeneratorTests.csproj", "{1BDB9046-D6D1-4FB4-AAB5-F24E33EEAE0A}"
3028
EndProject
3129
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProxyInterfaceConsumerForPnP", "src-examples\ProxyInterfaceConsumerForPnP\ProxyInterfaceConsumerForPnP.csproj", "{5F7DA2C5-B908-4B57-9F5F-BADF1216D89C}"
3230
EndProject
3331
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProxyInterfaceConsumerForAkka", "src-examples\ProxyInterfaceConsumerForAkka\ProxyInterfaceConsumerForAkka.csproj", "{590908DF-A813-467A-94E4-3500020D0D54}"
3432
EndProject
33+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProxyInterfaceConsumerViaNuGet", "src-examples\ProxyInterfaceConsumerViaNuGet\ProxyInterfaceConsumerViaNuGet.csproj", "{1EA000E4-6103-4577-8D98-BDDA3BE458A2}"
34+
EndProject
3535
Global
3636
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3737
Debug|Any CPU = Debug|Any CPU
@@ -50,11 +50,6 @@ Global
5050
{7E0A10EE-CCC3-4281-9541-B0AF037D3DF9}.DebugAttach|Any CPU.ActiveCfg = Debug|Any CPU
5151
{7E0A10EE-CCC3-4281-9541-B0AF037D3DF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
5252
{7E0A10EE-CCC3-4281-9541-B0AF037D3DF9}.Release|Any CPU.Build.0 = Release|Any CPU
53-
{6BEBFEB9-635F-44A2-949C-15DDDF0B7740}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54-
{6BEBFEB9-635F-44A2-949C-15DDDF0B7740}.Debug|Any CPU.Build.0 = Debug|Any CPU
55-
{6BEBFEB9-635F-44A2-949C-15DDDF0B7740}.DebugAttach|Any CPU.ActiveCfg = Debug|Any CPU
56-
{6BEBFEB9-635F-44A2-949C-15DDDF0B7740}.Release|Any CPU.ActiveCfg = Release|Any CPU
57-
{6BEBFEB9-635F-44A2-949C-15DDDF0B7740}.Release|Any CPU.Build.0 = Release|Any CPU
5853
{1BDB9046-D6D1-4FB4-AAB5-F24E33EEAE0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5954
{1BDB9046-D6D1-4FB4-AAB5-F24E33EEAE0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
6055
{1BDB9046-D6D1-4FB4-AAB5-F24E33EEAE0A}.DebugAttach|Any CPU.ActiveCfg = DebugAttach|Any CPU
@@ -73,17 +68,23 @@ Global
7368
{590908DF-A813-467A-94E4-3500020D0D54}.DebugAttach|Any CPU.Build.0 = Debug|Any CPU
7469
{590908DF-A813-467A-94E4-3500020D0D54}.Release|Any CPU.ActiveCfg = Release|Any CPU
7570
{590908DF-A813-467A-94E4-3500020D0D54}.Release|Any CPU.Build.0 = Release|Any CPU
71+
{1EA000E4-6103-4577-8D98-BDDA3BE458A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72+
{1EA000E4-6103-4577-8D98-BDDA3BE458A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
73+
{1EA000E4-6103-4577-8D98-BDDA3BE458A2}.DebugAttach|Any CPU.ActiveCfg = Debug|Any CPU
74+
{1EA000E4-6103-4577-8D98-BDDA3BE458A2}.DebugAttach|Any CPU.Build.0 = Debug|Any CPU
75+
{1EA000E4-6103-4577-8D98-BDDA3BE458A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
76+
{1EA000E4-6103-4577-8D98-BDDA3BE458A2}.Release|Any CPU.Build.0 = Release|Any CPU
7677
EndGlobalSection
7778
GlobalSection(SolutionProperties) = preSolution
7879
HideSolutionNode = FALSE
7980
EndGlobalSection
8081
GlobalSection(NestedProjects) = preSolution
8182
{12344228-91F4-4502-9595-39584E5ABB34} = {ED3DA9DD-1E07-444B-A2D7-2DBA280F96D4}
8283
{7E0A10EE-CCC3-4281-9541-B0AF037D3DF9} = {38BA087F-EDA1-4F8A-A140-85B84791B815}
83-
{6BEBFEB9-635F-44A2-949C-15DDDF0B7740} = {38BA087F-EDA1-4F8A-A140-85B84791B815}
8484
{1BDB9046-D6D1-4FB4-AAB5-F24E33EEAE0A} = {19009F5B-3267-45E2-A8B6-89F2AB47D72C}
8585
{5F7DA2C5-B908-4B57-9F5F-BADF1216D89C} = {38BA087F-EDA1-4F8A-A140-85B84791B815}
8686
{590908DF-A813-467A-94E4-3500020D0D54} = {38BA087F-EDA1-4F8A-A140-85B84791B815}
87+
{1EA000E4-6103-4577-8D98-BDDA3BE458A2} = {38BA087F-EDA1-4F8A-A140-85B84791B815}
8788
EndGlobalSection
8889
GlobalSection(ExtensibilityGlobals) = postSolution
8990
SolutionGuid = {585F071D-051D-441C-9C6B-226D9E15A1F5}

ReleaseNotes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 0.0.33 (24 February 2023)
1+
# 0.0.34 (25 February 2023)
22
- [#58](https://github.com/StefH/ProxyInterfaceSourceGenerator/pull/58) - Add support for public and internal ProxyClass [enhancement] contributed by [StefH](https://github.com/StefH)
33
- [#56](https://github.com/StefH/ProxyInterfaceSourceGenerator/issues/56) - Internal proxies/Proxy factory [enhancement]
44

src-examples/ProxyInterfaceConsumer/IPerson.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
using ProxyInterfaceGenerator;
2+
13
namespace ProxyInterfaceConsumer
24
{
3-
[ProxyInterfaceGenerator.Proxy(typeof(ProxyInterfaceConsumer.Person))]
5+
[Proxy(typeof(ProxyInterfaceConsumer.Person), ProxyClassAccessibility.Internal)]
46
public partial interface IPerson
57
{
68
}

src-examples/ProxyInterfaceConsumerViaNuGet/IPerson.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
namespace ProxyInterfaceConsumer
1+
namespace ProxyInterfaceConsumer
22
{
3-
[ProxyInterfaceGenerator.Proxy(typeof(ProxyInterfaceConsumer.Person))]
3+
[ProxyInterfaceGenerator.Proxy(typeof(ProxyInterfaceConsumer.Person), ProxyClassAccessibility.Internal))]
44
public partial interface IPerson
55
{
66
}

src-examples/ProxyInterfaceConsumerViaNuGet/PersonProxy2.cs

-119
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net5.0</TargetFramework>
6-
<AssemblyName>ProxyInterfaceConsumer</AssemblyName>
7-
<RootNamespace>ProxyInterfaceConsumer</RootNamespace>
8-
</PropertyGroup>
9-
10-
<ItemGroup>
11-
<PackageReference Include="ProxyInterfaceGenerator" Version="0.0.10" />
12-
</ItemGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net7.0</TargetFramework>
6+
<AssemblyName>ProxyInterfaceConsumer</AssemblyName>
7+
<RootNamespace>ProxyInterfaceConsumer</RootNamespace>
8+
<Nullable>enable</Nullable>
9+
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="AutoMapper" Version="12.0.1" />
14+
<PackageReference Include="Mapster" Version="7.3.0" />
15+
<PackageReference Include="ProxyInterfaceGenerator" Version="0.0.32" />
16+
</ItemGroup>
1317

1418
</Project>
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
using ProxyInterfaceSourceGenerator.Models;
2-
3-
namespace ProxyInterfaceSourceGenerator.FileGenerators;
4-
5-
internal class ProxyAttributeGenerator : IFileGenerator
6-
{
7-
private const string ClassName = "ProxyAttribute";
8-
9-
public FileData GenerateFile()
10-
{
11-
return new FileData($"ProxyInterfaceGenerator.{ClassName}.g.cs", $@"//----------------------------------------------------------------------------------------
12-
// <auto-generated>
13-
// This code was generated by https://github.com/StefH/ProxyInterfaceSourceGenerator.
14-
//
15-
// Changes to this file may cause incorrect behavior and will be lost if
16-
// the code is regenerated.
17-
// </auto-generated>
18-
//----------------------------------------------------------------------------------------
19-
20-
using System;
21-
22-
namespace ProxyInterfaceGenerator
23-
{{
24-
[AttributeUsage(AttributeTargets.Interface)]
25-
public class {ClassName} : Attribute
26-
{{
27-
public Type Type {{ get; }}
28-
public bool ProxyBaseClasses {{ get; }}
29-
public ProxyClassAccessibility Accessibility {{ get; }}
30-
31-
public {ClassName}(Type type) : this(type, false, ProxyClassAccessibility.Public)
32-
{{
33-
}}
34-
35-
public {ClassName}(Type type, bool proxyBaseClasses) : this(type, proxyBaseClasses, ProxyClassAccessibility.Public)
36-
{{
37-
}}
38-
39-
public {ClassName}(Type type, ProxyClassAccessibility accessibility) : this(type, false, accessibility)
40-
{{
41-
}}
42-
43-
public {ClassName}(Type type, bool proxyBaseClasses, ProxyClassAccessibility accessibility)
44-
{{
45-
Type = type;
46-
ProxyBaseClasses = proxyBaseClasses;
47-
Accessibility = accessibility;
48-
}}
49-
}}
50-
51-
[Flags]
52-
public enum ProxyClassAccessibility
53-
{{
54-
Public = 0,
55-
56-
Internal = 1
57-
}}
58-
}}");
59-
}
1+
using ProxyInterfaceSourceGenerator.Models;
2+
3+
namespace ProxyInterfaceSourceGenerator.FileGenerators;
4+
5+
internal class ExtraFilesGenerator : IFileGenerator
6+
{
7+
private const string Name = "ProxyInterfaceGenerator.Extra.g.cs";
8+
9+
public FileData GenerateFile()
10+
{
11+
return new FileData($"{Name}", $@"//----------------------------------------------------------------------------------------
12+
// <auto-generated>
13+
// This code was generated by https://github.com/StefH/ProxyInterfaceSourceGenerator.
14+
//
15+
// Changes to this file may cause incorrect behavior and will be lost if
16+
// the code is regenerated.
17+
// </auto-generated>
18+
//----------------------------------------------------------------------------------------
19+
20+
using System;
21+
22+
namespace ProxyInterfaceGenerator
23+
{{
24+
[AttributeUsage(AttributeTargets.Interface)]
25+
internal sealed class ProxyAttribute : Attribute
26+
{{
27+
public Type Type {{ get; }}
28+
public bool ProxyBaseClasses {{ get; }}
29+
public ProxyClassAccessibility Accessibility {{ get; }}
30+
31+
public ProxyAttribute(Type type) : this(type, false, ProxyClassAccessibility.Public)
32+
{{
33+
}}
34+
35+
public ProxyAttribute(Type type, bool proxyBaseClasses) : this(type, proxyBaseClasses, ProxyClassAccessibility.Public)
36+
{{
37+
}}
38+
39+
public ProxyAttribute(Type type, ProxyClassAccessibility accessibility) : this(type, false, accessibility)
40+
{{
41+
}}
42+
43+
public ProxyAttribute(Type type, bool proxyBaseClasses, ProxyClassAccessibility accessibility)
44+
{{
45+
Type = type;
46+
ProxyBaseClasses = proxyBaseClasses;
47+
Accessibility = accessibility;
48+
}}
49+
}}
50+
51+
[Flags]
52+
internal enum ProxyClassAccessibility
53+
{{
54+
Public = 0,
55+
56+
Internal = 1
57+
}}
58+
}}");
59+
}
6060
}

src/ProxyInterfaceSourceGenerator/ProxyInterfaceCodeGenerator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace ProxyInterfaceSourceGenerator;
1616
#endif
1717
class ProxyInterfaceCodeGenerator : ISourceGenerator
1818
{
19-
private readonly ProxyAttributeGenerator _proxyAttributeGenerator = new ();
19+
private readonly ExtraFilesGenerator _proxyAttributeGenerator = new ();
2020

2121
public void Initialize(GeneratorInitializationContext context)
2222
{

src/ProxyInterfaceSourceGenerator/ProxyInterfaceSourceGenerator.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Version>0.0.33</Version>
4+
<Version>0.0.34</Version>
55
<TargetFramework>netstandard2.0</TargetFramework>
66
<ProjectGuid>{12344228-91F4-4502-9595-39584E5ABB34}</ProjectGuid>
77
<LangVersion>10</LangVersion>

0 commit comments

Comments
 (0)