Skip to content

Commit

Permalink
Merge branch 'main' into satvu/ext-validation-targets
Browse files Browse the repository at this point in the history
  • Loading branch information
satvu authored Oct 10, 2024
2 parents 90575d8 + 9590def commit b03ef3c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 39 deletions.
2 changes: 1 addition & 1 deletion eng/build/WorkerExtensions.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<_ExtensionValidationLocation>$(IntermediateOutputPath)ExtensionValidation/</_ExtensionValidationLocation>
</PropertyGroup>

<Target Name="AddWebJobsExtensionInformation" BeforeTargets="CoreCompile" Condition="'@(WebJobsExtension)' != ''">
<Target Name="AddWebJobsExtensionInformation" BeforeTargets="GetAssemblyAttributes" Condition="'@(WebJobsExtension)' != ''">
<ItemGroup>
<_ExtensionInformationAttribute Include="@(WebJobsExtension->'Microsoft.Azure.Functions.Worker.Extensions.Abstractions.ExtensionInformationAttribute')">
<_Parameter1>%(WebJobsExtension.Identity)</_Parameter1>
Expand Down
8 changes: 8 additions & 0 deletions extensions/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, $(_DirectoryBuildTargetsFile)))/$(_DirectoryBuildTargetsFile)"
Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, $(_DirectoryBuildTargetsFile)))' != '' " />

<Import Project="$(TargetsRoot)WorkerExtensions.targets" />

</Project>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 6 additions & 14 deletions test/Sdk.Generator.Tests/FunctionExecutor/DependentAssemblyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,47 +101,39 @@ public DirectFunctionExecutor(global::Microsoft.Azure.Functions.Worker.IFunction
var instanceType = types["MyCompany.MyHttpTriggers"];
var i = _functionActivator.CreateInstance(instanceType, context) as global::MyCompany.MyHttpTriggers;
context.GetInvocationResult().Value = i.Foo((global::Microsoft.Azure.Functions.Worker.Http.HttpRequestData)inputArguments[0], (global::Microsoft.Azure.Functions.Worker.FunctionContext)inputArguments[1]);
goto end;
return;
}
if (string.Equals(context.FunctionDefinition.EntryPoint, "DependentAssemblyWithFunctions.DependencyFunction.Run", StringComparison.Ordinal))
{
var instanceType = types["DependentAssemblyWithFunctions.DependencyFunction"];
var i = _functionActivator.CreateInstance(instanceType, context) as global::DependentAssemblyWithFunctions.DependencyFunction;
context.GetInvocationResult().Value = i.Run((global::Microsoft.Azure.Functions.Worker.Http.HttpRequestData)inputArguments[0]);
goto end;
return;
}
if (string.Equals(context.FunctionDefinition.EntryPoint, "DependentAssemblyWithFunctions.InternalFunction.Run", StringComparison.Ordinal))
{
await _defaultExecutor.Value.ExecuteAsync(context);
goto end;
return;
}
if (string.Equals(context.FunctionDefinition.EntryPoint, "DependentAssemblyWithFunctions.StaticFunction.Run", StringComparison.Ordinal))
{
context.GetInvocationResult().Value = global::DependentAssemblyWithFunctions.StaticFunction.Run((global::Microsoft.Azure.Functions.Worker.Http.HttpRequestData)inputArguments[0], (global::Microsoft.Azure.Functions.Worker.FunctionContext)inputArguments[1]);
goto end;
return;
}
if (string.Equals(context.FunctionDefinition.EntryPoint, "MyCompany.MyProduct.MyApp.HttpFunctions.Run", StringComparison.Ordinal))
{
var instanceType = types["MyCompany.MyProduct.MyApp.HttpFunctions"];
var i = _functionActivator.CreateInstance(instanceType, context) as global::MyCompany.MyProduct.MyApp.HttpFunctions;
context.GetInvocationResult().Value = i.Run((global::Microsoft.Azure.Functions.Worker.Http.HttpRequestData)inputArguments[0]);
goto end;
return;
}
if (string.Equals(context.FunctionDefinition.EntryPoint, "MyCompany.MyProduct.MyApp.Foo.Bar.Run", StringComparison.Ordinal))
{
var instanceType = types["MyCompany.MyProduct.MyApp.Foo.Bar"];
var i = _functionActivator.CreateInstance(instanceType, context) as global::MyCompany.MyProduct.MyApp.Foo.Bar;
context.GetInvocationResult().Value = i.Run((global::Microsoft.Azure.Functions.Worker.Http.HttpRequestData)inputArguments[0]);
goto end;
return;
}
end:
return;
}
private global::Microsoft.Azure.Functions.Worker.Invocation.IFunctionExecutor CreateDefaultExecutorInstance(global::Microsoft.Azure.Functions.Worker.FunctionContext context)
Expand Down

0 comments on commit b03ef3c

Please sign in to comment.