<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;net40</TargetFrameworks>

    <Description>The C# port of ANTLR 3</Description>
    <Company>Tunnel Vision Laboratories, LLC</Company>
    <Copyright>Copyright © Sam Harwell 2011</Copyright>
    <Version>$(ANTLRVersion)</Version>
    <FileVersion>$(ANTLRFileVersion)</FileVersion>
    <InformationalVersion>$(ANTLRInformationalVersion)</InformationalVersion>

    <OutputPath>..\bin\$(Configuration)\</OutputPath>
  </PropertyGroup>

  <Choose>
    <When Condition="'$(TargetFramework)' == 'netstandard2.0'">
      <ItemGroup>
        <PackageReference Include="Microsoft.Build.Framework" Version="14.3" />
        <PackageReference Include="Microsoft.Build.Tasks.Core" Version="14.3" />
      </ItemGroup>

      <PropertyGroup>
        <DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
      </PropertyGroup>
    </When>
    <When Condition="'$(TargetFramework)' == 'net40'">
      <ItemGroup>
        <Reference Include="Microsoft.Build.Framework" />
        <Reference Include="Microsoft.Build.Tasks.v4.0" />
        <Reference Include="Microsoft.Build.Utilities.v4.0" />
      </ItemGroup>
    </When>
  </Choose>

  <ItemGroup>
    <None Update="Antlr3.CodeGenerator.DefaultItems.props">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="Antlr3.CodeGenerator.DefaultItems.targets">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="Antlr3.CodeGenerator.props">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="Antlr3.CodeGenerator.targets">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>

  <ItemGroup>
    <None Update="Rules\*.xml" CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>

</Project>