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

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net48</TargetFramework>
        <!-- Decision #23: x86 required for MXAccess COM interop. The MxAccess COM client is
             now ported (Backend/MxAccess/) so we need the x86 platform target for the
             ArchestrA.MxAccess.dll COM interop reference to resolve at runtime. -->
        <PlatformTarget>x86</PlatformTarget>
        <Prefer32Bit>true</Prefer32Bit>
        <Nullable>enable</Nullable>
        <LangVersion>latest</LangVersion>
        <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
        <GenerateDocumentationFile>true</GenerateDocumentationFile>
        <NoWarn>$(NoWarn);CS1591</NoWarn>
        <RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Host</RootNamespace>
        <AssemblyName>OtOpcUa.Driver.Galaxy.Host</AssemblyName>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="System.IO.Pipes.AccessControl" Version="5.0.0"/>
        <PackageReference Include="System.Memory" Version="4.5.5"/>
        <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4"/>
        <PackageReference Include="System.Data.SqlClient" Version="4.9.0"/>
        <PackageReference Include="Serilog" Version="4.2.0"/>
        <PackageReference Include="Serilog.Sinks.File" Version="7.0.0"/>
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="..\ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Shared\ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Shared.csproj"/>
    </ItemGroup>

    <ItemGroup>
        <InternalsVisibleTo Include="ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Host.Tests"/>
    </ItemGroup>

    <ItemGroup>
        <Reference Include="ArchestrA.MxAccess">
            <HintPath>..\..\lib\ArchestrA.MxAccess.dll</HintPath>
            <Private>true</Private>
        </Reference>
        <!-- Wonderware Historian SDK — consumed by Backend/Historian/ for HistoryReadAsync.
             Previously lived in the v1 Historian.Aveva plugin; folded into Driver.Galaxy.Host
             for PR #5 because this host is already Galaxy-specific. -->
        <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>
