Skip to content

Commit 0f01535

Browse files
committed
Deduplicate project properties before generation
Avoids build failures due to misconfiguration. Closes #172
1 parent 1eb951d commit 0f01535

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/ThisAssembly.Project/ThisAssembly.Project.targets

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88

99
<Target Name="InjectThisAssemblyProject" DependsOnTargets="$(InjectThisAssemblyProjectDependsOn)"
1010
BeforeTargets="PrepareForBuild;CompileDesignTime;GenerateMSBuildEditorConfigFileShouldRun">
11+
<ItemGroup>
12+
<ProjectPropertyDistinct Include="@(ProjectProperty -> Distinct())" />
13+
</ItemGroup>
1114
<PropertyGroup>
12-
<ThisAssemblyProject>@(ProjectProperty, '|')</ThisAssemblyProject>
15+
<ThisAssemblyProject>@(ProjectPropertyDistinct, '|')</ThisAssemblyProject>
1316
</PropertyGroup>
1417
<ItemGroup Condition="'$(ThisAssemblyProject)' != ''">
1518
<CompilerVisibleProperty Include="@(ProjectProperty)" />

src/ThisAssembly.Tests/ThisAssembly.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
</PropertyGroup>
5050

5151
<ItemGroup>
52+
<ProjectProperty Include="Foo" />
5253
<ProjectProperty Include="Foo" />
5354
<Constant Include="Foo.Bar" Value="Baz" Comment="Yay!" />
5455
<Constant Include="Foo.Hello" Value="World" Comment="Comments make everything better 😍" />

0 commit comments

Comments
 (0)