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>
36 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
37 ExpectedFeedUrl="$(ExpectedFeedUrl)"
38 AccountKey="$(AccountKey)"
39 ItemsToPush="@(ItemsToPush)"
40 Overwrite="$(OverwriteOnPublish)" />
42 <!-- create the container if it doesn't exist -->
43 <CreateAzureContainer Condition="'$(PublishFlatContainer)' == 'true'"
44 AccountKey="$(AccountKey)"
45 AccountName="$(AccountName)"
46 ContainerName="$(ContainerName)" />
47 <!-- now upload the items -->
48 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
49 AccountKey="$(AccountKey)"
50 AccountName="$(AccountName)"
51 ContainerName="$(ContainerName)"
52 Items="@(ItemsToPush)"
53 Overwrite="$(OverwriteOnPublish)" />
56 <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
58 <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
61 <ItemsToPush Remove="*.nupkg" />
62 <ItemsToPush Include="$(SymbolsPackagesPattern)"/>
64 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
67 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
68 ExpectedFeedUrl="$(ExpectedFeedUrl)"
69 AccountKey="$(AccountKey)"
70 ItemsToPush="@(ItemsToPush)"
71 Overwrite="$(OverwriteOnPublish)" />
73 <!-- create the container if it doesn't exist -->
74 <CreateAzureContainer Condition="'$(PublishFlatContainer)' == 'true'"
75 AccountKey="$(AccountKey)"
76 AccountName="$(AccountName)"
77 ContainerName="$(ContainerName)" />
78 <!-- now upload the items -->
79 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
80 AccountKey="$(AccountKey)"
81 AccountName="$(AccountName)"
82 ContainerName="$(ContainerName)"
83 Items="@(ItemsToPush)"
84 Overwrite="$(OverwriteOnPublish)" />
87 <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
89 <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
90 <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
93 <ItemsToPush Remove="*.nupkg" />
94 <ItemsToPush Include="$(TestNativeBinariesPattern)" />
96 <RelativeBlobPath>$(RelativePath)/$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
99 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
100 ExpectedFeedUrl="$(ExpectedFeedUrl)"
101 AccountKey="$(AccountKey)"
102 ItemsToPush="@(ItemsToPush)"
103 Overwrite="$(OverwriteOnPublish)" />
105 <!-- create the container if it doesn't exist -->
106 <CreateAzureContainer Condition="'$(PublishFlatContainer)' == 'true'"
107 AccountKey="$(AccountKey)"
108 AccountName="$(AccountName)"
109 ContainerName="$(ContainerName)" />
110 <!-- now upload the items -->
111 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
112 AccountKey="$(AccountKey)"
113 AccountName="$(AccountName)"
114 ContainerName="$(ContainerName)"
115 Items="@(ItemsToPush)"
116 Overwrite="$(OverwriteOnPublish)" />
119 <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>