forked from NuGet/NuGet.Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNuGet.CommandLine.csproj
153 lines (142 loc) · 7.12 KB
/
NuGet.CommandLine.csproj
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="ilmerge.props" />
<PropertyGroup>
<RootNamespace>NuGet.CommandLine</RootNamespace>
<AssemblyName>NuGet</AssemblyName>
<AssemblyTitle>NuGet Command Line</AssemblyTitle>
<PackageId>NuGet.CommandLine</PackageId>
<TargetFramework>$(NETFXTargetFramework)</TargetFramework>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<Description>NuGet Command Line Interface.</Description>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Shipping>true</Shipping>
<OutputType>Exe</OutputType>
<ComVisible>false</ComVisible>
<!-- Pack properties-->
<PackProject>true</PackProject>
<IncludeBuildOutput>false</IncludeBuildOutput>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);CreateCommandlineNupkg</TargetsForTfmSpecificContentInPackage>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<DevelopmentDependency>true</DevelopmentDependency>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<UsePublicApiAnalyzer>false</UsePublicApiAnalyzer>
<GetSigningInputsDependsOn>GetSigningInputsCustom</GetSigningInputsDependsOn>
<GetSymbolsToIndexDependsOn>GetSymbolsToIndexCustom</GetSymbolsToIndexDependsOn>
</PropertyGroup>
<Target Name="CreateCommandlineNupkg">
<ItemGroup>
<TfmSpecificPackageFile Include="$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.exe">
<PackagePath>tools/</PackagePath>
</TfmSpecificPackageFile>
<TfmSpecificPackageFile Include="$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.pdb">
<PackagePath>tools/</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
</Target>
<ItemGroup>
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.Composition.Registration" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="NuGet.Core">
<HintPath>$(PkgNuGet_Core)\lib\net40-Client\NuGet.Core.dll</HintPath>
<Aliases>CoreV2</Aliases>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="NuGet.Core" ExcludeAssets="All" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" ExcludeAssets="Runtime" />
<ProjectReference Include="..\..\NuGet.Core\NuGet.PackageManagement\NuGet.PackageManagement.csproj" />
<ProjectReference Include="..\..\NuGet.Core\NuGet.Build.Tasks\NuGet.Build.Tasks.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ILMerge" PrivateAssets="All" />
<None Include="$(BuildCommonDirectory)\NOTICES.txt" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="NuGetCommand.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>NuGetCommand.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Compile Update="NuGetCommand.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>NuGetCommand.resx</DependentUpon>
</Compile>
<EmbeddedResource Update="NuGetResources.resx">
<!-- Strings are shared by other projects, use public strings. -->
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>NuGetResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Compile Update="NuGetResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>NuGetResources.resx</DependentUpon>
</Compile>
<!-- nuget.exe localized assemblies -->
<EmbeddedResource Include="$(OutputPath)\**\$(AssemblyName).resources.dll" />
<!-- NuGet.Commands localized assemblies -->
<LocResource Include="$(OutputPath)\**\NuGet.Commands.resources.dll" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\NuGet.Core\NuGet.Build.Tasks\NuGet.targets">
<Link>NuGet.targets</Link>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Target Name="DetermineILMergeNuGetExeInputsOutputs">
<PropertyGroup>
<PathToBuiltNuGetExe>$(OutputPath)NuGet.exe</PathToBuiltNuGetExe>
<PathToMergedNuGetExe>$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.exe</PathToMergedNuGetExe>
</PropertyGroup>
<ItemGroup>
<!-- Dependent assemblies -->
<BuildArtifacts Include="$(OutputPath)\*.dll" />
</ItemGroup>
<Message Text="$(MSBuildProjectName) -> $(PathToMergedNuGetExe)" Importance="High" />
</Target>
<!-- Since we are moving some code and strings from NuGet.CommandLine to NuGet.Commands, we opted to go through normal localization process
(build .resources.dll) and then add them to the ILMerged nuget.exe -->
<!-- This will also be called from CI build, after assemblies are localized, since our test infra takes nuget.exe before Localization -->
<Target Name="ILMergeNuGetExe"
AfterTargets="Build"
DependsOnTargets="DetermineILMergeNuGetExeInputsOutputs"
Inputs="$(PathToBuiltNuGetExe);@(BuildArtifacts)"
Outputs="$(PathToMergedNuGetExe)"
Condition="'$(BuildingInsideVisualStudio)' != 'true' and '$(SkipILMergeOfNuGetExe)' != 'true'" >
<PropertyGroup>
<IlmergeCommand>$(ILMergeConsolePath) /lib:$(OutputPath) /out:$(PathToMergedNuGetExe) @(MergeAllowDup -> '/allowdup:%(Identity)', ' ') /log:$(OutputPath)IlMergeLog.txt</IlmergeCommand>
<IlmergeCommand Condition="Exists($(MS_PFX_PATH))">$(IlmergeCommand) /delaysign /keyfile:$(MS_PFX_PATH)</IlmergeCommand>
<IlmergeCommand>$(IlmergeCommand) $(PathToBuiltNuGetExe) @(BuildArtifacts->'%(fullpath)', ' ')</IlmergeCommand>
<IlmergeCommand>$(IlmergeCommand) @(LocResource->'%(fullpath)', ' ')</IlmergeCommand>
</PropertyGroup>
<MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(PathToMergedNuGetExe)))" />
<Exec Command="$(IlmergeCommand)" ContinueOnError="false" />
</Target>
<!-- This strips away the framework assemblies from the resulting nuspec.-->
<Target Name="ClearFrameworkAssemblyReferences" BeforeTargets="GenerateNuspec" DependsOnTargets="$(GenerateNuspecDependsOn)">
<ItemGroup>
<_FrameworkAssemblyReferences Remove="@(_FrameworkAssemblyReferences)" />
</ItemGroup>
</Target>
<Target Name="GetSigningInputsCustom" Returns="@(DllsToSign)">
<ItemGroup>
<DllsToSign Include="$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.exe">
<StrongName>MsSharedLib72</StrongName>
<Authenticode>Microsoft400</Authenticode>
</DllsToSign>
</ItemGroup>
</Target>
<Target Name="GetSymbolsToIndexCustom" Returns="@(SymbolsToIndex)">
<ItemGroup>
<SymbolsToIndex Include="$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.exe" />
<SymbolsToIndex Include="$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.pdb" />
</ItemGroup>
</Target>
</Project>