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 Condition="'$(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)"
47 Overwrite="$(OverwriteOnPublish)" />
49 <!-- now upload the items -->
50 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
51 AccountKey="$(AccountKey)"
52 AccountName="$(AccountName)"
53 ContainerName="$(ContainerName)"
54 Items="@(ItemsToPush)"
55 Overwrite="$(OverwriteOnPublish)" />
58 <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
60 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
63 <ItemsToPush Remove="*.nupkg" />
64 <ItemsToPush Include="$(SymbolsPackagesPattern)"/>
66 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
70 <!-- create the container if it doesn't exist -->
71 <CreateAzureContainer AccountKey="$(AccountKey)"
72 AccountName="$(AccountName)"
73 ContainerName="$(ContainerName)"
76 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
77 ExpectedFeedUrl="$(ExpectedFeedUrl)"
78 AccountKey="$(AccountKey)"
79 ItemsToPush="@(ItemsToPush)"
80 Overwrite="$(OverwriteOnPublish)" />
82 <!-- now upload the items -->
83 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
84 AccountKey="$(AccountKey)"
85 AccountName="$(AccountName)"
86 ContainerName="$(ContainerName)"
87 Items="@(ItemsToPush)"
88 Overwrite="$(OverwriteOnPublish)" />
91 <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
93 <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
94 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
97 <ItemsToPush Remove="*.nupkg" />
98 <ItemsToPush Include="$(TestNativeBinariesPattern)" />
100 <RelativeBlobPath>$(RelativePath)/$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
104 <!-- create the container if it doesn't exist -->
105 <CreateAzureContainer AccountKey="$(AccountKey)"
106 AccountName="$(AccountName)"
107 ContainerName="$(ContainerName)"
110 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
111 ExpectedFeedUrl="$(ExpectedFeedUrl)"
112 AccountKey="$(AccountKey)"
113 ItemsToPush="@(ItemsToPush)"
114 Overwrite="$(OverwriteOnPublish)" />
116 <!-- now upload the items -->
117 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
118 AccountKey="$(AccountKey)"
119 AccountName="$(AccountName)"
120 ContainerName="$(ContainerName)"
121 Items="@(ItemsToPush)"
122 Overwrite="$(OverwriteOnPublish)" />
125 <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>