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

  <PropertyGroup>
    <OutputType>Library</OutputType>
    <AssemblyName>DafnyPipeline</AssemblyName>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <OutputPath>..\..\Binaries\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <TargetFramework>net6.0</TargetFramework>
<RollForward>Major</RollForward>
    <PackageLicenseExpression>MIT</PackageLicenseExpression>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0|AnyCPU'">
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
  </PropertyGroup>

  <!-- Working around some stange behavior in dotnet publish: https://github.com/dotnet/sdk/issues/10566 -->
  <PropertyGroup Condition="$(RUNTIME_IDENTIFIER) != ''">
    <RuntimeIdentifier>$(RUNTIME_IDENTIFIER)</RuntimeIdentifier>
  </PropertyGroup>
  
  <ItemGroup>
    <ProjectReference Include="..\DafnyCore\DafnyCore.csproj" />
  </ItemGroup>

  <!-- 
  Note that the CopyToOutputDirectory elements are important to ensure the runtime files
  appear in the zip file distribution created by package.py.
  If we manage to fully transition to a cleaner distribution as a `dotnet tool` instead,
  we may be able to get away with only embedding these files inside this assembly.
  -->
  <ItemGroup>
    <EmbeddedResource Include="..\DafnyStandardLibraries\binaries\DafnyStandardLibraries-notarget.doo">
      <LogicalName>DafnyStandardLibraries-notarget.doo</LogicalName>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyStandardLibraries\binaries\DafnyStandardLibraries-java.doo">
      <LogicalName>DafnyStandardLibraries-java.doo</LogicalName>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyStandardLibraries\binaries\DafnyStandardLibraries-cs.doo">
      <LogicalName>DafnyStandardLibraries-cs.doo</LogicalName>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyStandardLibraries\binaries\DafnyStandardLibraries-js.doo">
      <LogicalName>DafnyStandardLibraries-js.doo</LogicalName>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyStandardLibraries\binaries\DafnyStandardLibraries-go.doo">
      <LogicalName>DafnyStandardLibraries-go.doo</LogicalName>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyStandardLibraries\binaries\DafnyStandardLibraries-py.doo">
      <LogicalName>DafnyStandardLibraries-py.doo</LogicalName>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyStandardLibraries\src\**\*.cs">
      <LinkBase>DafnyStandardLibraries_cs</LinkBase>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyStandardLibraries\src\**\*.java">
      <LinkBase>DafnyStandardLibraries_java</LinkBase>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyStandardLibraries\src\**\*.js">
      <LinkBase>DafnyStandardLibraries_js</LinkBase>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyStandardLibraries\src\**\*.go">
      <LinkBase>DafnyStandardLibraries_go</LinkBase>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyStandardLibraries\src\**\*.py">
      <LinkBase>DafnyStandardLibraries_py</LinkBase>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>

    <EmbeddedResource Include="..\DafnyStandardLibraries\binaries\DafnyStandardLibraries.doo">
      <LogicalName>DafnyStandardLibraries.doo</LogicalName>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeJava\src\main\java\**\*.java">
      <LinkBase>DafnyRuntimeJava</LinkBase>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeJava\src\main\dafny-generated\**\*.java">
      <LinkBase>DafnyRuntimeJava</LinkBase>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeJava\build\libs\DafnyRuntime-4.9.1.jar">
      <LogicalName>DafnyRuntime.jar</LogicalName>
      <Link>DafnyRuntime.jar</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntime.cs">
      <LinkBase>DafnyRuntimeCsharp</LinkBase>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeSystemModule.cs">
      <LinkBase>DafnyRuntimeCsharp</LinkBase>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeGo\**\*.go" Exclude="..\DafnyRuntime\DafnyRuntimeGo\**\*_test.go">
      <LinkBase>DafnyRuntimeGo</LinkBase>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeCpp\**\*.h">
      <LinkBase>DafnyRuntimeCpp</LinkBase>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeCpp\**\*.cpp">
      <LinkBase>DafnyRuntimeCpp</LinkBase>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeJs\**\*.js">
      <LinkBase>DafnyRuntimeJs</LinkBase>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimePython\**\*.py">
      <LinkBase>DafnyRuntimePython</LinkBase>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeRust\**" Exclude="..\DafnyRuntime\DafnyRuntimeRust\.gitignore" LinkBase="DafnyRuntimeRust">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Remove="..\DafnyRuntime\DafnyRuntimeRust\target\**"/>
  </ItemGroup>

</Project>
