winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

Microsoft.WinGet.Client.Cmdlets.csproj (5795B)


      1 <Project Sdk="Microsoft.NET.Sdk">
      2 
      3   <PropertyGroup>
      4     <!-- If these target frameworks are updated, make sure to also update the .psd1 and .nuspec files.-->
      5     <!-- Keep in sync with attributes in AssemblyInfo.cs -->
      6     <CoreFramework>net8.0-windows10.0.26100.0</CoreFramework>
      7     <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
      8     <DesktopFramework>net48</DesktopFramework>
      9     <Configurations>Debug;Release;ReleaseStatic</Configurations>
     10   </PropertyGroup>
     11 
     12   <PropertyGroup>
     13     <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
     14     <LangVersion>10</LangVersion>
     15     <BuildOutputDirectory>$(SolutionDir)$(Platform)\$(Configuration)\</BuildOutputDirectory>
     16     <OutputPath>$(BuildOutputDirectory)$(MSBuildProjectName)</OutputPath>
     17     <TargetFrameworks>$(CoreFramework);$(DesktopFramework)</TargetFrameworks>
     18     <DocumentationFile>$(OutputPath)\Microsoft.WinGet.Client.Cmdlets.xml</DocumentationFile>
     19   </PropertyGroup>
     20 
     21   <ItemGroup>
     22     <AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
     23   </ItemGroup>
     24 
     25   <PropertyGroup Condition="'$(Configuration)'=='Release'">
     26     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     27   </PropertyGroup>
     28 
     29   <PropertyGroup Condition="'$(Configuration)'=='ReleaseStatic'">
     30     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     31   </PropertyGroup>
     32 
     33   <ItemGroup>
     34     <Compile Include="..\CommonFiles\WinGetAssemblyLoadContext.cs" Link="WinGetAssemblyLoadContext.cs" />
     35   </ItemGroup>
     36 
     37   <ItemGroup>
     38     <PackageReference Include="Newtonsoft.Json" />
     39     <PackageReference Include="PowerShellStandard.Library" PrivateAssets="all" />
     40     <PackageReference Include="StyleCop.Analyzers">
     41       <PrivateAssets>all</PrivateAssets>
     42       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     43     </PackageReference>
     44   </ItemGroup>
     45 
     46   <PropertyGroup Condition="'$(TargetFramework)' == '$(DesktopFramework)'">
     47     <DefineConstants>POWERSHELL_WINDOWS</DefineConstants>
     48   </PropertyGroup>
     49 
     50   <PropertyGroup Condition="'$(TargetFramework)' == '$(CoreFramework)'">
     51     <RuntimeIdentifier>win</RuntimeIdentifier>
     52   </PropertyGroup>
     53 
     54   <ItemGroup>
     55     <ProjectReference Include="..\Microsoft.WinGet.Client.Engine\Microsoft.WinGet.Client.Engine.csproj" />
     56   </ItemGroup>
     57 
     58   <Import Project="..\..\targets\ReferenceEmbeddedCsWinRTProject.targets" Condition="'$(TargetFramework)' == '$(CoreFramework)'" />
     59 
     60   <!-- This project doesn't reference CSWinRT, but specify this everywhere it will fail with NETSDK1130 and MSB3271. -->
     61   <PropertyGroup>
     62     <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
     63   </PropertyGroup>
     64 
     65   <!-- Build PowerShell Module -->
     66   <PropertyGroup>
     67     <PowerShellModuleOutputDirectory>$(BuildOutputDirectory)PowerShell\Microsoft.WinGet.Client</PowerShellModuleOutputDirectory>
     68     <PowerShellModuleRuntimesDir>$(PowerShellModuleOutputDirectory)\$(TargetFramework)</PowerShellModuleRuntimesDir>
     69   </PropertyGroup>
     70 
     71   <PropertyGroup>
     72     <PowerShellModuleSharedDependencies>$(PowerShellModuleRuntimesDir)\SharedDependencies</PowerShellModuleSharedDependencies>
     73     <PowerShellModuleDirectDependencies>$(PowerShellModuleRuntimesDir)\DirectDependencies</PowerShellModuleDirectDependencies>
     74   </PropertyGroup>
     75 
     76   <!-- psd1 and ps1xml-->
     77   <Target Name="CopyModuleFiles" AfterTargets="AfterBuild">
     78     <ItemGroup>
     79       <ModuleFiles Include="$(ProjectDir)\..\Microsoft.WinGet.Client\ModuleFiles\**\*.*" />
     80     </ItemGroup>
     81     <Message Importance="high" Text="Copying PowerShell module files to '$(PowerShellModuleOutputDirectory)'" />
     82     <Copy SourceFiles="@(ModuleFiles)" DestinationFiles="$(PowerShellModuleOutputDirectory)\%(RecursiveDir)%(Filename)%(Extension)" />
     83   </Target>
     84 
     85   <!-- Main binaries -->
     86   <Target Name="CopyWinGetBinaries" AfterTargets="AfterBuild">
     87     <ItemGroup>
     88       <ModuleWinGetFile Include="$(OutputPath)Microsoft.WinGet.Client.Cmdlets.dll" />
     89       <ModuleWinGetFile Include="$(OutputPath)Microsoft.WinGet.Client.Cmdlets.pdb" Condition="'$(Configuration)' == 'Debug'" />
     90     </ItemGroup>
     91     <Message Importance="high" Text="Copying CopyWinGetBinaries: '@(ModuleWinGetFile)'" />
     92     <Copy SourceFiles="@(ModuleWinGetFile)" DestinationFolder="$(PowerShellModuleRuntimesDir)" />
     93   </Target>
     94 
     95   <!-- Direct dependencies -->
     96   <Target Name="CopyDirectDependencies" AfterTargets="AfterBuild">
     97     <ItemGroup>
     98       <ModuleDirectDependency Include="$(OutputPath)Microsoft.WinGet.Client.Engine.dll" />
     99       <ModuleDirectDependency Include="$(OutputPath)Microsoft.WinGet.Client.Engine.pdb" Condition="'$(Configuration)' == 'Debug'" />
    100     </ItemGroup>
    101     <Message Importance="high" Text="Copying direct dependencies: '@(ModuleDirectDependency)'" />
    102     <Copy SourceFiles="@(ModuleDirectDependency)" DestinationFolder="$(PowerShellModuleDirectDependencies)" />
    103   </Target>
    104 
    105   <!-- Shared managed dependencies -->
    106   <Target Name="CopyManagedDependencies" AfterTargets="AfterBuild">
    107     <ItemGroup>
    108       <ManagedDependency Include="$(OutputPath)Newtonsoft.Json.dll" />
    109       <ManagedDependency Include="$(OutputPath)Octokit.dll" />
    110       <ManagedDependency Include="$(OutputPath)Microsoft.WinGet.SharedLib.dll" />
    111       <ManagedDependency Include="$(OutputPath)Microsoft.Win32.Registry.dll" Condition="'$(TargetFramework)' == '$(DesktopFramework)'" />
    112       <ManagedDependency Include="$(OutputPath)Semver.dll" />
    113     </ItemGroup>
    114     <Message Importance="high" Text="Copying managed shared dependencies: '@(ManagedDependency)'" />
    115     <Copy SourceFiles="@(ManagedDependency)" DestinationFolder="$(PowerShellModuleSharedDependencies)" />
    116   </Target>
    117 
    118 </Project>