<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

  <PropertyGroup>
    <TargetFrameworks>netcoreapp3.1;net5.0-windows7.0</TargetFrameworks>
    <UseWindowsForms>true</UseWindowsForms>
    
    <!--If 'true' then excludes FastReport.Compat package and adds reference to local source code
    NOTE: <UseMSChart> becomes 'false' and you must have source code FastReport.Compat-->
    <DebugFRCompat>false</DebugFRCompat>

    <!--If 'false' then excludes FastReport.DataVisualization package and source files with MSChart-->
    <UseMSChart>true</UseMSChart>
    
    <Configurations>Debug;Release;Academic;Demo;WinForms;Community</Configurations>
    <RootNamespace>FastReport</RootNamespace>
    <AssemblyName>FastReport</AssemblyName>
    
    <SignAssembly>False</SignAssembly>
    <AssemblyOriginatorKeyFile>..\..\FastReport.Net.snk</AssemblyOriginatorKeyFile>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <Optimize>true</Optimize>
    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
  </PropertyGroup>

  <PropertyGroup>
    <Title>FastReport</Title>
    <Description>Report generator</Description>
    <Company>Fast Reports Inc.</Company>
    <Product>FastReport.Net</Product>
    <Copyright>Copyright © Fast Reports Inc. 2007-2022</Copyright>
  </PropertyGroup>
    
  <PropertyGroup Condition="$(DebugFRCompat)">
    <UseMSChart>false</UseMSChart>
  </PropertyGroup>

  <PropertyGroup>
    <FRDir>..\..\FastReport</FRDir>
    <FRDirBase>..\..\FastReport.Base</FRDirBase>
    <FRDirBaseExt>..\..\FastReport.BaseExt</FRDirBaseExt>
    <FRDirDesignExt>..\..\FastReport.DesignExt</FRDirDesignExt>
  </PropertyGroup>

  <!--Configure package name reference (for Web package)-->
  <PropertyGroup Condition="'$(Configuration)' == 'Demo'">
    <PackageId>FastReport.Net.Demo</PackageId>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <PackageId>FastReport.Net.Pro</PackageId>
  </PropertyGroup>


  <PropertyGroup>
    <DefineConstants>DOTNET_4;TRACE;COREWIN</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)'!='Debug'">
    <DebugSymbols>false</DebugSymbols>
    <DebugType>none</DebugType>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Demo'">
    <DefineConstants>$(DefineConstants);Demo</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Academic'">
    <DefineConstants>$(DefineConstants);Academic</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'WinForms'">
    <DefineConstants>$(DefineConstants);WinForms</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Community'">
    <AssemblyOriginatorKeyFile>..\..\FastReport.OpenSource.snk</AssemblyOriginatorKeyFile>
    <DefineConstants>$(DefineConstants);COMMUNITY</DefineConstants>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <PropertyGroup Condition="$(UseMSChart)">
    <DefineConstants>$(DefineConstants);MSCHART</DefineConstants>
  </PropertyGroup>

  <!--readonly struct's feature-->
  <PropertyGroup Condition="'$(MSBuildVersion)' &gt;= '16'">
    <DefineConstants>$(DefineConstants);READONLY_STRUCTS</DefineConstants>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="$(FRDirBase)\**\*.cs" Exclude="$(FRDirBase)\obj\**">
      <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <Compile Include="$(FRDirBaseExt)\**\*.cs" Exclude="$(FRDirBaseExt)\obj\**">
      <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <Compile Include="$(FRDir)\**\*.cs" Exclude="$(FRDir)\obj\**">
      <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
    </Compile>
    <Compile Remove="$(FRDir)\Properties\AssemblyInfo.cs" />
  </ItemGroup>

  <ItemGroup>
    <Compile Include="$(FRDirDesignExt)\**\*.cs" Exclude="$(FRDirDesignExt)\obj\**">
      <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Include="$(FRDir)\**\*.resx" Exclude="$(FRDir)\obj\**">
      <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
    </EmbeddedResource>
    <EmbeddedResource Include="$(FRDir)\Resources\**">
      <Link>Resources\%(RecursiveDir)%(Filename)%(Extension)</Link>
    </EmbeddedResource>
  </ItemGroup>

  <ItemGroup Condition="!$(UseMSChart)">
    <Compile Remove="$(FRDirBaseExt)\MSChart\*.cs" />
    <Compile Remove="$(FRDir)\MSChart\*.cs" />
    <Compile Remove="$(FRDirBaseExt)\Import\RDL\**\*.cs" />
    <Compile Remove="$(FRDirDesignExt)\Design\ImportPlugins\RDL\**\*.cs" />
    <Compile Remove="$(FRDirDesignExt)\Design\ExportPlugins\RDL\**\*.cs" />
    <EmbeddedResource Remove="$(FRDir)\MSChart\*.resx" />
  </ItemGroup>
  
  
  <ItemGroup>
    <Content Include="$(FRDir)\Export\Text\images\paper_edge_one.png" />
  </ItemGroup>
    
  <ItemGroup>
    <PackageReference Include="System.Data.Odbc" Version="4.7.0" />
    <PackageReference Include="System.Data.OleDb" Version="4.7.0" />
    <PackageReference Include="System.Data.SqlClient" Version="4.8.0" />
    <PackageReference Include="System.Resources.Extensions" Version="4.6.0" />
  </ItemGroup>


  <Import Project="..\..\UsedPackages.version" />
  <ItemGroup>
    <PackageReference Include="FastReport.Compat" Version="$(FRCompatVersion)" Condition="!$(DebugFRCompat)" />
    <PackageReference Include="FastReport.DataVisualization" Version="$(FRDataVisualizationVersion)" Condition="$(UseMSChart)" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="FastReport.Bars">
      <HintPath>..\..\..\FastReport.Bars.dll</HintPath>
    </Reference>
    <Reference Include="FastReport.Editor">
      <HintPath>..\..\..\FastReport.Editor.dll</HintPath>
    </Reference>
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Update="..\..\FastReport\Properties\Resources.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
    </EmbeddedResource>
  </ItemGroup>

  <ItemGroup Condition="$(DebugFRCompat)">
    <ProjectReference Include="..\..\..\FastReport.Compat\src\FastReport.Compat-Windows\FastReport.Compat-Windows.csproj" />
  </ItemGroup>

</Project>