Skip to content

Commit 44388e0

Browse files
authored
Refactor SDK targets to address multiple writes and flaky builds (#1861)
1 parent fec9995 commit 44388e0

File tree

6 files changed

+212
-417
lines changed

6 files changed

+212
-417
lines changed

DotNetWorker.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.Tests", "
134134
EndProject
135135
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetIntegration", "samples\AspNetIntegration\AspNetIntegration.csproj", "{D2F67410-9933-42E8-B04A-E17634D83A30}"
136136
EndProject
137+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Net7Worker", "samples\Net7Worker\Net7Worker.csproj", "{EC1A321B-70F6-420B-85D4-56C7869BB71B}"
138+
EndProject
137139
Global
138140
GlobalSection(SolutionConfigurationPlatforms) = preSolution
139141
Debug|Any CPU = Debug|Any CPU
@@ -332,6 +334,10 @@ Global
332334
{D2F67410-9933-42E8-B04A-E17634D83A30}.Debug|Any CPU.Build.0 = Debug|Any CPU
333335
{D2F67410-9933-42E8-B04A-E17634D83A30}.Release|Any CPU.ActiveCfg = Release|Any CPU
334336
{D2F67410-9933-42E8-B04A-E17634D83A30}.Release|Any CPU.Build.0 = Release|Any CPU
337+
{EC1A321B-70F6-420B-85D4-56C7869BB71B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
338+
{EC1A321B-70F6-420B-85D4-56C7869BB71B}.Debug|Any CPU.Build.0 = Debug|Any CPU
339+
{EC1A321B-70F6-420B-85D4-56C7869BB71B}.Release|Any CPU.ActiveCfg = Release|Any CPU
340+
{EC1A321B-70F6-420B-85D4-56C7869BB71B}.Release|Any CPU.Build.0 = Release|Any CPU
335341
EndGlobalSection
336342
GlobalSection(SolutionProperties) = preSolution
337343
HideSolutionNode = FALSE
@@ -390,6 +396,7 @@ Global
390396
{286F9EE3-00AE-4EFA-BFD8-A2E58BC809D2} = {FD7243E4-BF18-43F8-8744-BA1D17ACF378}
391397
{17BDCE12-6964-4B87-B2AC-68CE270A3E9A} = {FD7243E4-BF18-43F8-8744-BA1D17ACF378}
392398
{D2F67410-9933-42E8-B04A-E17634D83A30} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6}
399+
{EC1A321B-70F6-420B-85D4-56C7869BB71B} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6}
393400
EndGlobalSection
394401
GlobalSection(ExtensibilityGlobals) = postSolution
395402
SolutionGuid = {497D2ED4-A13E-4BCA-8D29-F30CA7D0EA4A}

sdk/Sdk/ExtensionsCsprojGenerator.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,13 @@ public void Generate()
3232
var extensionsCsprojFilePath = Path.Combine(_outputPath, ExtensionsProjectName);
3333

3434
string csproj = GetCsProjContent();
35-
36-
// Incremental build support: write the new csproj only if contents have changed.
37-
// By keeping one from a previous build around, our restore & build has a chance
38-
// to follow incremental build and no-op if nothing needs to be done.
3935
if (File.Exists(extensionsCsprojFilePath))
4036
{
4137
string existing = File.ReadAllText(extensionsCsprojFilePath);
4238
if (string.Equals(csproj, existing, StringComparison.Ordinal))
4339
{
44-
// Up to date, nothing to do.
40+
// If contents are the same, only touch the file to update timestamp.
41+
File.SetLastWriteTimeUtc(extensionsCsprojFilePath, DateTime.UtcNow);
4542
return;
4643
}
4744
}

0 commit comments

Comments
 (0)