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)" />
42 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
43 ExpectedFeedUrl="$(ExpectedFeedUrl)"
44 AccountKey="$(AccountKey)"
45 ItemsToPush="@(ItemsToPush)"
46 Overwrite="$(OverwriteOnPublish)" />
48 <!-- now upload the items -->
49 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
50 AccountKey="$(AccountKey)"
51 AccountName="$(AccountName)"
52 ContainerName="$(ContainerName)"
53 Items="@(ItemsToPush)"
54 Overwrite="$(OverwriteOnPublish)" />
57 <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
59 <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
62 <ItemsToPush Remove="*.nupkg" />
63 <ItemsToPush Include="$(SymbolsPackagesPattern)"/>
65 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
69 <!-- create the container if it doesn't exist -->
70 <CreateAzureContainer AccountKey="$(AccountKey)"
71 AccountName="$(AccountName)"
72 ContainerName="$(ContainerName)" />
74 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
75 ExpectedFeedUrl="$(ExpectedFeedUrl)"
76 AccountKey="$(AccountKey)"
77 ItemsToPush="@(ItemsToPush)"
78 Overwrite="$(OverwriteOnPublish)" />
80 <!-- now upload the items -->
81 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
82 AccountKey="$(AccountKey)"
83 AccountName="$(AccountName)"
84 ContainerName="$(ContainerName)"
85 Items="@(ItemsToPush)"
86 Overwrite="$(OverwriteOnPublish)" />
89 <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
91 <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
92 <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
95 <ItemsToPush Remove="*.nupkg" />
96 <ItemsToPush Include="$(TestNativeBinariesPattern)" />
98 <RelativeBlobPath>$(RelativePath)/$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
102 <!-- create the container if it doesn't exist -->
103 <CreateAzureContainer AccountKey="$(AccountKey)"
104 AccountName="$(AccountName)"
105 ContainerName="$(ContainerName)" />
107 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
108 ExpectedFeedUrl="$(ExpectedFeedUrl)"
109 AccountKey="$(AccountKey)"
110 ItemsToPush="@(ItemsToPush)"
111 Overwrite="$(OverwriteOnPublish)" />
113 <!-- now upload the items -->
114 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
115 AccountKey="$(AccountKey)"
116 AccountName="$(AccountName)"
117 ContainerName="$(ContainerName)"
118 Items="@(ItemsToPush)"
119 Overwrite="$(OverwriteOnPublish)" />
122 <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>