-
Notifications
You must be signed in to change notification settings - Fork 201
Add extension validation step to CI #2756
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
Changes from all commits
a418689
13d72f6
56eab95
9719aa0
e8031c2
51cb7e7
a2e05fa
ec6f879
6043e22
36dc5c2
3845e31
04aab25
866eb54
aad77f0
e80cc1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <Project> | ||
|
|
||
| <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, $(_DirectoryBuildTargetsFile)))/$(_DirectoryBuildTargetsFile)" | ||
| Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, $(_DirectoryBuildTargetsFile)))' != '' " /> | ||
|
|
||
| <Import Project="$(MSBuildThisFileDirectory)extensionValidation/GenerateExtensionValidationProjects.targets" /> | ||
|
|
||
| <Target Name="AddWebJobsExtensionInformation" BeforeTargets="CoreCompile" Condition="'@(WebJobsExtension)' != ''"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: move this target into |
||
| <ItemGroup> | ||
| <_ExtensionInformationAttribute Include="@(WebJobsExtension->'Microsoft.Azure.Functions.Worker.Extensions.Abstractions.ExtensionInformationAttribute')"> | ||
| <_Parameter1>%(WebJobsExtension.Identity)</_Parameter1> | ||
| <_Parameter2>%(WebJobsExtension.Version)</_Parameter2> | ||
| </_ExtensionInformationAttribute> | ||
| <AssemblyAttribute Include="@(_ExtensionInformationAttribute)" RemoveMetadata="Version" /> | ||
| </ItemGroup> | ||
| </Target> | ||
|
|
||
| </Project> | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you move this to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For importing, in the root <PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<EngRoot>$(RepoRoot)eng/</EngRoot>
<TargetsRoot>$(EngRoot)build/</TargetsRoot>
</PropertyGroup>You can then use |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,19 @@ | ||||||
| <Project> | ||||||
| <PropertyGroup> | ||||||
| <_ExtensionProjectTemplate>$(MSBuildThisFileDirectory)\extensionProjectTemplate.txt</_ExtensionProjectTemplate> | ||||||
| </PropertyGroup> | ||||||
|
|
||||||
| <Target Name="GenerateExtensionProject" AfterTargets="Compile" Condition="'@(WebJobsExtension)' != ''"> | ||||||
| <MakeDir Directories="$(IntermediateOutputPath)ExtensionValidation" /> | ||||||
| <WriteLinesToFile | ||||||
| File="$(IntermediateOutputPath)ExtensionValidation\ExtensionValidation.csproj" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could pull |
||||||
| Lines="$([System.IO.File]::ReadAllText($(_ExtensionProjectTemplate)) | ||||||
| .Replace('$PackageName$', '%(WebJobsExtension.Identity)') | ||||||
| .Replace('$PackageVersion$', '%(WebJobsExtension.Version)'))" | ||||||
| Overwrite="true" /> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fine for now, but we may want to do some work for incremental build support. There are a few ways to do it, but primarily you want to only write to files if their contents have actually changed. By not writing to the csproj if it has not changed, restore will no-op as it will be already up to date. |
||||||
| </Target> | ||||||
|
|
||||||
| <Target Name="BuildGeneratedExtensionProject" AfterTargets="GenerateExtensionProject" Condition="'@(WebJobsExtension)' != ''"> | ||||||
| <MSBuild Projects="$(IntermediateOutputPath)\ExtensionValidation\ExtensionValidation.csproj" Targets="Restore;Build" /> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small nit: use forward slashes I think we only need to restore to get the
Suggested change
|
||||||
| </Target> | ||||||
| </Project> | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit on naming: Directory.Build.targets (lowercase t)