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

    <PropertyGroup>
        <!-- Assembly Properties -->
        <TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0;netstandard2.0;netstandard2.1</TargetFrameworks>
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
        <CheckEolTargetFramework>false</CheckEolTargetFramework>
        <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
        <IncludeSymbols>true</IncludeSymbols>
        <LangVersion>latest</LangVersion>
        <!-- Added due to StormLibSharp -->
        <NoWarn>CS8600;CS8601;CS8603;CS8604;CS8618;CS8625;CS8634;IL3000</NoWarn>
        <Nullable>enable</Nullable>
        <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
        <SymbolPackageFormat>snupkg</SymbolPackageFormat>
        <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
        <Version>2.0.1</Version>
        <WarningsNotAsErrors>NU5104</WarningsNotAsErrors>

        <!-- Package Properties -->
        <Authors>Matt Nadareski</Authors>
        <Description>Serialization and deserialization helpers for various types</Description>
        <Copyright>Copyright (c) Matt Nadareski 2019-2025</Copyright>
        <PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
        <PackageReadmeFile>README.md</PackageReadmeFile>
        <RepositoryUrl>https://github.com/SabreTools/SabreTools.Serialization</RepositoryUrl>
        <RepositoryType>git</RepositoryType>
        <PackageTags>serialization reader writer conversion models wrappers printers oid asn1</PackageTags>
        <PackageLicenseExpression>MIT</PackageLicenseExpression>
    </PropertyGroup>

    <!-- Support All Frameworks -->
    <PropertyGroup Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`)) OR $(TargetFramework.StartsWith(`net4`))">
        <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
    </PropertyGroup>
    <PropertyGroup Condition="$(TargetFramework.StartsWith(`netcoreapp`)) OR $(TargetFramework.StartsWith(`net5`))">
        <RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64</RuntimeIdentifiers>
    </PropertyGroup>
    <PropertyGroup Condition="$(TargetFramework.StartsWith(`net6`)) OR $(TargetFramework.StartsWith(`net7`)) OR $(TargetFramework.StartsWith(`net8`)) OR $(TargetFramework.StartsWith(`net9`))">
        <RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
    </PropertyGroup>
    <PropertyGroup Condition="$(RuntimeIdentifier.StartsWith(`osx-arm`))">
        <TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
    </PropertyGroup>

    <!-- Exclude certain parts of external modules for by default -->
    <PropertyGroup>
        <DefaultItemExcludes>
            $(DefaultItemExcludes);
            **\AssemblyInfo.cs;
            _EXTERNAL\stormlibsharp\lib\**;
            _EXTERNAL\stormlibsharp\src\CascLibSharp\**;
            _EXTERNAL\stormlibsharp\src\TestConsole\**
        </DefaultItemExcludes>
    </PropertyGroup>

    <!-- Exclude all external modules for .NET Framework 2.0, .NET Framework 3.5, or non-Windows builds -->
    <PropertyGroup Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`))">
        <DefaultItemExcludes>
            $(DefaultItemExcludes);
            _EXTERNAL\**
        </DefaultItemExcludes>
    </PropertyGroup>

    <!-- These are needed for dealing with native Windows DLLs -->
    <ItemGroup>
        <Content Include="runtimes\**\*">
            <PackagePath>%(Identity)</PackagePath>
            <Pack>true</Pack>
        </Content>
    </ItemGroup>

    <ItemGroup>
        <None Include="../README.md" Pack="true" PackagePath="" />
    </ItemGroup>

    <ItemGroup>
        <InternalsVisibleTo Include="SabreTools.Serialization.Test" />
    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="GrindCore.SharpCompress" Version="0.40.4-alpha" Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net452`))" />
        <PackageReference Include="NetLegacySupport.Numerics" Version="1.0.1" Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`))" />
        <PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
        <PackageReference Include="SabreTools.Hashing" Version="[1.5.0]" />
        <PackageReference Include="SabreTools.IO" Version="[1.7.5]" />
     </ItemGroup>

</Project>