Skip to content

Commit

Permalink
Refactor BuildFromSource.targets for better item inclusion
Browse files Browse the repository at this point in the history
The changes refactor BuildFromSource.targets to improve item inclusion for reference packages, props files, and targets files.
  • Loading branch information
dgmjr committed Oct 29, 2023
1 parent ad46188 commit ad480c9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Build/BuildFromSource.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->
<!-- This doesn't do anything right now, but the idea is to allow the programmer the option to buikd a project from its source code or use the NuGet package -->
<Project>
<!-- <ItemGroup Condition="'$(BuildFromSource)' != 'true'">
<PackageReference Include="$([System.Text.RegularExpressions.Regex]::Replace((%(ProjectReference.Identity), '(?:.+[\/\\])+(.*)\.csproj', '$1'))" />
<PropsFile Include="$([System.String]::Copy(%(ProjectReference.Identity)).Replace('.csproj', '.props'))" />
<TargetsFile Include="$([System.String]::Copy(%(ProjectReference.Identity)).Replace('.csproj', '.targets'))" />
</ItemGroup> -->
<ItemGroup>
<!-- <PackageReference Include="$([System.Text.RegularExpressions.Regex]::Replace((%(ProjectReference.FullPath), '(?:.+[\/\\])+(.*)\.csproj', '$1'))" /> -->
<PropsFile Include="$([System.String]::Copy(%(ProjectReference.FullPath)).Replace('.csproj', '.props'))" Condition="Exists($([System.String]::Copy(%(ProjectReference.FullPath)).Replace('.csproj', '.props')))" />
<TargetsFile Include="$([System.String]::Copy(%(ProjectReference.FullPath)).Replace('.csproj', '.targets'))" Condition="Exists($([System.String]::Copy(%(ProjectReference.FullPath)).Replace('.csproj', '.targets')))" />
</ItemGroup>
</Project>

0 comments on commit ad480c9

Please sign in to comment.