Skip to content

Add OperationInvoker source generator #5337

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
33 changes: 33 additions & 0 deletions System.ServiceModel.sln
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.ServiceModel.UnixDom
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Binding.UDS.IntegrationTests", "src\System.Private.ServiceModel\tests\Scenarios\Binding\UDS\Binding.UDS.IntegrationTests.csproj", "{B7C7D4F1-DE4D-421B-9CE9-C7320A503D58}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ServiceModel.BuildTools.Roslyn4.0", "src\System.ServiceModel.BuildTools\src\System.ServiceModel.BuildTools.Roslyn4.0.csproj", "{C03919A5-503D-4FC1-A9C2-F534EE25D84B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ServiceModel.BuildTools.Roslyn3.11", "src\System.ServiceModel.BuildTools\src\System.ServiceModel.BuildTools.Roslyn3.11.csproj", "{83BB41BB-CB6E-4D32-9CD1-384FEAE88949}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ServiceModel.BuildTools.Roslyn3.11.Tests", "src\System.ServiceModel.BuildTools\tests\System.ServiceModel.BuildTools.Roslyn3.11.Tests.csproj", "{5D1B7FB8-3A9B-487F-96C0-76ACC43D98A2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ServiceModel.BuildTools.Roslyn4.0.Tests", "src\System.ServiceModel.BuildTools\tests\System.ServiceModel.BuildTools.Roslyn4.0.Tests.csproj", "{6B670970-CAD2-446E-AC83-2BF097E4CD5E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contract.Service.SourceGeneration.IntegrationTests", "src\System.Private.ServiceModel\tests\Scenarios\Contract\Service\Contract.Service.SourceGeneration.IntegrationTests.csproj", "{A82E5300-B869-45A1-8379-040D47B28103}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -259,6 +269,26 @@ Global
{B7C7D4F1-DE4D-421B-9CE9-C7320A503D58}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7C7D4F1-DE4D-421B-9CE9-C7320A503D58}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7C7D4F1-DE4D-421B-9CE9-C7320A503D58}.Release|Any CPU.Build.0 = Release|Any CPU
{C03919A5-503D-4FC1-A9C2-F534EE25D84B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C03919A5-503D-4FC1-A9C2-F534EE25D84B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C03919A5-503D-4FC1-A9C2-F534EE25D84B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C03919A5-503D-4FC1-A9C2-F534EE25D84B}.Release|Any CPU.Build.0 = Release|Any CPU
{83BB41BB-CB6E-4D32-9CD1-384FEAE88949}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{83BB41BB-CB6E-4D32-9CD1-384FEAE88949}.Debug|Any CPU.Build.0 = Debug|Any CPU
{83BB41BB-CB6E-4D32-9CD1-384FEAE88949}.Release|Any CPU.ActiveCfg = Release|Any CPU
{83BB41BB-CB6E-4D32-9CD1-384FEAE88949}.Release|Any CPU.Build.0 = Release|Any CPU
{5D1B7FB8-3A9B-487F-96C0-76ACC43D98A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D1B7FB8-3A9B-487F-96C0-76ACC43D98A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D1B7FB8-3A9B-487F-96C0-76ACC43D98A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D1B7FB8-3A9B-487F-96C0-76ACC43D98A2}.Release|Any CPU.Build.0 = Release|Any CPU
{6B670970-CAD2-446E-AC83-2BF097E4CD5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B670970-CAD2-446E-AC83-2BF097E4CD5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B670970-CAD2-446E-AC83-2BF097E4CD5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B670970-CAD2-446E-AC83-2BF097E4CD5E}.Release|Any CPU.Build.0 = Release|Any CPU
{A82E5300-B869-45A1-8379-040D47B28103}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A82E5300-B869-45A1-8379-040D47B28103}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A82E5300-B869-45A1-8379-040D47B28103}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A82E5300-B869-45A1-8379-040D47B28103}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -296,6 +326,9 @@ Global
{E8E40B62-E737-4768-82C2-039E90ED9A39} = {D6302510-AB10-4775-BCE9-98FA96FDEB76}
{88918456-A2B2-431F-BB95-BAAD2818BFC7} = {DFDC71CF-6E65-481D-99D7-C35ED7EF6D4E}
{B7C7D4F1-DE4D-421B-9CE9-C7320A503D58} = {D6302510-AB10-4775-BCE9-98FA96FDEB76}
{5D1B7FB8-3A9B-487F-96C0-76ACC43D98A2} = {DFDC71CF-6E65-481D-99D7-C35ED7EF6D4E}
{6B670970-CAD2-446E-AC83-2BF097E4CD5E} = {DFDC71CF-6E65-481D-99D7-C35ED7EF6D4E}
{A82E5300-B869-45A1-8379-040D47B28103} = {D6302510-AB10-4775-BCE9-98FA96FDEB76}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E0638FAC-BA6B-4E18-BAE6-468C3191BE58}
Expand Down
7 changes: 4 additions & 3 deletions azure-pipelines-arcade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,10 @@ stages:
- ${{ if eq(variables._RunAsPublic, True) }}:
- job: MacOS
timeoutInMinutes: 90
container: ubuntu_2004_20211215
pool:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022.amd64.open
demands: ImageOverride -equals build.Ubuntu.1804.amd64.open
variables:
- _TestArgs: /p:ServiceUri=$(_serviceUri) /p:Root_Certificate_Installed=true /p:Client_Certificate_Installed=true /p:SSL_Available=true
- _serviceUri: wcfcoresrv23.westus3.cloudapp.azure.com/WcfService$(_WcfPRServiceId)
Expand Down Expand Up @@ -257,13 +258,13 @@ stages:
- template: /eng/UpdatePRService.yml
parameters:
wcfPRServiceId: $(_WcfPRServiceId)
- script: eng\common\cibuild.cmd
- script: eng/common/cibuild.sh
-configuration $(_BuildConfig)
-preparemachine
$(_TestArgs)
/p:Test=false
displayName: MacOS Build
- powershell: eng\common\build.ps1
- powershell: eng/common/build.sh
-configuration $(_BuildConfig)
-prepareMachine
-ci
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="./Contract.Service.IntegrationTests.csproj" />

