<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
  <Import Project="..\..\PowerShell.Common.props" />
  <PropertyGroup>
    <Description>PowerShell's System.Management.Automation project</Description>
    <NoWarn>$(NoWarn);CS1570;CS1734;CA1416;CA2022</NoWarn>
    <AssemblyName>System.Management.Automation</AssemblyName>
  </PropertyGroup>

  <PropertyGroup>
    <!-- we persist source generator files under 'gen' folder so that they are visible to IDEs -->
    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
    <CompilerGeneratedFilesOutputPath>gen\SourceGenerated</CompilerGeneratedFilesOutputPath>
  </PropertyGroup>

  <ItemGroup>
    <!-- these properties are declared in 'PowerShell.Common.props' and used by source generator -->
    <CompilerVisibleProperty Include="ProductVersion" />
    <CompilerVisibleProperty Include="PSCoreBuildVersion" />
    <CompilerVisibleProperty Include="PowerShellVersion" />
    <CompilerVisibleProperty Include="ReleaseTag" />

    <ProjectReference Include="SourceGenerators\PSVersionInfoGenerator\PSVersionInfoGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
  </ItemGroup>

  <ItemGroup Condition=" '$(IsWindows)' == 'true' ">
    <ProjectReference Include="..\Microsoft.PowerShell.CoreCLR.Eventing\Microsoft.PowerShell.CoreCLR.Eventing.csproj" />
  </ItemGroup>

  <ItemGroup>
    <!-- the following package(s) are from https://github.com/JamesNK/Newtonsoft.Json -->
    <PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
    <!-- the Application Insights package -->
    <PackageReference Include="Microsoft.ApplicationInsights" Version="2.23.0" />
    <!-- the following package(s) are from https://github.com/dotnet/corefx -->
    <PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="11.0.0-rc.1.26425.128" />
    <PackageReference Include="System.Configuration.ConfigurationManager" Version="11.0.0-rc.1.26425.128" />
    <PackageReference Include="System.DirectoryServices" Version="11.0.0-rc.1.26425.128" />
    <PackageReference Include="System.Management" Version="11.0.0-rc.1.26425.128" />
    <PackageReference Include="System.Security.Cryptography.Pkcs" Version="11.0.0-rc.1.26425.128" />
    <PackageReference Include="System.Security.Permissions" Version="11.0.0-rc.1.26425.128" />
    <!-- the following package(s) are from the powershell org -->
    <PackageReference Include="Microsoft.Management.Infrastructure" Version="3.0.0" />
    <PackageReference Include="Microsoft.PowerShell.Native" Version="700.0.0" />
    <!-- Signing APIs -->
    <PackageReference Include="Microsoft.Security.Extensions" Version="1.4.0" />
  </ItemGroup>

  <ItemGroup>
    <!-- exclude code of source generators from compilation and IDEs (e.g. vscode and visual studio) -->
    <Compile Remove="SourceGenerators\**\*.cs" />
    <!-- exclude the generated code for EventResource.resx, which is not directly used -->
    <Compile Remove="gen\EventResource.cs" />

    <EmbeddedResource Include="cimSupport\cmdletization\xml\cmdlets-over-objects.xsd" LogicalName="cmdlets-over-objects.xsd" />
  </ItemGroup>

  <ItemGroup Condition=" '$(IsWindows)' != 'true' ">
    <Compile Remove="engine\COM\**\*.cs" />
    <Compile Remove="engine\ComInterop\**\*.cs" />
    <Compile Remove="engine\ExtraAdapter.cs" />
    <Compile Remove="engine\Interop\Windows\**\*.cs" />
    <Compile Remove="engine\ManagementObjectAdapter.cs" />
    <Compile Remove="engine\remoting\commands\ConnectPSSession.cs" />
    <Compile Remove="engine\remoting\commands\CustomShellCommands.cs" />
    <Compile Remove="engine\remoting\commands\DisconnectPSSession.cs" />
    <Compile Remove="engine\remoting\commands\ReceivePSSession.cs" />
    <Compile Remove="engine\remoting\commands\TestPSSessionConfigurationFile.cs" />
  </ItemGroup>

  <ItemGroup Condition=" '$(IsWindows)' == 'true' ">
    <Compile Remove="engine\Interop\Unix\**\*.cs" />
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Update="resources\*\*.resx">
      <ManifestResourceName>$(RootNamespace).resources.%(Filename)</ManifestResourceName>
    </EmbeddedResource>
  </ItemGroup>
</Project>