-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathWingetCreateCLI.csproj
More file actions
120 lines (104 loc) · 5.85 KB
/
Copy pathWingetCreateCLI.csproj
File metadata and controls
120 lines (104 loc) · 5.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
<AssemblyName>WingetCreateCLI</AssemblyName>
<RootNamespace>Microsoft.WingetCreateCLI</RootNamespace>
<Version>1.12</Version>
<Platforms>x64;x86</Platforms>
<RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DefineConstants>TELEMETRYEVENTSOURCE_PUBLIC</DefineConstants>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="..\stylecop.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" />
<PackageReference Include="CommandLineParser" />
<PackageReference Include="DesktopBridge.Helpers" />
<PackageReference Include="Microsoft.Windows.CsWin32">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NSwag.MSBuild">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Sharprompt" />
<PackageReference Include="StyleCop.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.ProtectedData" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WingetCreateCore\WingetCreateCore.csproj" />
</ItemGroup>
<!--This is to workaround a similar issue as to what's
described at https://github.com/dotnet/runtime/issues/3807. When the wapproj is published, the native
PDBs in its dependencies are declared in the deps.json file, but the PDBs themselves are stripped away
during the build. It'll build without complaint, but at runtime we get a message like:
Message: Error:
An assembly specified in the application dependencies manifest (WingetCreateCLI.deps.json) was not found:
package: 'Microsoft.WindowsPackageManager.Utils', version: '0.2.2'
path: 'runtimes/win-x64/native/WinGetUtil.pdb'
This modifies the inputs to GenerateBuildDependencyFile to remove Wingetutil.pdb from the deps.json file when it's generated.
-->
<Target Name="StripNativePDBFromDepsJson" BeforeTargets="GenerateBuildDependencyFile">
<ItemGroup>
<RuntimeTargetsCopyLocalItems Remove="@(RuntimeTargetsCopyLocalItems)" Condition="'%(RuntimeTargetsCopyLocalItems.Extension)' == '.pdb' AND %(RuntimeTargetsCopyLocalItems.NuGetPackageId) == 'Microsoft.WindowsPackageManager.Utils'" />
<NativeCopyLocalItems Remove="@(NativeCopyLocalItems)" Condition="'%(NativeCopyLocalItems.Extension)' == '.pdb' AND %(NativeCopyLocalItems.NuGetPackageId) == 'Microsoft.WindowsPackageManager.Utils'" />
</ItemGroup>
</Target>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
</ItemGroup>
<ItemGroup>
<!-- The localized resources are dropped in \Localization\Resources as part of the patch file from TouchDown. We can't simply Include them, as they must appear to be under the
Properties directory to be properly included. We can fake this by using the <Link> tag which includes them virtually under specified directory -->
<EmbeddedResource Include="..\..\Localization\Resources\**\*.resx" LinkBase="Properties">
<Link>%(LinkBase)\%(Filename)%(Extension)</Link>
<Visible>false</Visible>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.resx">
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
</ItemGroup>
<!--Include VCLib binary dependencies-->
<ItemGroup Condition="'$(SelfContained)' == true">
<None Update="msvcp140.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="vcruntime140.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="vcruntime140_1.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<SettingSchema Include="$(ProjectDir)\Schemas\settings.schema.0.1.json" ModelName="Settings" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>
<!--Generate settings manifest-->
<Target Name="PreBuild" BeforeTargets="PreBuildEvent" Inputs="@(SettingSchema)" Outputs="@(SettingSchema -> '$(ProjectDir)Models\%(ModelName)Model.cs')">
<Message Importance="high" Text="Rebuilding: %(SettingSchema.ModelName) because $(ProjectDir)Models\%(ModelName)Model.cs is older than %(FullPath)" />
<Exec Command="$(NSwagExe) jsonschema2csclient /name:%(ModelName)Manifest /namespace:Microsoft.WingetCreateCLI.Models.%(SettingSchema.ModelName) /input:%(FullPath) /output:$(ProjectDir)Models\%(ModelName)Model.cs /InlineNamedArrays:true /RequiredPropertiesMustBeDefined:false /ArrayType:System.Collections.Generic.List /ArrayInstanceType:System.Collections.Generic.List" />
</Target>
<!-- Workaround for https://github.com/dotnet/msbuild/issues/5981, will no longer be necessary in msbuild v16.10.0-preview-21181-07+ -->
<Target Name="FixAL1703Warning" BeforeTargets="GenerateSatelliteAssemblies" Condition="'$(PlatformTarget)' == 'x64'">
<Message Text="Adjusting SDK tools directory to use x64 version of AL.EXE" />
<PropertyGroup>
<SdkToolsPathMaybeWithx64Architecture>$(TargetFrameworkSDKToolsDirectory)$(PlatformTarget)\</SdkToolsPathMaybeWithx64Architecture>
</PropertyGroup>
</Target>
</Project>