From 1aa6339f4f69fd5a206f398ad9000867df0f6c5d Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Thu, 21 Nov 2024 16:15:15 -0300 Subject: [PATCH] Make sure project properties initialize after source control If source control information is supported, make sure we automatically take a dependency on InitializeSourceControlInformation. We take the chance to also rename the old property `InjectThisAssemblyProjectDependsOn` to `PrepareProjectPropertiesDependsOn` which aligns better with the new target. --- src/ThisAssembly.Project/ThisAssembly.Project.targets | 8 +++++--- src/ThisAssembly.Tests/Tests.cs | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ThisAssembly.Project/ThisAssembly.Project.targets b/src/ThisAssembly.Project/ThisAssembly.Project.targets index 843845b5..c42219bd 100644 --- a/src/ThisAssembly.Project/ThisAssembly.Project.targets +++ b/src/ThisAssembly.Project/ThisAssembly.Project.targets @@ -13,12 +13,14 @@ - + + $(InjectThisAssemblyProjectDependsOn) + InitializeSourceControlInformation - + - + diff --git a/src/ThisAssembly.Tests/Tests.cs b/src/ThisAssembly.Tests/Tests.cs index a9daf305..a6cf1804 100644 --- a/src/ThisAssembly.Tests/Tests.cs +++ b/src/ThisAssembly.Tests/Tests.cs @@ -52,6 +52,13 @@ public void CanUseProjectFullFileContents() Assert.False(ThisAssembly.Project.ProjectFile.StartsWith("|")); } + /// + [Fact] + public void CanUseProjectRepositoryUrl() + { + Assert.NotEmpty(ThisAssembly.Project.RepositoryUrl); + } + /// [Fact] public void CanUseConstants()