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>
18 <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
19 <AccountName>$(CloudDropAccountName)</AccountName>
20 <AccountKey>$(CloudDropAccessToken)</AccountKey>
23 <Target Name="PublishPackages" Condition="'$(__PublishPackages)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
25 <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)index.json</ExpectedFeedUrl>
28 <ItemsToPush Remove="*.nupkg" />
29 <ItemsToPush Include="$(PackagesPattern)" Exclude="$(SymbolsPackagesPattern)">
30 <RelativeBlobPath>$(RelativePath)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
33 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
34 ExpectedFeedUrl="$(ExpectedFeedUrl)"
35 AccountKey="$(AccountKey)"
36 ItemsToPush="@(ItemsToPush)"
37 Overwrite="$(OverwriteOnPublish)" />
39 <!-- create the container if it doesn't exist -->
40 <CreateAzureContainer Condition="'$(PublishFlatContainer)' == 'true'"
41 AccountKey="$(AccountKey)"
42 AccountName="$(AccountName)"
43 ContainerName="$(ContainerName)" />
44 <!-- now upload the items -->
45 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
46 AccountKey="$(AccountKey)"
47 AccountName="$(AccountName)"
48 ContainerName="$(ContainerName)"
49 Items="@(ItemsToPush)"
50 Overwrite="$(OverwriteOnPublish)" />
53 <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
55 <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)index.json</ExpectedFeedUrl>
58 <ItemsToPush Remove="*.nupkg" />
59 <ItemsToPush Include="$(SymbolsPackagesPattern)">
60 <RelativeBlobPath>$(RelativePath)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
63 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
64 ExpectedFeedUrl="$(ExpectedFeedUrl)"
65 AccountKey="$(AccountKey)"
66 ItemsToPush="@(ItemsToPush)"
67 Overwrite="$(OverwriteOnPublish)" />
69 <!-- create the container if it doesn't exist -->
70 <CreateAzureContainer Condition="'$(PublishFlatContainer)' == 'true'"
71 AccountKey="$(AccountKey)"
72 AccountName="$(AccountName)"
73 ContainerName="$(ContainerName)" />
74 <!-- now upload the items -->
75 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
76 AccountKey="$(AccountKey)"
77 AccountName="$(AccountName)"
78 ContainerName="$(ContainerName)"
79 Items="@(ItemsToPush)"
80 Overwrite="$(OverwriteOnPublish)" />
83 <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
85 <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
86 <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
89 <ItemsToPush Remove="*.nupkg" />
90 <ItemsToPush Include="$(TestNativeBinariesPattern)">
91 <RelativeBlobPath>$(RelativePath)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
94 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
95 ExpectedFeedUrl="$(ExpectedFeedUrl)"
96 AccountKey="$(AccountKey)"
97 ItemsToPush="@(ItemsToPush)"
98 Overwrite="$(OverwriteOnPublish)" />
100 <!-- create the container if it doesn't exist -->
101 <CreateAzureContainer Condition="'$(PublishFlatContainer)' == 'true'"
102 AccountKey="$(AccountKey)"
103 AccountName="$(AccountName)"
104 ContainerName="$(ContainerName)" />
105 <!-- now upload the items -->
106 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
107 AccountKey="$(AccountKey)"
108 AccountName="$(AccountName)"
109 ContainerName="$(ContainerName)"
110 Items="@(ItemsToPush)"
111 Overwrite="$(OverwriteOnPublish)" />
114 <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>