forked from NuGet/NuGet.Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNuGet.CommandLine.csproj
158 lines (143 loc) · 7.17 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
154
155
156
157
158
<Project>
<PropertyGroup>
<IsCommandLinePackage>true</IsCommandLinePackage>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'NuGet.sln'))\build\common.props" />
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Import Project="ilmerge.props" />
<PropertyGroup>
<RootNamespace>NuGet.CommandLine</RootNamespace>
<AssemblyName>NuGet</AssemblyName>
<AssemblyTitle>NuGet Command Line</AssemblyTitle>
<TargetFramework>$(NETFXTargetFramework)</TargetFramework>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<PackageId>NuGet.Commandline</PackageId>
<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>
</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>$(NuGetPackageRoot)nuget.core\$(NuGetCoreV2Version)\lib\net40-Client\NuGet.Core.dll</HintPath>
<Aliases>CoreV2</Aliases>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageDownload Include="NuGet.Core" />
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" />
<ProjectReference Include="$(NuGetCoreSrcDirectory)NuGet.PackageManagement\NuGet.PackageManagement.csproj" />
<ProjectReference Include="$(NuGetCoreSrcDirectory)NuGet.Build.Tasks\NuGet.Build.Tasks.csproj" />
</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" Exclude="@(MergeExclude)" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(NuGetCoreSrcDirectory)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" Exclude="@(MergeExclude)" />
</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>$(ILMergeExePath) /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>
</PropertyGroup>
<MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(PathToMergedNuGetExe)))" />
<Exec Command="$(IlmergeCommand)" ContinueOnError="false" />
</Target>
<Import Project="$(BuildCommonDirectory)common.targets" />
<Target Name="NuGetLinkVSSDKEmbeddableAssemblies" AfterTargets="ResolveReferences" BeforeTargets="FindReferenceAssembliesForReferences">
<ItemGroup>
<ReferencePath Condition="'%(FileName)' == 'Microsoft.VisualStudio.Setup.Configuration.Interop'">
<EmbedInteropTypes>true</EmbedInteropTypes>
</ReferencePath>
</ItemGroup>
</Target>
<!-- Do nothing. This basically strips away the framework assemblies from the resulting nuspec.-->
<Target Name="_GetFrameworkAssemblyReferences" DependsOnTargets="ResolveReferences" />
<Target Name="GetSigningInputs" Returns="@(DllsToSign)">
<ItemGroup>
<DllsToSign Include="$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.exe">
<StrongName>MsSharedLib72</StrongName>
<Authenticode>Microsoft400</Authenticode>
</DllsToSign>
</ItemGroup>
</Target>
<Target Name="GetSymbolsToIndex" Returns="@(SymbolsToIndex)">
<ItemGroup>
<SymbolsToIndex Include="$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.exe" />
<SymbolsToIndex Include="$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.pdb" />
</ItemGroup>
</Target>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>