<Project Sdk="Microsoft.NET.Sdk">
  <Import Project="..\build\common.props" />
  <PropertyGroup>
    <PackageType>Template</PackageType>
    <PackageId>BenchmarkDotNet.Templates</PackageId>
    <Title>BenchmarkDotNet project templates</Title>
    <Description>BenchmarkDotNet Templates</Description>
    <PackageTags>benchmark;benchmarking;performance;templates;dotnet-new</PackageTags>
    <TargetFramework>netstandard2.0</TargetFramework>

    <IncludeContentInPack>true</IncludeContentInPack>
    <IncludeBuildOutput>false</IncludeBuildOutput>
    <ContentTargetFolders>content</ContentTargetFolders>

    <SignAssembly>false</SignAssembly>
    <PublicSign>false</PublicSign>

    <!-- this package does not have any dependencies, avoid getting a NU5128 warning -->
    <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
  </PropertyGroup>

  <ItemGroup>
    <Content Include="templates\**\*" Exclude="templates\**\bin\**;templates\**\obj\**" />
    <Compile Remove="**\*" />
    <None Remove="*.bat;.sh" />
  </ItemGroup>

  <Target Name="Fix BenchmarkDotNetVersion"
          BeforeTargets="Build">
    <ReplaceFileText
            InputFilename="templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json"
            OutputFilename="templates/BenchmarkDotNet.BenchmarkProjectTemplate.CSharp/.template.config/template.json"
            MatchExpression='("defaultValue": )"([\d+\.?]+)"'
            ReplacementText='${1}"$(VersionPrefix)"' />

    <ReplaceFileText
            InputFilename="templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/.template.config/template.json"
            OutputFilename="templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/.template.config/template.json"
            MatchExpression='("defaultValue": )"([\d+\.?]+)"'
            ReplacementText='${1}"$(VersionPrefix)"' />

    <ReplaceFileText
            InputFilename="templates/BenchmarkDotNet.BenchmarkProjectTemplate.VB/.template.config/template.json"
            OutputFilename="templates/BenchmarkDotNet.BenchmarkProjectTemplate.VB/.template.config/template.json"
            MatchExpression='("defaultValue": )"([\d+\.?]+)"'
            ReplacementText='${1}"$(VersionPrefix)"' />
  </Target>
</Project>