From 7b55e1417ebf56a9635d1c21a15d355ee571d440 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Thu, 24 Aug 2023 09:38:08 -0700 Subject: [PATCH 01/10] Refactor SDK targets for optimized build --- DotNetWorker.sln | 7 + samples/Net7Worker/Net7Worker.csproj | 4 +- sdk/Sdk/ExtensionsCsprojGenerator.cs | 7 +- ...crosoft.Azure.Functions.Worker.Sdk.targets | 568 +++++------------- sdk/Sdk/Tasks/EnhanceExtensionsMetadata.cs | 2 - 5 files changed, 174 insertions(+), 414 deletions(-) diff --git a/DotNetWorker.sln b/DotNetWorker.sln index a0ce8d085..102591a1b 100644 --- a/DotNetWorker.sln +++ b/DotNetWorker.sln @@ -134,6 +134,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.Tests", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetIntegration", "samples\AspNetIntegration\AspNetIntegration.csproj", "{D2F67410-9933-42E8-B04A-E17634D83A30}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Net7Worker", "samples\Net7Worker\Net7Worker.csproj", "{EC1A321B-70F6-420B-85D4-56C7869BB71B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -332,6 +334,10 @@ Global {D2F67410-9933-42E8-B04A-E17634D83A30}.Debug|Any CPU.Build.0 = Debug|Any CPU {D2F67410-9933-42E8-B04A-E17634D83A30}.Release|Any CPU.ActiveCfg = Release|Any CPU {D2F67410-9933-42E8-B04A-E17634D83A30}.Release|Any CPU.Build.0 = Release|Any CPU + {EC1A321B-70F6-420B-85D4-56C7869BB71B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC1A321B-70F6-420B-85D4-56C7869BB71B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC1A321B-70F6-420B-85D4-56C7869BB71B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC1A321B-70F6-420B-85D4-56C7869BB71B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -390,6 +396,7 @@ Global {286F9EE3-00AE-4EFA-BFD8-A2E58BC809D2} = {FD7243E4-BF18-43F8-8744-BA1D17ACF378} {17BDCE12-6964-4B87-B2AC-68CE270A3E9A} = {FD7243E4-BF18-43F8-8744-BA1D17ACF378} {D2F67410-9933-42E8-B04A-E17634D83A30} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6} + {EC1A321B-70F6-420B-85D4-56C7869BB71B} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {497D2ED4-A13E-4BCA-8D29-F30CA7D0EA4A} diff --git a/samples/Net7Worker/Net7Worker.csproj b/samples/Net7Worker/Net7Worker.csproj index 1cfd5f1d6..3b41e3014 100644 --- a/samples/Net7Worker/Net7Worker.csproj +++ b/samples/Net7Worker/Net7Worker.csproj @@ -7,9 +7,9 @@ enable - + - + diff --git a/sdk/Sdk/ExtensionsCsprojGenerator.cs b/sdk/Sdk/ExtensionsCsprojGenerator.cs index ad565f787..c54553c9c 100644 --- a/sdk/Sdk/ExtensionsCsprojGenerator.cs +++ b/sdk/Sdk/ExtensionsCsprojGenerator.cs @@ -32,16 +32,13 @@ public void Generate() var extensionsCsprojFilePath = Path.Combine(_outputPath, ExtensionsProjectName); string csproj = GetCsProjContent(); - - // Incremental build support: write the new csproj only if contents have changed. - // By keeping one from a previous build around, our restore & build has a chance - // to follow incremental build and no-op if nothing needs to be done. if (File.Exists(extensionsCsprojFilePath)) { string existing = File.ReadAllText(extensionsCsprojFilePath); if (string.Equals(csproj, existing, StringComparison.Ordinal)) { - // Up to date, nothing to do. + // If contents are the same, only touch the file to update timestamp. + File.SetLastWriteTimeUtc(extensionsCsprojFilePath, DateTime.UtcNow); return; } } diff --git a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets index 77767d968..5e6805721 100644 --- a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets +++ b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets @@ -8,429 +8,187 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and *********************************************************************************************** --> - - - <_ToolingSuffix> - <_AzureFunctionsNotSet Condition="'$(AzureFunctionsVersion)' == ''">true - v3 - <_ToolingSuffix Condition="($(AzureFunctionsVersion.StartsWith('v3',StringComparison.OrdinalIgnoreCase)) Or $(AzureFunctionsVersion.StartsWith('v4',StringComparison.OrdinalIgnoreCase))) And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(TargetFrameworkVersion)' == 'v5.0'">net5-isolated - <_ToolingSuffix Condition="$(AzureFunctionsVersion.StartsWith('v4',StringComparison.OrdinalIgnoreCase)) And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(TargetFrameworkVersion)' == 'v6.0'">net6-isolated - <_ToolingSuffix Condition="$(AzureFunctionsVersion.StartsWith('v4',StringComparison.OrdinalIgnoreCase)) And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(TargetFrameworkVersion)' == 'v7.0'">net7-isolated - <_ToolingSuffix Condition="$(AzureFunctionsVersion.StartsWith('v4',StringComparison.OrdinalIgnoreCase)) And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(TargetFrameworkVersion)' == 'v8.0'">net8-isolated - <_ToolingSuffix Condition="$(AzureFunctionsVersion.StartsWith('v4',StringComparison.OrdinalIgnoreCase)) And '$(TargetFrameworkIdentifier)' == '.NETFramework'">netfx-isolated - $(_ToolingSuffix) - <_FunctionsTaskFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">netstandard2.0 - <_FunctionsTaskFramework Condition=" '$(_FunctionsTaskFramework)' == ''">net472 - <_FunctionsTasksDir Condition=" '$(_FunctionsTasksDir)'=='' ">$(MSBuildThisFileDirectory)..\tools\$(_FunctionsTaskFramework)\ - <_FunctionsTaskAssemblyFullPath Condition=" '$(_FunctionsTaskAssemblyFullPath)'=='' ">$(_FunctionsTasksDir)\Microsoft.Azure.Functions.Worker.Sdk.dll - - <_FunctionsWorkerConfigInputFile>$(MSBuildThisFileDirectory)\..\tools\worker.config.json - - <_FunctionsMetadataLoaderExtensionFile>$(MSBuildThisFileDirectory)\..\tools\netstandard2.0\Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader.dll - <_FunctionsExtensionsDirectory>.azurefunctions - <_FunctionsExtensionsJsonName>extensions.json - <_FunctionsExtensionsFullPublish Condition="$(NoBuild) == '' And $(_FunctionsExtensionsFullPublish) == ''">True - <_FunctionsExtensionsFullPublish Condition="$(_FunctionsExtensionsFullPublish) == ''">!$(NoBuild) - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed.Functions\ - - false - true - false - true - false - true - true - false - true - - - - - - - - - - - - - - - - - - - - - - - - <_FunctionsWorkerConfigOutputFile>$(TargetDir)\worker.config.json - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)WorkExtensions)) - - - - - - - - - - - - - - - - - - - - - - - - - + + + <_ToolingSuffix> + <_AzureFunctionsNotSet Condition="'$(AzureFunctionsVersion)' == ''">true + v3 + <_ToolingSuffix Condition="($(AzureFunctionsVersion.StartsWith('v3',StringComparison.OrdinalIgnoreCase)) Or $(AzureFunctionsVersion.StartsWith('v4',StringComparison.OrdinalIgnoreCase))) And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(TargetFrameworkVersion)' == 'v5.0'">net5-isolated + <_ToolingSuffix Condition="$(AzureFunctionsVersion.StartsWith('v4',StringComparison.OrdinalIgnoreCase)) And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(TargetFrameworkVersion)' == 'v6.0'">net6-isolated + <_ToolingSuffix Condition="$(AzureFunctionsVersion.StartsWith('v4',StringComparison.OrdinalIgnoreCase)) And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(TargetFrameworkVersion)' == 'v7.0'">net7-isolated + <_ToolingSuffix Condition="$(AzureFunctionsVersion.StartsWith('v4',StringComparison.OrdinalIgnoreCase)) And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(TargetFrameworkVersion)' == 'v8.0'">net8-isolated + <_ToolingSuffix Condition="$(AzureFunctionsVersion.StartsWith('v4',StringComparison.OrdinalIgnoreCase)) And '$(TargetFrameworkIdentifier)' == '.NETFramework'">netfx-isolated + $(_ToolingSuffix) + <_FunctionsTaskFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">netstandard2.0 + <_FunctionsTaskFramework Condition=" '$(_FunctionsTaskFramework)' == ''">net472 + <_FunctionsTasksDir Condition=" '$(_FunctionsTasksDir)'=='' ">$(MSBuildThisFileDirectory)..\tools\$(_FunctionsTaskFramework)\ + <_FunctionsTaskAssemblyFullPath Condition=" '$(_FunctionsTaskAssemblyFullPath)'=='' ">$(_FunctionsTasksDir)\Microsoft.Azure.Functions.Worker.Sdk.dll + + <_FunctionsExtensionCommonProps>ImportDirectoryBuildProps=false;ImportDirectoryBuildTargets=false;ImportDirectoryPackagesProps=false + <_FunctionsWorkerConfigInputFile>$(MSBuildThisFileDirectory)\..\tools\worker.config.json + + <_FunctionsMetadataLoaderExtensionFile>$(MSBuildThisFileDirectory)\..\tools\netstandard2.0\Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader.dll + <_FunctionsExtensionsDirectory>.azurefunctions + <_FunctionsExtensionsJsonName>extensions.json + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed.Functions\ + + false + true + false + true + false + true + true + false + true + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_FilesInTargetDir Include="$(TargetDir)**\*" /> - - - - - - - - - - - - - - - - - $(FunctionsDir) - $(PublishDir)\ - $(PublishDir)bin\$(TargetFileName) - $(FunctionsDir) - - - - - - - - - - - - $(PublishIntermediateOutputPath) - $(PublishDir)\ - $(PublishDir)bin\$(TargetFileName) - $(PublishIntermediateOutputPath) - - - - - <_PublishTempFiles Include="$(PublishIntermediateOutputPath)**\*.*" /> - - - - - - - - - - - - - - - + - - _InitializeDeployOnBuildProperties; - Publish; - $(_DotNetPublishFiles); - + <_FunctionsMetadataPath>$(IntermediateOutputPath)functions.metadata + <_FunctionsWorkerConfigPath>$(IntermediateOutputPath)worker.config.json + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)WorkExtensions)) + $([System.IO.Path]::Combine($(ExtensionsCsProjDirectory), WorkerExtensions.csproj)) + <_FunctionsIntermdiateExtensionJsonPath>$(ExtensionsCsProjDirectory)\buildout\bin\$(_FunctionsExtensionsJsonName) + <_FunctionsIntermdiateExtensionUpdatedJsonPath>$(IntermediateOutputPath)$(_FunctionsExtensionsJsonName) + - - - - - - $(PublishDir)\worker.config.json - $([System.IO.Path]::Combine($([System.IO.Path]::GetTempPath()), $([System.IO.Path]::GetRandomFileName()))) - - - - - - - - - - - - - $(PublishDir)\worker.config.json - $([System.IO.Path]::Combine($([System.IO.Path]::GetTempPath()), $([System.IO.Path]::GetRandomFileName()))) - + + + + + + + - + + + + + - + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - _GenerateFunctionsAndCopyContentFiles; - _WorkerExtensionsRestorePublish; - _WorkerExtensionsFullPublish; - _WorkerExtensionsPublishCopy; - _EnhanceFunctionsExtensionsMetadataPostPublish - - - _GenerateFunctionsAndCopyContentFiles; - _WorkerExtensionsPublishCopyNoBuild - - + + + - - + + + - + + + - + + + <_ExtensionBinaries Include="$(ExtensionsCsProjDirectory)\buildout\bin\**" + Exclude="$(ExtensionsCsProjDirectory)\buildout\bin\runtimes\**;$(_FunctionsIntermdiateExtensionJsonPath)" + CopyToOutputDirectory="PreserveNewest" /> + <_ExtensionRuntimeBinaries Include="$(ExtensionsCsProjDirectory)\buildout\runtimes\**" CopyToOutputDirectory="PreserveNewest" /> + + + + + + + + + + + + <_NoneWithTargetPath Include="@(_ExtensionFilesWithTargetPath)" TargetPath="$(_FunctionsExtensionsDirectory)/%(_ExtensionFilesWithTargetPath.TargetPath)" /> + + - - - - - - - + + + <_WorkerExtFilesToClean Include="$(ExtensionsCsProjDirectory)\**" Condition="'$(ExtensionsCsProjDirectory)' != ''" /> + <_WorkerExtFilesToClean Include="$(TargetDir)$(_FunctionsExtensionsDirectory)\**" /> + <_WorkerExtFilesToClean Include="$(_FunctionsMetadataPath)" /> + <_WorkerExtFilesToClean Include="$(_FunctionsWorkerConfigPath)" /> + <_WorkerExtFilesToClean Include="$(TargetDir)worker.config.json" /> + <_WorkerExtFilesToClean Include="$(TargetDir)extensions.json" /> + <_WorkerExtFilesToClean Include="$(TargetDir)functions.metadata" /> + <_WorkerExtFilesToClean Include="$(_FunctionsIntermdiateExtensionUpdatedJsonPath)" /> + + + + + + - - - - + \ No newline at end of file diff --git a/sdk/Sdk/Tasks/EnhanceExtensionsMetadata.cs b/sdk/Sdk/Tasks/EnhanceExtensionsMetadata.cs index 8fbaf5c13..c76bb4871 100644 --- a/sdk/Sdk/Tasks/EnhanceExtensionsMetadata.cs +++ b/sdk/Sdk/Tasks/EnhanceExtensionsMetadata.cs @@ -34,8 +34,6 @@ public override bool Execute() string newJson = JsonSerializer.Serialize(extensionsMetadata, _serializerOptions); File.WriteAllText(OutputPath, newJson); - File.Delete(ExtensionsJsonPath); - return true; } } From ef791cace72e7480647e44c4c8311ce824b382bd Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Thu, 24 Aug 2023 13:36:54 -0700 Subject: [PATCH 02/10] Fix publish --no-build --- ...icrosoft.Azure.Functions.Worker.Sdk.targets | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets index 5e6805721..dbeb3c171 100644 --- a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets +++ b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets @@ -60,7 +60,8 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and - + + @@ -75,9 +76,9 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and - - - + + + @@ -150,12 +151,15 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and OutputPath="$(_FunctionsIntermdiateExtensionUpdatedJsonPath)"/> - + <_ExtensionBinaries Include="$(ExtensionsCsProjDirectory)\buildout\bin\**" Exclude="$(ExtensionsCsProjDirectory)\buildout\bin\runtimes\**;$(_FunctionsIntermdiateExtensionJsonPath)" - CopyToOutputDirectory="PreserveNewest" /> - <_ExtensionRuntimeBinaries Include="$(ExtensionsCsProjDirectory)\buildout\runtimes\**" CopyToOutputDirectory="PreserveNewest" /> + CopyToOutputDirectory="PreserveNewest" + CopyToPublishDirectory="PreserveNewest" /> + <_ExtensionRuntimeBinaries Include="$(ExtensionsCsProjDirectory)\buildout\runtimes\**" + CopyToOutputDirectory="PreserveNewest" + CopyToPublishDirectory="PreserveNewest" /> From 28d4df5cad2e8ad62d4bf0af00470160cf8bfa10 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Thu, 24 Aug 2023 13:48:35 -0700 Subject: [PATCH 03/10] undo Net7Worker changes --- samples/Net7Worker/Net7Worker.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/Net7Worker/Net7Worker.csproj b/samples/Net7Worker/Net7Worker.csproj index 3b41e3014..1cfd5f1d6 100644 --- a/samples/Net7Worker/Net7Worker.csproj +++ b/samples/Net7Worker/Net7Worker.csproj @@ -7,9 +7,9 @@ enable - + - + From 360bdf884ac4b03fc9f9d32a0fb7a4b1e642981c Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Thu, 24 Aug 2023 13:56:37 -0700 Subject: [PATCH 04/10] Adjust targets for some backwards compat --- .../Microsoft.Azure.Functions.Worker.Sdk.targets | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets index dbeb3c171..53e016b42 100644 --- a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets +++ b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets @@ -60,9 +60,12 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and - + + + + <_FunctionsMetadataPath>$(IntermediateOutputPath)functions.metadata @@ -133,16 +136,16 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and Overwrite="true" /> - + - + From 3976cd6ae39d1f8f9217bb133d57a0b50b255be2 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Tue, 12 Sep 2023 14:14:13 -0700 Subject: [PATCH 05/10] Fix incremental test --- .../ExtensionsCsProjGeneratorTests.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/FunctionMetadataGeneratorTests/ExtensionsCsProjGeneratorTests.cs b/test/FunctionMetadataGeneratorTests/ExtensionsCsProjGeneratorTests.cs index 05f148941..3af598ce7 100644 --- a/test/FunctionMetadataGeneratorTests/ExtensionsCsProjGeneratorTests.cs +++ b/test/FunctionMetadataGeneratorTests/ExtensionsCsProjGeneratorTests.cs @@ -33,20 +33,23 @@ public void GetCsProjContent_Succeeds(FuncVersion version) [InlineData(FuncVersion.V4)] public void GetCsProjContent_IncrementalSupport(FuncVersion version) { - DateTime RunGenerate(string subPath) + DateTime RunGenerate(string subPath, out string contents) { var generator = GetGenerator(version, subPath); generator.Generate(); + string path = Path.Combine(subPath, ExtensionsCsprojGenerator.ExtensionsProjectName); + contents = File.ReadAllText(path); var csproj = new FileInfo(Path.Combine(subPath, ExtensionsCsprojGenerator.ExtensionsProjectName)); return csproj.LastWriteTimeUtc; } string subPath = Guid.NewGuid().ToString(); - DateTime firstRun = RunGenerate(subPath); - DateTime secondRun = RunGenerate(subPath); + DateTime firstRun = RunGenerate(subPath, out string first); + DateTime secondRun = RunGenerate(subPath, out string second); - Assert.Equal(firstRun, secondRun); + Assert.NotEqual(firstRun, secondRun); + Assert.Equal(first, second); } static ExtensionsCsprojGenerator GetGenerator(FuncVersion version, string subPath = "") From ce826fd02b94c2af21447f35350c206d53d64dd0 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Tue, 12 Sep 2023 16:11:51 -0700 Subject: [PATCH 06/10] Add log to failing test --- test/SdkE2ETests/ZipDeployTests.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/SdkE2ETests/ZipDeployTests.cs b/test/SdkE2ETests/ZipDeployTests.cs index d0a40c8ff..14c0fe83d 100644 --- a/test/SdkE2ETests/ZipDeployTests.cs +++ b/test/SdkE2ETests/ZipDeployTests.cs @@ -54,8 +54,16 @@ public async Task CreateZipFileFromDirectory_SetsExecutableFlag_WhenSelfContaine } else { - Assert.Equal(0, entry.HostSystem); - Assert.Equal(0, entry.ExternalFileAttributes); + try + { + Assert.Equal(0, entry.HostSystem); + Assert.Equal(0, entry.ExternalFileAttributes); + } + catch + { + _testOutputHelper.WriteLine($"{zip.Name} failed validation"); + throw; + } } } From b0e63d2c09333a232ed0e96e87ee7c371a30b0e4 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Tue, 12 Sep 2023 16:36:37 -0700 Subject: [PATCH 07/10] Always write worker.config.json --- .../Microsoft.Azure.Functions.Worker.Sdk.targets | 4 ++-- test/SdkE2ETests/ZipDeployTests.cs | 12 ++---------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets index 53e016b42..fd45e97b0 100644 --- a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets +++ b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets @@ -106,7 +106,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and OverwriteReadOnlyFiles="true" /> - + - + Date: Thu, 14 Sep 2023 11:09:47 -0700 Subject: [PATCH 08/10] update release_notes.md --- sdk/release_notes.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/release_notes.md b/sdk/release_notes.md index 36a1697ad..5bb97cb31 100644 --- a/sdk/release_notes.md +++ b/sdk/release_notes.md @@ -7,9 +7,11 @@ ### Microsoft.Azure.Functions.Worker.Sdk 1.15.0-preview1 -- Improve incremental build support for worker extension project inner build [#1749](https://github.com/Azure/azure-functions-dotnet-worker/pull/1749) - - Now builds to intermediate output path - - Avoids disk writes for generated .csproj and file copies if nothing has changed +- Improve incremental build support for worker extension project inner build [#1749](https://github.com/Azure/azure-functions-dotnet-worker/pull/1749) + - Now builds to intermediate output path - adding support for `nuget.config` +- Integrate inner build with existing .NET SDK targets [##1861](https://github.com/Azure/azure-functions-dotnet-worker/pull/1861) + - Targets have been refactored to participate with `CopyToOutputDirectory` and `CopyToPublishDirectory` instead of manually copying + - Incremental build support further improved ### Microsoft.Azure.Functions.Worker.Sdk.Analyzers (delete if not updated) From 7d64104db057378d3305a19d566994ea3a5474cf Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Fri, 15 Sep 2023 09:59:45 -0700 Subject: [PATCH 09/10] WorkExtensions -> WorkerExtensions --- sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets index fd45e97b0..1581f17c1 100644 --- a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets +++ b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets @@ -70,7 +70,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and <_FunctionsMetadataPath>$(IntermediateOutputPath)functions.metadata <_FunctionsWorkerConfigPath>$(IntermediateOutputPath)worker.config.json - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)WorkExtensions)) + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)WorkerExtensions)) $([System.IO.Path]::Combine($(ExtensionsCsProjDirectory), WorkerExtensions.csproj)) <_FunctionsIntermdiateExtensionJsonPath>$(ExtensionsCsProjDirectory)\buildout\bin\$(_FunctionsExtensionsJsonName) <_FunctionsIntermdiateExtensionUpdatedJsonPath>$(IntermediateOutputPath)$(_FunctionsExtensionsJsonName) From 4b6f091cc934714edb1e227dbe444abc2c9ba5ee Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Thu, 28 Sep 2023 15:59:52 -0700 Subject: [PATCH 10/10] Fix spelling mistake, add comments --- ...crosoft.Azure.Functions.Worker.Sdk.targets | 41 +++++++++++++++---- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets index 1581f17c1..4b4767cc8 100644 --- a/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets +++ b/sdk/Sdk/Targets/Microsoft.Azure.Functions.Worker.Sdk.targets @@ -51,6 +51,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and + @@ -60,33 +61,42 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and + + + + <_FunctionsMetadataPath>$(IntermediateOutputPath)functions.metadata <_FunctionsWorkerConfigPath>$(IntermediateOutputPath)worker.config.json $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)WorkerExtensions)) $([System.IO.Path]::Combine($(ExtensionsCsProjDirectory), WorkerExtensions.csproj)) - <_FunctionsIntermdiateExtensionJsonPath>$(ExtensionsCsProjDirectory)\buildout\bin\$(_FunctionsExtensionsJsonName) - <_FunctionsIntermdiateExtensionUpdatedJsonPath>$(IntermediateOutputPath)$(_FunctionsExtensionsJsonName) + <_FunctionsIntermediateExtensionJsonPath>$(ExtensionsCsProjDirectory)\buildout\bin\$(_FunctionsExtensionsJsonName) + <_FunctionsIntermediateExtensionUpdatedJsonPath>$(IntermediateOutputPath)$(_FunctionsExtensionsJsonName) + - + + + + + + + + + + Inputs="$(_FunctionsIntermediateExtensionJsonPath)" + Outputs="$(_FunctionsIntermediateExtensionUpdatedJsonPath)"> + ExtensionsJsonPath="$(_FunctionsIntermediateExtensionJsonPath)" + OutputPath="$(_FunctionsIntermediateExtensionUpdatedJsonPath)"/> + <_ExtensionBinaries Include="$(ExtensionsCsProjDirectory)\buildout\bin\**" - Exclude="$(ExtensionsCsProjDirectory)\buildout\bin\runtimes\**;$(_FunctionsIntermdiateExtensionJsonPath)" + Exclude="$(ExtensionsCsProjDirectory)\buildout\bin\runtimes\**;$(_FunctionsIntermediateExtensionJsonPath)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" /> <_ExtensionRuntimeBinaries Include="$(ExtensionsCsProjDirectory)\buildout\runtimes\**" @@ -165,6 +184,9 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and CopyToPublishDirectory="PreserveNewest" /> + @@ -173,6 +195,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and + <_NoneWithTargetPath Include="@(_ExtensionFilesWithTargetPath)" TargetPath="$(_FunctionsExtensionsDirectory)/%(_ExtensionFilesWithTargetPath.TargetPath)" /> @@ -187,7 +210,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and <_WorkerExtFilesToClean Include="$(TargetDir)worker.config.json" /> <_WorkerExtFilesToClean Include="$(TargetDir)extensions.json" /> <_WorkerExtFilesToClean Include="$(TargetDir)functions.metadata" /> - <_WorkerExtFilesToClean Include="$(_FunctionsIntermdiateExtensionUpdatedJsonPath)" /> + <_WorkerExtFilesToClean Include="$(_FunctionsIntermediateExtensionUpdatedJsonPath)" />