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" />
7 <UsingTask TaskName="CreateAzureContainer" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.CloudTestTasks.dll"/>
8 <UsingTask TaskName="UploadToAzure" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.CloudTestTasks.dll"/>
11 <PackagesPattern Condition="'$(PackagesPattern)' == ''">$(PackagesBinDir)pkg\*.nupkg</PackagesPattern>
12 <TestNativeBinariesPattern Condition="'$(TestNativeBinariesPattern)' == ''">$(OutputPath)\bin\**</TestNativeBinariesPattern>
13 <SymbolsPackagesPattern Condition="'$(SymbolPackagesPattern)' == ''">$(PackagesBinDir)symbolpkg\*.nupkg</SymbolsPackagesPattern>
14 <PublishFlatContainer Condition="'$(PublishFlatContainer)' == ''">true</PublishFlatContainer>
15 <RelativePathWithSlash>$(RelativePath)</RelativePathWithSlash>
16 <RelativePathWithSlash Condition="'$(RelativePathWithSlash)' != '' and !HasTrailingSlash('$(RelativePathWithSlash)')">$(RelativePathWithSlash)/</RelativePathWithSlash>
20 <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
21 <AccountName>$(CloudDropAccountName)</AccountName>
22 <AccountKey>$(CloudDropAccessToken)</AccountKey>
25 <Target Name="PublishPackages" Condition="'$(__PublishPackages)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
27 <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
30 <ItemsToPush Remove="*.nupkg" />
31 <ItemsToPush Include="$(PackagesPattern)" Exclude="$(SymbolsPackagesPattern)"/>
33 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
37 <!-- create the container if it doesn't exist -->
38 <CreateAzureContainer AccountKey="$(AccountKey)"
39 AccountName="$(AccountName)"
40 ContainerName="$(ContainerName)"
43 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
44 ExpectedFeedUrl="$(ExpectedFeedUrl)"
45 AccountKey="$(AccountKey)"
46 ItemsToPush="@(ItemsToPush)"
48 RetryDelayInSeconds="120"
49 Overwrite="$(OverwriteOnPublish)" />
51 <!-- now upload the items -->
52 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
53 AccountKey="$(AccountKey)"
54 AccountName="$(AccountName)"
55 ContainerName="$(ContainerName)"
56 Items="@(ItemsToPush)"
57 Overwrite="$(OverwriteOnPublish)" />
60 <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
62 <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
65 <ItemsToPush Remove="*.nupkg" />
66 <ItemsToPush Include="$(SymbolsPackagesPattern)"/>
68 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
72 <!-- create the container if it doesn't exist -->
73 <CreateAzureContainer AccountKey="$(AccountKey)"
74 AccountName="$(AccountName)"
75 ContainerName="$(ContainerName)"
78 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
79 ExpectedFeedUrl="$(ExpectedFeedUrl)"
80 AccountKey="$(AccountKey)"
81 ItemsToPush="@(ItemsToPush)"
83 RetryDelayInSeconds="120"
84 Overwrite="$(OverwriteOnPublish)" />
86 <!-- now upload the items -->
87 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
88 AccountKey="$(AccountKey)"
89 AccountName="$(AccountName)"
90 ContainerName="$(ContainerName)"
91 Items="@(ItemsToPush)"
92 Overwrite="$(OverwriteOnPublish)" />
95 <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
97 <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
98 <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
101 <ItemsToPush Remove="*.nupkg" />
102 <ItemsToPush Include="$(TestNativeBinariesPattern)" />
104 <RelativeBlobPath>$(RelativePath)/$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
108 <!-- create the container if it doesn't exist -->
109 <CreateAzureContainer AccountKey="$(AccountKey)"
110 AccountName="$(AccountName)"
111 ContainerName="$(ContainerName)"
114 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
115 ExpectedFeedUrl="$(ExpectedFeedUrl)"
116 AccountKey="$(AccountKey)"
117 ItemsToPush="@(ItemsToPush)"
119 RetryDelayInSeconds="120"
120 Overwrite="$(OverwriteOnPublish)" />
122 <!-- now upload the items -->
123 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
124 AccountKey="$(AccountKey)"
125 AccountName="$(AccountName)"
126 ContainerName="$(ContainerName)"
127 Items="@(ItemsToPush)"
128 Overwrite="$(OverwriteOnPublish)" />
131 <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>