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

  <PropertyGroup>
    <TargetFrameworks>net10.0;net48</TargetFrameworks>
  </PropertyGroup>

  <PropertyGroup>
    <IsPackable>true</IsPackable>
    <PackageId>ZB.MOM.WW.MxGateway.Contracts</PackageId>
    <Version>0.2.0</Version>
    <Authors>Joseph Doherty</Authors>
    <Company>ZB MOM WW</Company>
    <Copyright>Copyright (c) ZB MOM WW. All rights reserved.</Copyright>
    <Description>Protobuf contracts and gRPC stubs for the MxAccessGateway service. Multi-targets net10.0 and net48.</Description>
    <RepositoryUrl>https://gitea.dohertylan.com/dohertj2/mxaccessgw</RepositoryUrl>
    <RepositoryType>git</RepositoryType>
    <PackageProjectUrl>https://gitea.dohertylan.com/dohertj2/mxaccessgw</PackageProjectUrl>
    <PackageTags>mxaccess;mxgateway;grpc;contracts;protobuf</PackageTags>
    <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
    <IncludeSymbols>true</IncludeSymbols>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
  </PropertyGroup>

  <ItemGroup>
    <!-- Generated\**\*.cs is Compile-Removed and regenerated by Grpc.Tools into the TRACKED Generated
         folder. It MUST be committed after any .proto change: Grpc.Tools skips regeneration when the
         committed output looks up to date, so on net10 the freshly regenerated code compiles (drift is
         invisible) while the net48 worker, which consumes the COMMITTED Generated\*.cs, fails with
         CS0246 on new types. Regenerate + commit after editing a .proto; if a build does not pick up
         the change, delete Generated\*.cs to force a full regen. scripts/check-codegen.ps1 enforces
         this in CI. See docs/Contracts.md. -->
    <Compile Remove="Generated\**\*.cs" />
    <Protobuf Include="Protos\mxaccess_gateway.proto" ProtoRoot="Protos" OutputDir="Generated" GrpcOutputDir="Generated" GrpcServices="Both" />
    <Protobuf Include="Protos\mxaccess_worker.proto" ProtoRoot="Protos" OutputDir="Generated" GrpcServices="None" />
    <!-- galaxy_repository.proto is intentionally retained even though the gateway SERVER now consumes
         the wire-identical Galaxy types from the ZB.MOM.WW.GalaxyRepository package. This proto is
         still the generation source of truth for the language clients (Go/Rust/Java/Python compile it
         by path; the .NET client consumes Contracts.Proto.Galaxy.* via this project reference) and for
         clients/proto/proto-inputs.json. Removing it breaks all five clients — do not delete. -->
    <Protobuf Include="Protos\galaxy_repository.proto" ProtoRoot="Protos" OutputDir="Generated" GrpcOutputDir="Generated" GrpcServices="Both" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Google.Protobuf" Version="3.34.1" />
    <PackageReference Include="Grpc.Core.Api" Version="2.76.0" />
    <PackageReference Include="Grpc.Tools" Version="2.80.0">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
  </ItemGroup>

</Project>
