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

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net48</TargetFramework>
        <!-- x64 — AVEVA Historian 2020 ships an x64 build of aahClientManaged + the native
             aahClient.dll under the Historian install's x64\ subfolder. The other three
             SDK assemblies (Historian.CBE / DPAPI / ArchestrA.CloudHistorian.Contract) are
             pure-managed AnyCPU and load fine in either bitness. The earlier x86 default
             was inherited from v1's Galaxy.Host bitness (MXAccess COM, retired in PR 7.2)
             and didn't reflect any constraint of the Historian SDK itself. -->
        <PlatformTarget>x64</PlatformTarget>
        <Nullable>enable</Nullable>
        <LangVersion>latest</LangVersion>
        <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
        <GenerateDocumentationFile>true</GenerateDocumentationFile>
        <NoWarn>$(NoWarn);CS1591</NoWarn>
        <RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Historian.Wonderware</RootNamespace>
        <AssemblyName>OtOpcUa.Driver.Historian.Wonderware</AssemblyName>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="MessagePack"/>
        <PackageReference Include="System.IO.Pipes.AccessControl"/>
        <PackageReference Include="System.Memory"/>
        <PackageReference Include="System.Threading.Tasks.Extensions"/>
        <PackageReference Include="System.Data.SqlClient"/>
        <PackageReference Include="Serilog"/>
        <PackageReference Include="Serilog.Sinks.File"/>
    </ItemGroup>

    <ItemGroup>
        <InternalsVisibleTo Include="ZB.MOM.WW.OtOpcUa.Driver.Historian.Wonderware.Tests"/>
    </ItemGroup>

    <ItemGroup>
        <!-- Wonderware Historian SDK — consumed by Backend/ for HistoryReadAsync.
             Lifted from Driver.Galaxy.Host in PR 3.2 so the sidecar owns the SDK. -->
        <Reference Include="aahClientManaged">
            <HintPath>..\..\..\lib\aahClientManaged.dll</HintPath>
            <EmbedInteropTypes>false</EmbedInteropTypes>
        </Reference>
        <Reference Include="aahClientCommon">
            <HintPath>..\..\..\lib\aahClientCommon.dll</HintPath>
            <EmbedInteropTypes>false</EmbedInteropTypes>
        </Reference>
    </ItemGroup>

    <ItemGroup>
        <!-- Historian SDK native and satellite DLLs — staged beside the host exe so the
             aahClientManaged wrapper can P/Invoke into them without an AssemblyResolve hook. -->
        <None Include="..\..\..\lib\aahClient.dll">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Include="..\..\..\lib\Historian.CBE.dll">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Include="..\..\..\lib\Historian.DPAPI.dll">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Include="..\..\..\lib\ArchestrA.CloudHistorian.Contract.dll">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
    </ItemGroup>

    <ItemGroup>
        <NuGetAuditSuppress Include="https://github.com/advisories/GHSA-37gx-xxp4-5rgx"/>
        <NuGetAuditSuppress Include="https://github.com/advisories/GHSA-w3x6-4m5h-cxqf"/>
    </ItemGroup>

</Project>
