Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
280 lines (247 sloc) 19.1 KB
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Go" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildProjectDirectory)\Build.tasks" />
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<NuGetRoot>$(MSBuildProjectDirectory)\..</NuGetRoot>
<NuGetTestRoot>$(NuGetRoot)\test</NuGetTestRoot>
<NuGetSrcRoot>$(NuGetRoot)\src</NuGetSrcRoot>
<DropDirectory>$(NuGetRoot)\bin</DropDirectory>
<ArtifactDropDirectory>$(DropDirectory)\artifacts</ArtifactDropDirectory>
<NuGetDropDirectory>$(DropDirectory)\NuGet</NuGetDropDirectory>
<ExeBuildDirectory>$(NuGetSrcRoot)\CommandLine\bin\$(Configuration)</ExeBuildDirectory>
<ExeDropDirectory>$(NuGetDropDirectory)\Console</ExeDropDirectory>
<ServerExtensionsBuildDirectory>$(NuGetSrcRoot)\CommandLine.ServerExtensions\bin\$(Configuration)</ServerExtensionsBuildDirectory>
<ServerExtensionsDropDirectory>$(NuGetDropDirectory)\CommandLine.ServerExtensions</ServerExtensionsDropDirectory>
<BootStrapperBuildDirectory>$(NuGetSrcRoot)\Bootstrapper\bin\$(Configuration)</BootStrapperBuildDirectory>
<BootStrapperDropDirectory>$(NuGetDropDirectory)\Bootstrapper</BootStrapperDropDirectory>
<VisualStudioAddInBuildDirectory>$(NuGetSrcRoot)\VsExtension\bin\$(Configuration)</VisualStudioAddInBuildDirectory>
<VisualStudioAddInDropDirectory>$(NuGetDropDirectory)\VisualStudioAddIn</VisualStudioAddInDropDirectory>
<EndToEndTestsDirectory>$(NuGetTestRoot)\EndToEnd</EndToEndTestsDirectory>
<EndToEndTestsDropDirectory>$(NuGetDropDirectory)\EndToEnd\Artifacts</EndToEndTestsDropDirectory>
<ServerBuildDirectory>$(NuGetSrcRoot)\Server</ServerBuildDirectory>
<ServerDropDirectory>$(NuGetDropDirectory)\Server</ServerDropDirectory>
<NuGetCoreBuildDirectory>$(NuGetSrcRoot)\Core</NuGetCoreBuildDirectory>
<NuGetCoreDropDirectory>$(NuGetDropDirectory)\Core</NuGetCoreDropDirectory>
<NuGetBuildDropDirectory>$(NuGetDropDirectory)\Build</NuGetBuildDropDirectory>
<NuGetVisualStudioBuildDirectory>$(NuGetSrcRoot)\VisualStudio</NuGetVisualStudioBuildDirectory>
<NuGetVisualStudioDropDirectory>$(NuGetDropDirectory)\VisualStudio</NuGetVisualStudioDropDirectory>
<GenerateTestPackageProjectDirectory>$(NuGetRoot)\Tools\NuGet\GenerateTestPackages</GenerateTestPackageProjectDirectory>
<GenerateTestPackageExe>$(GenerateTestPackageProjectDirectory)\bin\$(Configuration)\GenerateTestPackages.exe</GenerateTestPackageExe>
<ZipExe>$(NuGetRoot)\Tools\7za920\7za.exe</ZipExe>
<ILMergeExe>$(NuGetRoot)\Tools\ILMerge\ILMerge.exe</ILMergeExe>
<ILMergeArtifactDirectory>$(ArtifactDropDirectory)\ILMerge</ILMergeArtifactDirectory>
<ILMergeInternalizeIgnoreFile>$(NuGetRoot)\Build\ilmerge.internalize.ignore.txt</ILMergeInternalizeIgnoreFile>
</PropertyGroup>
<PropertyGroup>
<MajorVersion>2</MajorVersion>
<MinorVersion>2</MinorVersion>
<!-- Ensure that we come up with a new version every 65535 years -->
<VersionStartYear>2010</VersionStartYear>
<!-- Build number is of the format (CurrentYear - VersionStartYear + 1)(2 digit month)(2 digit day) -->
<Build>$([MSBuild]::Add(1, $([MSBuild]::Subtract($([System.DateTime]::Now.Year), $(VersionStartYear)))))$([System.DateTime]::Now.ToString("MMdd"))</Build>
<Revision>$(BUILD_NUMBER)</Revision>
<Version>$(MajorVersion).$(MinorVersion).$(Build).$(Revision)</Version>
<PackageVersion>$(MajorVersion).$(MinorVersion).0</PackageVersion>
</PropertyGroup>
<ItemGroup>
<RegexTransform Include="$(NuGetSrcRoot)\VsExtension\source.extension.vsixmanifest">
<Find><![CDATA[<Version>\d+\.\d+\.\d+\.\d+</Version>]]></Find>
<ReplaceWith><![CDATA[<Version>$(Version)</Version>]]></ReplaceWith>
</RegexTransform>
<RegexTransform Include="$(NuGetSrcRoot)\VsExtension\source.extension.vsixmanifest">
<Find><![CDATA[<AllUsers>false</AllUsers>]]></Find>
<ReplaceWith><![CDATA[<AllUsers>true</AllUsers>]]></ReplaceWith>
</RegexTransform>
<RegexTransform Include="$(NuGetRoot)\Common\CommonAssemblyInfo.cs">
<Find>AssemblyVersion\("\d+\.\d+\.\d+\.\d+"\)</Find>
<ReplaceWith>AssemblyVersion("$(Version)")</ReplaceWith>
</RegexTransform>
<RegexTransform Include="$(NuGetRoot)\Common\CommonAssemblyInfo.cs">
<Find>AssemblyInformationalVersion\("\d+\.\d+\.\d+"\)</Find>
<ReplaceWith>AssemblyInformationalVersion("$(PackageVersion)")</ReplaceWith>
</RegexTransform>
<RegexTransform Include="$(NuGetSrcRoot)\VsConsole\PowerShellHost\Scripts\nuget.psd1">
<Find><![CDATA[ModuleVersion = '\d+\.\d+\.\d+\.\d+']]></Find>
<ReplaceWith><![CDATA[ModuleVersion = '$(Version)']]></ReplaceWith>
</RegexTransform>
<RegexTransform Include="$(NuGetSrcRoot)\VsExtension\NuGetPackage.cs">
<Find><![CDATA[ProductVersion = "\d+\.\d+\.\d+\.\d+"]]></Find>
<ReplaceWith><![CDATA[ProductVersion = "$(Version)"]]></ReplaceWith>
</RegexTransform>
<RegexTransform Include="$(NuGetSrcRoot)\**\*.nuspec">
<Find><![CDATA[<version>\d+\.\d+\.\d+\.\d+</version>]]></Find>
<ReplaceWith><![CDATA[<version>$(Version)</version>]]></ReplaceWith>
</RegexTransform>
</ItemGroup>
<ItemGroup>
<TestProjects Include="$(NuGetTestRoot)\Dialog.Test\Dialog.Test.csproj" />
<TestProjects Include="$(NuGetTestRoot)\CommandLine.Test\CommandLine.Test.csproj" />
<TestProjects Include="$(NuGetTestRoot)\Core.Test\Core.Test.csproj" />
<TestProjects Include="$(NuGetTestRoot)\VisualStudio.Test\VisualStudio.Test.csproj" />
<TestProjects Include="$(NuGetTestRoot)\PowerShellCmdlets.Test\PowerShellCmdlets.Test.csproj" />
<TestProjects Include="$(NuGetTestRoot)\PowerShellHost.Test\PowerShellHost.Test.csproj" />
<TestProjects Include="$(NuGetTestRoot)\Server.Test\Server.Test.csproj" />
<TestProjects Include="$(NuGetTestRoot)\TeamFoundationServer.Test\TeamFoundationServer.Test.csproj" />
<TestProjects Include="$(NuGetTestRoot)\Test.Integration\Test.Integration.csproj" />
</ItemGroup>
<Target Name="Go"
DependsOnTargets="CheckFxCop; UpdateVsixVersion; RestorePackages; Build; ReportFxCopResults;
VerifyAssembliesInVsix; RunTests; CreateDropDirectories; CopyExecutableOutputToDropDirectory;
CopyBootStrapperOutputToDropDirectory; CopyServerExtensionsOutputToDropDirectory;
CopyVisualStudioAddInOutputToDropDirectory; CopyEndToEndTestsToDropDirectory;
CopyServerOutputToDropDirectory; CopyLicenseToAllDirectories; BuildPackages">
</Target>
<Target Name="CheckFxCop">
<Error
Condition="!Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\CodeAnalysis\fxcoptask.dll') And !Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v11.0\CodeAnalysis\fxcoptask.dll')"
Text="FxCop not found at $(MSBuildExtensionsPath)\Microsoft\VisualStudio\[v10.0|v11.0]\CodeAnalysis\fxcoptask.dll. Cannot proceed." />
</Target>
<Target Name="UpdateVsixVersion" Condition="'$(BUILD_NUMBER)' != ''">
<RegexTransform Items="@(RegexTransform)" />
</Target>
<Target Name="RestorePackages">
<MsBuild Projects="$(NuGetRoot)\src\CommandLine\CommandLine.csproj"
Targets="Build"
Properties="DefineConstants=CODE_ANALYSIS" />
<ItemGroup>
<RestorePackageProjects Include="@(TestProjects)" />
<RestorePackageProjects Include="$(NuGetRoot)\test\Test.Utility\Test.Utility.csproj" />
<RestorePackageProjects Include="$(NuGetRoot)\src\Server\Server.csproj" />
</ItemGroup>
<Message Text="Restoring NuGet packages" Importance="High" />
<MsBuild Projects="@(RestorePackageProjects)"
Targets="RestorePackages"
Properties="NuGetExePath=$(ExeBuildDirectory)\NuGet.exe;NuGetRoot=$(NuGetRoot)"
BuildInParallel="true" />
</Target>
<Target Name="Build">
<MSBuild Projects="$(NuGetRoot)\NuGet.sln" Targets="Build" Properties="EnableCodeAnalysis=true" />
</Target>
<Target Name="VerifyAssembliesInVSIX">
<PropertyGroup>
<VsixFileLocation>$(VisualStudioAddInBuildDirectory)\NuGet.Tools.vsix</VsixFileLocation>
<TempVsixDirectory>$(DropDirectory)\Temp</TempVsixDirectory>
</PropertyGroup>
<RemoveDir Directories="$(TempVsixDirectory)" Condition="Exists($(TempVsixDirectory))" />
<Exec Command="&quot;$(ZipExe)&quot; x -o&quot;$(TempVsixDirectory)&quot; &quot;$(VsixFileLocation)&quot;" />
<ItemGroup>
<VsixAssemblies Include="$(TempVsixDirectory)\*.dll" />
</ItemGroup>
<CheckUnexpectedAssemblies Items="@(VsixAssemblies)" />
<RemoveDir Directories="$(TempVsixDirectory)" ContinueOnError="true" />
</Target>
<Target Name="RunTests">
<PropertyGroup>
<!-- Team City under-reports tests when they're run in parallel. We'll specifically disable it in there -->
<BuildTestsInParallel Condition=" '$(TEAMCITY_VERSION)' == '' ">true</BuildTestsInParallel>
<BuildTestsInParallel Condition=" '$(TEAMCITY_VERSION)' != '' ">false</BuildTestsInParallel>
</PropertyGroup>
<MsBuild Projects="@(TestProjects)"
Targets="RunTests"
BuildInParallel="$(BuildTestsInParallel)" />
</Target>
<Target Name="ReportFxCopResults">
<ItemGroup>
<FxCopOutputItems Include="$(NuGetRoot)\**\*.dll.CodeAnalysisLog.xml" />
</ItemGroup>
<Message Text="##teamcity[importData type='FxCop' path='%(FxCopOutputItems.Identity)']" />
</Target>
<Target Name="CreateDropDirectories">
<Message Text="Making the output directories for the compiled output at '$(DropDirectory)'." />
<RemoveDir Directories="$(DropDirectory)" Condition="Exists('$(DropDirectory)')" ContinueOnError="True" />
<MakeDir Directories="$(DropDirectory)" Condition="!Exists('$(DropDirectory)')" />
<MakeDir Directories="$(ArtifactDropDirectory)" Condition="!Exists('$(ArtifactDropDirectory)')" />
<MakeDir Directories="$(NuGetDropDirectory)" Condition="!Exists('$(NuGetDropDirectory)')" />
<MakeDir Directories="$(ExeDropDirectory)" Condition="!Exists('$(ExeDropDirectory)')" />
<MakeDir Directories="$(BootStrapperDropDirectory)" Condition="!Exists('$(BootStrapperDropDirectory)')" />
<MakeDir Directories="$(VisualStudioAddInDropDirectory)" Condition="!Exists('$(VisualStudioAddInDropDirectory)')" />
<MakeDir Directories="$(ServerDropDirectory)" Condition="!Exists('$(ServerDropDirectory)')" />
<MakeDir Directories="$(NuGetCoreDropDirectory)" Condition="!Exists('$(NuGetCoreDropDirectory)')" />
<MakeDir Directories="$(NuGetVisualStudioDropDirectory)" Condition="!Exists('$(NuGetVisualStudioDropDirectory)')" />
<MakeDir Directories="$(ExtensionsDropDirectory)" Condition="!Exists('$(ExtensionsDropDirectory)')" />
<MakeDir Directories="$(ServerExtensionsBuildDirectory)" Condition="!Exists('$(ServerExtensionsBuildDirectory)')" />
<MakeDir Directories="$(NuGetBuildDropDirectory)" Condition="!Exists('$(NuGetBuildDropDirectory)')" />
</Target>
<Target Name="CopyExecutableOutputToDropDirectory">
<ItemGroup>
<ExecutableFiles Include="$(ExeBuildDirectory)\Merged\NuGet.exe;$(NuGetSrcRoot)\CommandLine\Properties\*.nuspec" />
</ItemGroup>
<Message Text="Copying the NuGet Console output to $(ExeDropDirectory)" />
<Copy ContinueOnError="false" SourceFiles="@(ExecutableFiles)" DestinationFolder="$(ExeDropDirectory)" />
</Target>
<Target Name="CopyBootStrapperOutputToDropDirectory">
<ItemGroup>
<BootStrapperOutputItems Exclude="$(BootStrapperBuildDirectory)\**\*.pdb" Include="$(BootStrapperBuildDirectory)\**\*.*" />
</ItemGroup>
<Message Text="Copying the NuGet BootStrapper output to $(BootStrapperDropDirectory)" />
<Copy ContinueOnError="false" SourceFiles="@(BootStrapperOutputItems)" DestinationFiles="@(BootStrapperOutputItems ->'$(BootStrapperDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<Target Name="CopyServerExtensionsOutputToDropDirectory">
<Message Text="Rebuilding server extensions" />
<MSBuild Projects="$(NuGetSrcRoot)\CommandLine.ServerExtensions\CommandLine.ServerExtensions.csproj" Properties="CIBuild=true;SignAssembly=false;" Targets="Clean;Build" />
<!-- Since this is an extension, it needs to be compiled against the IL Merged nuget.exe. So we rebuild it with the magic flag that tells it to be compiled -->
<ItemGroup>
<ServerExtensionsOutputItems Include="$(ServerExtensionsBuildDirectory)\NuGet.ServerExtensions.dll" />
</ItemGroup>
<Message Text="Copying Server extensions output from $(ServerExtensionsBuildDirectory) to $(ServerExtensionsDropDirectory): @(ServerExtensionsOutputItems) " />
<Copy ContinueOnError="false"
SourceFiles="@(ServerExtensionsOutputItems)"
DestinationFolder="$(ServerExtensionsDropDirectory)" />
<!-- Delete the source file for good measure -->
<Delete Files="@(ServerExtensionsOutputItems)" />
</Target>
<Target Name="CopyVisualStudioAddInOutputToDropDirectory">
<ItemGroup>
<VisualStudioAddInOutputItems Include="$(VisualStudioAddInBuildDirectory)\**\*.vsix" />
<VisualStudioAddInOutputItems Include="$(VisualStudioAddInBuildDirectory)\**\NuGet.VisualStudio.dll" />
<VisualStudioAddInOutputItems Include="$(VisualStudioAddInBuildDirectory)\**\NuGet.VisualStudio.pdb" />
<VisualStudioAddInOutputItems Include="$(VisualStudioAddInBuildDirectory)\**\NuGet.VisualStudio.Interop.dll" />
<VisualStudioAddInOutputItems Include="$(VisualStudioAddInBuildDirectory)\**\NuGet.VisualStudio.Interop.pdb" />
<VisualStudioAddInOutputItems Include="$(VisualStudioAddInBuildDirectory)\**\NuGetConsole.Host.PowerShell.dll" />
<VisualStudioAddInOutputItems Include="$(VisualStudioAddInBuildDirectory)\**\NuGetConsole.Host.PowerShell.pdb" />
<VisualStudioAddInOutputItems Include="$(VisualStudioAddInBuildDirectory)\**\NuGetConsole.Host.PowerShellProvider.dll" />
<VisualStudioAddInOutputItems Include="$(VisualStudioAddInBuildDirectory)\**\NuGetConsole.Host.PowerShellProvider.pdb" />
</ItemGroup>
<Message Text="Copying the NuGet Visual Studio Add-In output to $(VisualStudioAddInDropDirectory)" />
<Copy ContinueOnError="false" SourceFiles="@(VisualStudioAddInOutputItems)" DestinationFiles="@(VisualStudioAddInOutputItems ->'$(VisualStudioAddInDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<Target Name="CopyEndToEndTestsToDropDirectory" Condition=" '$(ProduceEndToEndTest)' == 'true' ">
<ItemGroup>
<EndToEndTestItems Include="$(EndToEndTestsDirectory)\**\*.*" />
<EndToEndTestItems Remove="$(EndToEndTestsDirectory)\bin\**\*.*" />
</ItemGroup>
<Copy ContinueOnError="false" SourceFiles="@(EndToEndTestItems)" DestinationFiles="@(EndToEndTestItems ->'$(EndToEndTestsDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Message Text="Zipping the EndToEnd directory..." Importance="high" />
<Exec Command="&quot;$(ZipExe)&quot; a ..\EndToEnd.zip" WorkingDirectory="$(EndToEndTestsDropDirectory)" />
</Target>
<Target Name="CopyServerOutputToDropDirectory">
<ItemGroup>
<ServerOutputItems Include="$(ServerBuildDirectory)\**\*.*" Exclude="$(ServerBuildDirectory)\**\*.cs;$(ServerBuildDirectory)\**\*.csp*;$(ServerBuildDirectory)\obj\**\*.*;$(ServerBuildDirectory)\Packages\**\*.*;$(ServerBuildDirectory)\App_Data\**"/>
</ItemGroup>
<Message Text="Copying the NuGet Server output to $(ServerDropDirectory)" />
<Copy ContinueOnError="false" SourceFiles="@(ServerOutputItems)" DestinationFiles="@(ServerOutputItems ->'$(ServerDropDirectory)\www\%(RecursiveDir)%(Filename)%(Extension)')" />
<Exec Command="&quot;$(ZipExe)&quot; a ..\server.zip" WorkingDirectory="$(ServerDropDirectory)\www" />
<RemoveDir Directories="$(ServerDropDirectory)\www" />
</Target>
<Target Name="CopyLicenseToAllDirectories">
<ItemGroup>
<LicenseFileItems Include="$(MSBuildProjectDirectory)\..\LICENSE.txt" />
</ItemGroup>
<Message Text="Copying the License to all drop directories" />
<Copy ContinueOnError="false" SourceFiles="@(LicenseFileItems)" DestinationFiles="@(LicenseFileItems -&gt;'$(ExeDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy ContinueOnError="false" SourceFiles="@(LicenseFileItems)" DestinationFiles="@(LicenseFileItems -&gt;'$(VisualStudioAddInDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy ContinueOnError="false" SourceFiles="@(LicenseFileItems)" DestinationFiles="@(LicenseFileItems -&gt;'$(ServerDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<Target Name="BuildPackages">
<PropertyGroup>
<NuGetExe>$(ExeDropDirectory)\NuGet.exe</NuGetExe>
</PropertyGroup>
<Exec Command="&quot;$(NuGetExe)&quot; pack NuGet.CommandLine.nuspec -NoPackageAnalysis -Version $(PackageVersion)" WorkingDirectory="$(ExeDropDirectory)" />
<Exec Command="&quot;$(NuGetExe)&quot; pack NuGet.Bootstrapper.nuspec -NoPackageAnalysis -Version $(PackageVersion)" WorkingDirectory="$(ExeDropDirectory)" />
<Exec Command="&quot;$(NuGetExe)&quot; pack -NoPackageAnalysis -Version $(PackageVersion) -o &quot;$(ServerDropDirectory)&quot; -Build -p AdditionalSettingsImport=$(AdditionalSettingsImport) -p Configuration=Release -Symbols -exclude **\NuGet.Core.*" WorkingDirectory="$(ServerBuildDirectory)" />
<Exec Command="&quot;$(NuGetExe)&quot; pack -NoPackageAnalysis -Version $(PackageVersion) -o &quot;$(NuGetCoreDropDirectory)&quot; -Build -Symbols -p AdditionalSettingsImport=$(AdditionalSettingsImport)" WorkingDirectory="$(NuGetCoreBuildDirectory)" />
<Exec Command="&quot;$(NuGetExe)&quot; pack -NoPackageAnalysis -Version $(PackageVersion) -o &quot;$(NuGetBuildDropDirectory)&quot;" WorkingDirectory="$(NuGetSrcRoot)\Build" />
<Exec Command="&quot;$(NuGetExe)&quot; pack -NoPackageAnalysis -Version $(PackageVersion) -o &quot;$(NuGetVisualStudioDropDirectory)&quot; -Build -p AdditionalSettingsImport=$(AdditionalSettingsImport)" WorkingDirectory="$(NuGetVisualStudioBuildDirectory)" />
</Target>
</Project>
Jump to Line
Something went wrong with that request. Please try again.