Skip to content

Commit

Permalink
try'n'a fix buildfromsource
Browse files Browse the repository at this point in the history
  • Loading branch information
dgmjr committed Nov 10, 2023
1 parent 7fc5382 commit dc7ac2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/Build/BuildFromSource.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
* License: MIT (https://opensource.org/licenses/MIT)
-->

<Project Condition="'$(BuildFromSourceProps)' == ''">
<PropertyGroup>
<Project>
<PropertyGroup Condition="'$(BuildFromSourceProps)' == ''">
<BuildFromSource>true</BuildFromSource>
<BuildFromSourceProps>imported</BuildFromSourceProps>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition="'$(BuildFromSourceProps)' == ''">
<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>
<PropertyGroup>
<PropertyGroup Condition="'$(BuildFromSourceProps)' == ''">
<TempFile>$([System.IO.Path]::GetTempFileName())</TempFile>
<TempPropsFile>$(TempFile).props</TempPropsFile>
<TempTargetsFile>$(TempFile).targets</TempTargetsFile>
Expand Down
10 changes: 5 additions & 5 deletions src/Build/BuildFromSource.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->
<Project InitialTargets="WritePropsAndTargetsFiles" Condition="'$(BuildFromSourceTargets)' == ''">
<PropertyGroup>
<Project InitialTargets="WritePropsAndTargetsFiles">
<PropertyGroup Condition="'$(BuildFromSourceTargets)' == ''">
<BuildFromSourceTargets>imported</BuildFromSourceTargets>
</PropertyGroup>
<Target Name="WritePropsAndTargetsFiles" BeforeTargets="Build">
<Target Name="WritePropsAndTargetsFiles" BeforeTargets="Build" Condition="'$(BuildFromSourceTargets)' == ''">
<WriteLinesToFile File="$(TempPropsFile)" Lines="@(PropsFile->'%(FullPath)')" Overwrite="true" />
<WriteLinesToFile File="$(TempTargetsFile)" Lines="@(TargetsFile->'%(FullPath)')" Overwrite="true" />
</Target>
<Import Project="$(TempPropsFile)" Condition="Exists($(TempPropsFile))" />
<Import Project="$(TempTargetsFile)" Condition="Exists($(TempTargetsFile))" />
<ItemGroup Condition="!$(BuildFromSource)">
<!-- remove all existing `ProjectReference`s and replace them with `PackageReference`s -->
<!-- <PackageReference Include="@(ProjectReference->'%(Filename)')" /> -->
<!-- <ProjectReference Remove="@(ProjectReference)" /> -->
<PackageReference Include="@(ProjectReference->'%(Filename)')" />
<ProjectReference Remove="@(ProjectReference)" />
</ItemGroup>
</Project>

0 comments on commit dc7ac2f

Please sign in to comment.