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

  <PropertyGroup>
    <Description>JSON support using Newtonsoft. Json (JSON.NET) for Pomelo's MySQL provider for Entity Framework Core.</Description>
    <TargetFramework>netstandard2.0</TargetFramework>
    <MinClientVersion>3.6</MinClientVersion>
    <AssemblyName>Pomelo. EntityFrameworkCore. MySql. Json. Newtonsoft</AssemblyName>
    <RootNamespace>Pomelo. EntityFrameworkCore. MySql. Json. Newtonsoft</RootNamespace>
    <IsPackable>true</IsPackable>
    <PackageTags>$(PackageTags);json;newtonsoft.json;json.net;newtonsoft</PackageTags>
    <DeterministicSourcePaths>false</DeterministicSourcePaths>
  </PropertyGroup>

  <PropertyGroup>
    <MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);$(NoWarn)</MSBuildWarningsAsMessages>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="..\Shared\*.cs" />
  </ItemGroup>

  <!--  CHECK: What is this doing? -- >
  <ItemGroup>
    <None Include="build\**\*">
      <Pack>True</Pack>
      <PackagePath>build</PackagePath>
    </None>
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\EFCore. MySql\EFCore. MySql.csproj" PrivateAssets="contentfiles;build" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Newtonsoft. Json" Version="$(NewtonsoftJsonVersion)" />
  </ItemGroup>

  <ItemGroup Condition="'$(LocalMySqlConnectorRepository)' == ''">
    <PackageReference Include="MySqlConnector" Version="$(MySqlConnectorVersion)" />
  </ItemGroup>

  <ItemGroup Condition="'$(LocalEFCoreRepository)' == ''">
    <!--  TODO: Add Microsoft. EntityFrameworkCore as well for .NET 5.  Makes it easier for users. -- >
    <!--  PrivateAssets="none" is set to flow the EF Core analyzer to users referencing this package https://github.com/aspnet/EntityFrameworkCore/pull/11350 -->
    <PackageReference Include="Microsoft. EntityFrameworkCore. Relational" Version="$(MicrosoftEntityFrameworkCoreRelationalVersion)" PrivateAssets="none" />
  </ItemGroup>

  <ItemGroup Condition="'$(LocalMySqlConnectorRepository)' ! = ''">
    <Reference Include="MySqlConnector">
      <HintPath>$(LocalMySqlConnectorRepository)\src\MySqlConnector\bin\Debug\netstandard2.0\MySqlConnector.dll</HintPath>
    </Reference>
  </ItemGroup>

  <!--  TODO: Check, whether the following references are really all in use. -- >
  <ItemGroup Condition="'$(LocalEFCoreRepository)' ! = ''">
    <Reference Include="Microsoft. EntityFrameworkCore">
      <HintPath>$(LocalEFCoreRepository)\artifacts\bin\EFCore. Relational\Debug\$(TargetFramework)\Microsoft. EntityFrameworkCore.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft. EntityFrameworkCore. Abstractions">
      <HintPath>$(LocalEFCoreRepository)\artifacts\bin\EFCore. Relational\Debug\$(TargetFramework)\Microsoft. EntityFrameworkCore. Abstractions.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft. EntityFrameworkCore. Analyzers">
      <HintPath>$(LocalEFCoreRepository)\artifacts\bin\EFCore. Relational\Debug\$(TargetFramework)\Microsoft. EntityFrameworkCore. Analyzers.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft. EntityFrameworkCore. Relational">
      <HintPath>$(LocalEFCoreRepository)\artifacts\bin\EFCore. Relational\Debug\$(TargetFramework)\Microsoft. EntityFrameworkCore. Relational.dll</HintPath>
    </Reference>

    <PackageReference Include="Microsoft. Extensions. Configuration. Json" Version="$(MicrosoftExtensionsConfigurationJsonVersion)" />
    <PackageReference Include="Microsoft. Extensions. DependencyInjection" Version="$(MicrosoftExtensionsDependencyInjection)" />
    <PackageReference Include="Microsoft. Extensions. Configuration. EnvironmentVariables" Version="$(MicrosoftExtensionsConfigurationEnvironmentVariablesVersion)" />
    <PackageReference Include="Microsoft. Extensions. Configuration" Version="$(MicrosoftExtensionsConfigurationVersion)" />
    <PackageReference Include="Microsoft. Extensions. Caching. Memory" Version="$(MicrosoftExtensionsCachingMemoryVersion)" />
    <PackageReference Include="Microsoft. Extensions. HostFactoryResolver. Sources" Version="$(MicrosoftExtensionsHostFactoryResolverSourcesVersion)" />
    <PackageReference Include="Microsoft. Extensions. Logging" Version="$(MicrosoftExtensionsLoggingVersion)" />
    <PackageReference Include="System. Diagnostics. DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourceVersion)" />
    <PackageReference Include="Microsoft. Bcl. AsyncInterfaces" Version="$(MicrosoftBclAsyncInterfacesVersion)" />
    <PackageReference Include="Microsoft. Bcl. HashCode" Version="$(MicrosoftBclHashCodeVersion)" />
    <PackageReference Include="System. Collections. Immutable" Version="$(SystemCollectionsImmutableVersion)" />
    <PackageReference Include="System. ComponentModel. Annotations" Version="$(SystemComponentModelAnnotationsVersion)" />
  </ItemGroup>

</Project>
