Skip to content

Commit 6969225

Browse files
committed
Improve GenerateUniqueIdentifierCs
1 parent f8e2d42 commit 6969225

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Targets/CodeGenerator.targets

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@
1212
</Target>
1313

1414

15-
<Target Name="GenerateUniqueIdentifierCs" Inputs="$(MSBuildThisFileFullPath);$(MSBuildAllProjects);@(Compile)" Outputs="$(UniqueIdentifierPath)" BeforeTargets="CoreCompile" DependsOnTargets="DefineProperties">
15+
<Target Name="GenerateUniqueIdentifierCs" Inputs="$(VersionSourceFile)" Outputs="$(UniqueIdentifierPath)" BeforeTargets="CoreCompile" AfterTargets="GenerateAssemblyVersionInfo" DependsOnTargets="DefineProperties">
1616

1717
<PropertyGroup>
18+
<UniqueIdentifier>$([System.Guid]::NewGuid())</UniqueIdentifier>
19+
<UniqueIdentifier Condition="'$(GitCommitId)' != ''">$(GitCommitId)</UniqueIdentifier>
1820
<UniqueIdSourceLines>
1921
namespace LibGit2Sharp.Core
2022
{
2123
internal static class UniqueId
2224
{
23-
public const string UniqueIdentifier = "$([System.Guid]::NewGuid())"%3b
25+
public const string UniqueIdentifier = "$(UniqueIdentifier)"%3b
2426
}
2527
}
2628
</UniqueIdSourceLines>

0 commit comments

Comments
 (0)