1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
5 <Import Project="$(PackagesDir)/$(FeedTasksPackage.ToLower())/$(FeedTasksPackageVersion)/build/$(FeedTasksPackage).targets" />
6 <Import Project="$(PackagesDir)/$(PublishSymbolsPackage.ToLower())/$(PublishSymbolsPackageVersion)/build/PublishSymbols.targets" />
8 <UsingTask TaskName="CreateAzureContainer" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.CloudTestTasks.dll"/>
9 <UsingTask TaskName="UploadToAzure" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.CloudTestTasks.dll"/>
12 <PackagesPatternDir Condition="'$(PackagesPatternDir)' == ''">$(PackagesBinDir)</PackagesPatternDir>
13 <PackagesPattern Condition="'$(PackagesPattern)' == ''">$(PackagesPatternDir)pkg\*.nupkg</PackagesPattern>
14 <TestNativeBinariesPattern Condition="'$(TestNativeBinariesPattern)' == ''">$(OutputPath)\bin\**</TestNativeBinariesPattern>
15 <SymbolsPackagesPattern Condition="'$(SymbolPackagesPattern)' == ''">$(PackagesPatternDir)symbolpkg\*.nupkg</SymbolsPackagesPattern>
16 <PublishFlatContainer Condition="'$(PublishFlatContainer)' == ''">true</PublishFlatContainer>
17 <RelativePathWithSlash>$(RelativePath)</RelativePathWithSlash>
18 <RelativePathWithSlash Condition="'$(RelativePathWithSlash)' != '' and !HasTrailingSlash('$(RelativePathWithSlash)')">$(RelativePathWithSlash)/</RelativePathWithSlash>
22 <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
23 <AccountName>$(CloudDropAccountName)</AccountName>
24 <AccountKey>$(CloudDropAccessToken)</AccountKey>
27 <Target Name="PublishPackages" Condition="'$(__PublishPackages)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
29 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
32 <ItemsToPush Remove="*.nupkg" />
33 <ItemsToPush Include="$(PackagesPattern)" Exclude="$(SymbolsPackagesPattern)">
34 <ManifestArtifactData>NonShipping=true</ManifestArtifactData>
37 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
41 <!-- create the container if it doesn't exist -->
42 <CreateAzureContainer AccountKey="$(AccountKey)"
43 AccountName="$(AccountName)"
44 ContainerName="$(ContainerName)"
47 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
48 ExpectedFeedUrl="$(ExpectedFeedUrl)"
49 AccountKey="$(AccountKey)"
50 ItemsToPush="@(ItemsToPush)"
51 Overwrite="$(OverwriteOnPublish)"
52 ManifestName="$(GitHubRepositoryName)"
53 ManifestBuildId="$(ManifestBuildId)"
54 ManifestBranch="$(ManifestBranch)"
55 ManifestCommit="$(ManifestCommit)" />
57 <!-- now upload the items -->
58 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
59 AccountKey="$(AccountKey)"
60 AccountName="$(AccountName)"
61 ContainerName="$(ContainerName)"
62 Items="@(ItemsToPush)"
63 Overwrite="$(OverwriteOnPublish)" />
66 <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
68 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
71 <ItemsToPush Remove="*.nupkg" />
72 <ItemsToPush Include="$(SymbolsPackagesPattern)"/>
74 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
78 <!-- create the container if it doesn't exist -->
79 <CreateAzureContainer AccountKey="$(AccountKey)"
80 AccountName="$(AccountName)"
81 ContainerName="$(ContainerName)"
84 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
85 ExpectedFeedUrl="$(ExpectedFeedUrl)"
86 AccountKey="$(AccountKey)"
87 ItemsToPush="@(ItemsToPush)"
88 Overwrite="$(OverwriteOnPublish)"
89 ManifestName="$(GitHubRepositoryName)"
90 ManifestBuildId="$(ManifestBuildId)"
91 ManifestBranch="$(ManifestBranch)"
92 ManifestCommit="$(ManifestCommit)" />
94 <!-- now upload the items -->
95 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
96 AccountKey="$(AccountKey)"
97 AccountName="$(AccountName)"
98 ContainerName="$(ContainerName)"
99 Items="@(ItemsToPush)"
100 Overwrite="$(OverwriteOnPublish)" />
103 <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
105 <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
106 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
109 <ItemsToPush Remove="*.nupkg" />
110 <ItemsToPush Include="$(TestNativeBinariesPattern)" />
112 <RelativeBlobPath>$(RelativePath)/$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
116 <!-- create the container if it doesn't exist -->
117 <CreateAzureContainer AccountKey="$(AccountKey)"
118 AccountName="$(AccountName)"
119 ContainerName="$(ContainerName)"
122 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
123 ExpectedFeedUrl="$(ExpectedFeedUrl)"
124 AccountKey="$(AccountKey)"
125 ItemsToPush="@(ItemsToPush)"
126 Overwrite="$(OverwriteOnPublish)" />
128 <!-- now upload the items -->
129 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
130 AccountKey="$(AccountKey)"
131 AccountName="$(AccountName)"
132 ContainerName="$(ContainerName)"
133 Items="@(ItemsToPush)"
134 Overwrite="$(OverwriteOnPublish)" />
137 <Target Name="PublishAllSymbols"
138 DependsOnTargets="SetupPublishSymbols;PublishSymbols" />
140 <Target Name="SetupPublishSymbols">
142 <ConvertPortablePdbsToWindowsPdbs Condition="'$(ConvertPortablePdbsToWindowsPdbs)'==''">true</ConvertPortablePdbsToWindowsPdbs>
143 <SymbolVerboseLogging>true</SymbolVerboseLogging>
146 <SymbolPackagesToPublish Include="$(SymbolsPackagesPattern)" />
148 <Error Condition="'$(SymbolServerPath)'==''" Text="Missing property SymbolServerPath" />
149 <Error Condition="'$(SymbolServerPAT)'==''" Text="Missing property SymbolServerPAT" />
150 <Message Importance="High" Text="Publishing @(SymbolPackagesToPublish) to $(SymbolServerPath)"/>
153 <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>