<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <IsPackable>true</IsPackable>
    <DocumentationFile>$(OutputPath)$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
  </PropertyGroup>
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <RootNamespace>Xtensive</RootNamespace>
    <PackageId>Xtensive.Orm</PackageId>
    <Title>$(DoProductName)</Title>
    <AssemblyTitle>$(Title)</AssemblyTitle>
    <PackageDescription>$(DoProductName) is the object-relational mapper (ORM) and business logic layer (BLL) framework</PackageDescription>
    <SignAssembly>true</SignAssembly>
    <AssemblyOriginatorKeyFile>$(OrmKeyFile)</AssemblyOriginatorKeyFile>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <WarningLevel>2</WarningLevel>
	<NoWarn>$(NoWarn);CS0618</NoWarn>
  </PropertyGroup>
  <PropertyGroup Label="Debug" Condition="'$(Configuration)'=='Debug'">
    <DefineConstants>TRACE;DEBUG;NETSTANDARD</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Label="Release" Condition="'$(Configuration)'=='Release'">
    <TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);IncludeWeaverFiles</TargetsForTfmSpecificContentInPackage>
    <DefineConstants>TRACE;NETSTANDARD</DefineConstants>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>portable</DebugType>
  </PropertyGroup>
  <PropertyGroup Label="Nuget ReadMe" Condition="$(GeneratePackageOnBuild) == 'true'">
    <PackageReadmeFile>ReadMe.md</PackageReadmeFile>
  </PropertyGroup>
  <ItemGroup Label="Build order">
    <ProjectReference Include="$(SolutionDir)Weaver\Xtensive.Orm.Weaver\Xtensive.Orm.Weaver.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
  </ItemGroup>
  <ItemGroup Label="Nuget content">
    <Content Include="$(SolutionDir)MSBuild\DataObjects.Net.targets">
      <PackagePath>.</PackagePath>
      <Visible>false</Visible>
    </Content>
    <Content Include="$(ProjectDir)NuGetContent\**">
      <PackagePath>.</PackagePath>
      <Visible>false</Visible>
    </Content>
  </ItemGroup>
  <ItemGroup Label="Packages" Condition=" '$(TargetFramework)' == 'netstandard2.0'">
    <PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
    <PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
    <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
  </ItemGroup>
  <ItemGroup Label="T4GeneratorsUpdaters">
    <None Update="Arithmetic\Internal\PrimitiveArithmetics.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
    </None>
    <None Update="Core\Extensions\DelegateBindExtensions.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
    </None>
    <None Update="Core\Extensions\ExpressionCompileExtensions.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
    </None>
    <None Update="InternalLogs.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
    </None>
    <None Update="Orm\Linq\MemberCompilation\MemberCompilerProvider-CreateCompiler.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
    </None>
  </ItemGroup>
  <ItemGroup Label="T4 templates">
    <None Include="Arithmetic\Internal\PrimitiveArithmetics.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
      <LastGenOutput>PrimitiveArithmetics.cs</LastGenOutput>
    </None>
    <None Include="Core\Extensions\DelegateBindExtensions.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
      <LastGenOutput>DelegateBindExtensions.cs</LastGenOutput>
    </None>
    <None Include="Core\Extensions\ExpressionCompileExtensions.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
      <LastGenOutput>ExpressionCompileExtensions.cs</LastGenOutput>
    </None>
    <None Include="DelegateGenerator.ttinclude" />
    <None Include="InternalLogs.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
      <LastGenOutput>InternalLogs.cs</LastGenOutput>
    </None>
    <None Include="Orm\Linq\MemberCompilation\MemberCompilerProvider-CreateCompiler.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
      <LastGenOutput>MemberCompilerProvider-CreateCompiler.cs</LastGenOutput>
    </None>
    <None Include="Strings.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <SubType>Designer</SubType>
      <LastGenOutput>Strings.Designer.cs</LastGenOutput>
    </None>
    <Compile Update="Strings.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Strings.resx</DependentUpon>
    </Compile>
  </ItemGroup>

  <Target Name="IncludeWeaverFiles">
    <ItemGroup>
      <TfmSpecificPackageFile Include="$(BaseOutputPath)tools\weaver\**">
        <Pack>true</Pack>
        <PackagePath>tools\weaver\</PackagePath>
      </TfmSpecificPackageFile>
    </ItemGroup>
  </Target>
</Project>