<PropertyGroup>
<LangVersion>11.0</LangVersion>
<EnableSystemServiceModelOperationInvokerGenerator>true</EnableSystemServiceModelOperationInvokerGenerator>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\..\System.ServiceModel.BuildTools\src\System.ServiceModel.BuildTools.Roslyn4.0.csproj" OutputItemType="Analyzer" />
</ItemGroup>
<ItemGroup>
<!-- Exposes EnableSystemServiceModelOperationInvokerGenerator at runtime -->
<AssemblyAttribute Include="System.ServiceModel.EnableSystemServiceModelOperationInvokerGenerator">
<_Parameter1>$(EnableSystemServiceModelOperationInvokerGenerator)</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<!-- Exposes EnableSystemServiceModelOperationInvokerGenerator at build time -->
<CompilerVisibleProperty Include="EnableSystemServiceModelOperationInvokerGenerator" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

23 changes: 23 additions & 0 deletions src/System.ServiceModel.BuildTools/src/Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.CodeAnalysis;

namespace System.ServiceModel.BuildTools
{
internal static class SymbolExtensions
{
public static AttributeData? HasAttribute(this ISymbol symbol, INamedTypeSymbol attributeTypeSymbol)
{
foreach (var attribute in symbol.GetAttributes())
{
if (SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, attributeTypeSymbol))
{
return attribute;
}
}

return null;
}
}
}
41 changes: 41 additions & 0 deletions src/System.ServiceModel.BuildTools/src/Indentor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.ServiceModel.BuildTools
{
internal sealed class Indentor
{
const string ____ = " ";
const string ________ = " ";
const string ____________ = " ";
const string ________________ = " ";
const string ____________________ = " ";
const string ________________________ = " ";
const string ____________________________ = " ";
const string ________________________________ = " ";
public int Level { get; private set; } = 0;
public void Increment()
{
Level++;
}

public void Decrement()
{
Level--;
}

public override string ToString() => Level switch
{
0 => string.Empty,
1 => ____,
2 => ________,
3 => ____________,
4 => ________________,
5 => ____________________,
6 => ________________________,
7 => ____________________________,
8 => ________________________________,
_ => throw new InvalidOperationException()
};
}
}
Loading