Skip to content

Commit

Permalink
Link Templates to Matching SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
iwillspeak committed Oct 18, 2021
1 parent bd7ce2a commit b51c125
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Feersum.Sdk/Feersum.Sdk.proj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);GenerateVersionProps</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<Target Name="GenerateVersionProps" BeforeTargets="BeforeBuild;GenerateNuspec" DependsOnTargets="PrepareForBuild">
<Message Text="Creating package props for $(Version)" />
<Target Name="GenerateVersionProps" BeforeTargets="BeforeBuild;GenerateNuspec" DependsOnTargets="PrepareForBuild;GetVersion">
<Message Text="Creating package `Versions.props` for $(Version)" />

<PropertyGroup>

Expand Down
19 changes: 19 additions & 0 deletions src/Feersum.Templates/Feersum.Templates.proj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@

<ItemGroup>
<None Include="templates\**" PackagePath="content/" Pack="true" />
<None Remove="**\obj\**" />
<None Remove="**\bin\**" />
<TemplateInputs Include="templates\**\*.*proj" />
<None Remove="@(TemplateInputs)" />
</ItemGroup>

<PropertyGroup>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);GenerateVersionedProjects</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<Target Name="GenerateVersionedProjects" BeforeTargets="BeforeBuild;GenerateNuspec" DependsOnTargets="PrepareForBuild;GetVersion">
<Message Text="Re-Targeting projects to $(Version) for pack" />

<ItemGroup>
<FileWrites Include="$(BaseIntermediateOutputPath)%(TemplateInputs.FileName)%(TemplateInputs.Extension)" />
<TfmSpecificPackageFile Include="$(BaseIntermediateOutputPath)%(TemplateInputs.FileName)%(TemplateInputs.Extension)" Pack="true" PackagePath="content/$([msbuild]::MakeRelative('$(MSBuildThisFileDirectory)templates', '$(MSBuildThisFileDirectory)%(TemplateInputs.RelativeDir)')) " />
</ItemGroup>

<WriteLinesToFile File="$(BaseIntermediateOutputPath)%(TemplateInputs.FileName)%(TemplateInputs.Extension)" Lines="$([System.IO.File]::ReadAllText('%(TemplateInputs.Identity)').Replace('Feersum.Sdk/0.2.1', 'Feersum.Sdk/$(Version)'))" Overwrite="true" WriteOnlyWhenDifferent="true" />
</Target>

</Project>

0 comments on commit b51c125

Please sign in to comment.