Skip to content

Commit

Permalink
An attempt to fix #22
Browse files Browse the repository at this point in the history
  • Loading branch information
gasparnagy committed Feb 14, 2024
1 parent b7da9d2 commit 3785d69
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<NoDefaultExcludes>true</NoDefaultExcludes>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSBuild.AdditionalTasks" Version="0.1.36" />
</ItemGroup>

<ItemGroup>
<MetaTemplate Include="templates\**\*" Exclude="templates\**\bin\**;templates\**\obj\**" />
<Compile Remove="**\*" />
Expand All @@ -29,7 +33,12 @@
</ItemGroup>

<Target Name="PopulateMetaTemplate" AfterTargets="CoreCompile">
<WriteLinesToFile File="$(OutDir)\templates\%(MetaTemplate.RecursiveDir)\%(MetaTemplate.FileName)%(MetaTemplate.Extension)" Lines="$([System.IO.File]::ReadAllText(%(MetaTemplate.FullPath)).Replace('$$$NuGetPackageVersion$$$',$(PackageVersion)).Replace('$$$MajorMinorVersion$$$',$(MajorMinorVersion)))" Overwrite="true" />
<ReplaceTextInFileTask
InputFile="%(MetaTemplate.FullPath)"
OutputFile="$(OutDir)\templates\%(MetaTemplate.RecursiveDir)\%(MetaTemplate.FileName)%(MetaTemplate.Extension)"
TextToReplace="$$$NuGetPackageVersion$$$"
TextToReplaceWith="$(PackageVersion)"
WriteOnlyWhenChanged="true" />
<ItemGroup>
<Content Include="$(OutDir)\templates\**\*" PackagePath="content" />
</ItemGroup>
Expand Down

0 comments on commit 3785d69

Please sign in to comment.