Add worker extension validation to CI (#2764)
This commit is contained in:
Родитель
f249435fc5
Коммит
afd10068fd
|
@ -11,4 +11,8 @@
|
|||
<TargetsRoot>$(EngRoot)build/</TargetsRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
|
||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<_ExtensionProjectTemplate>$(MSBuildThisFileDirectory)/extensionValidationProjectTemplate.txt</_ExtensionProjectTemplate>
|
||||
<_ExtensionValidationLocation>$(IntermediateOutputPath)ExtensionValidation/</_ExtensionValidationLocation>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="AddWebJobsExtensionInformation" BeforeTargets="GetAssemblyAttributes" Condition="'@(WebJobsExtension)' != ''">
|
||||
<ItemGroup>
|
||||
<_ExtensionInformationAttribute Include="@(WebJobsExtension->'Microsoft.Azure.Functions.Worker.Extensions.Abstractions.ExtensionInformationAttribute')">
|
||||
|
@ -8,4 +13,18 @@
|
|||
<AssemblyAttribute Include="@(_ExtensionInformationAttribute)" RemoveMetadata="Version" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="GenerateExtensionProject" AfterTargets="Compile" Condition="'@(WebJobsExtension)' != '' and '$(ContinuousIntegrationBuild)' == 'true'">
|
||||
<MakeDir Directories="$(_ExtensionValidationLocation)" />
|
||||
<WriteLinesToFile
|
||||
File="$(_ExtensionValidationLocation)ExtensionValidation.csproj"
|
||||
Lines="$([System.IO.File]::ReadAllText($(_ExtensionProjectTemplate))
|
||||
.Replace('$PackageName$', '%(WebJobsExtension.Identity)')
|
||||
.Replace('$PackageVersion$', '%(WebJobsExtension.Version)'))"
|
||||
Overwrite="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestoreGeneratedExtensionProject" AfterTargets="GenerateExtensionProject" Condition="'@(WebJobsExtension)' != '' and '$(ContinuousIntegrationBuild)' == 'true'">
|
||||
<MSBuild Projects="$(_ExtensionValidationLocation)ExtensionValidation.csproj" Targets="Restore" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="$PackageName$" Version="$PackageVersion$" />
|
||||
</ItemGroup>
|
||||
</Project>
|
Загрузка…
Ссылка в новой задаче