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 <PackagesPatternDir Condition="'$(PackagesPatternDir)' == ''">$(PackagesBinDir)</PackagesPatternDir>
12 <PackagesPattern Condition="'$(PackagesPattern)' == ''">$(PackagesPatternDir)pkg\*.nupkg</PackagesPattern>
13 <TransportPackagesPattern Condition="'$(TransportPackagesPattern)' == ''">$(PackagesPatternDir)pkg\transport.*.nupkg</TransportPackagesPattern>
14 <TestNativeBinariesPattern Condition="'$(TestNativeBinariesPattern)' == ''">$(OutputPath)\bin\**</TestNativeBinariesPattern>
15 <SymbolsPackagesPattern Condition="'$(SymbolPackagesPattern)' == ''">$(PackagesPatternDir)symbolpkg\*.nupkg</SymbolsPackagesPattern>
16 <PublishFlatContainer Condition="'$(PublishFlatContainer)' == ''">true</PublishFlatContainer>
17 <RelativePathWithSlash>$(RelativePath)</RelativePathWithSlash>
18 <RelativePathWithSlash Condition="'$(RelativePathWithSlash)' != '' and !HasTrailingSlash('$(RelativePathWithSlash)')">$(RelativePathWithSlash)/</RelativePathWithSlash>
22 <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
23 <AccountName>$(CloudDropAccountName)</AccountName>
24 <AccountKey>$(CloudDropAccessToken)</AccountKey>
27 <Target Name="PublishPackages" Condition="'$(__PublishPackages)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
29 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
32 <ItemsToPush Remove="*.nupkg" />
33 <ItemsToPush Include="$(TransportPackagesPattern)">
34 <ManifestArtifactData>NonShipping=true</ManifestArtifactData>
36 <ItemsToPush Include="$(PackagesPattern)" Exclude="@(ItemsToPush);$(SymbolsPackagesPattern)" />
38 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
42 <!-- create the container if it doesn't exist -->
43 <CreateAzureContainer AccountKey="$(AccountKey)"
44 AccountName="$(AccountName)"
45 ContainerName="$(ContainerName)"
48 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
49 ExpectedFeedUrl="$(ExpectedFeedUrl)"
50 AccountKey="$(AccountKey)"
51 ItemsToPush="@(ItemsToPush)"
52 Overwrite="$(OverwriteOnPublish)"
53 ManifestName="$(GitHubRepositoryName)"
54 ManifestBuildId="$(ManifestBuildId)"
55 ManifestBranch="$(ManifestBranch)"
56 ManifestCommit="$(ManifestCommit)" />
58 <!-- now upload the items -->
59 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
60 AccountKey="$(AccountKey)"
61 AccountName="$(AccountName)"
62 ContainerName="$(ContainerName)"
63 Items="@(ItemsToPush)"
64 Overwrite="$(OverwriteOnPublish)" />
67 <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
69 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
72 <ItemsToPush Remove="*.nupkg" />
73 <ItemsToPush Include="$(SymbolsPackagesPattern)"/>
75 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
79 <!-- create the container if it doesn't exist -->
80 <CreateAzureContainer AccountKey="$(AccountKey)"
81 AccountName="$(AccountName)"
82 ContainerName="$(ContainerName)"
85 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
86 ExpectedFeedUrl="$(ExpectedFeedUrl)"
87 AccountKey="$(AccountKey)"
88 ItemsToPush="@(ItemsToPush)"
89 Overwrite="$(OverwriteOnPublish)"
90 ManifestName="$(GitHubRepositoryName)"
91 ManifestBuildId="$(ManifestBuildId)"
92 ManifestBranch="$(ManifestBranch)"
93 ManifestCommit="$(ManifestCommit)" />
95 <!-- now upload the items -->
96 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
97 AccountKey="$(AccountKey)"
98 AccountName="$(AccountName)"
99 ContainerName="$(ContainerName)"
100 Items="@(ItemsToPush)"
101 Overwrite="$(OverwriteOnPublish)" />
104 <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
106 <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
107 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
110 <ItemsToPush Remove="*.nupkg" />
111 <ItemsToPush Include="$(TestNativeBinariesPattern)" />
113 <RelativeBlobPath>$(RelativePath)/$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
117 <!-- create the container if it doesn't exist -->
118 <CreateAzureContainer AccountKey="$(AccountKey)"
119 AccountName="$(AccountName)"
120 ContainerName="$(ContainerName)"
123 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
124 ExpectedFeedUrl="$(ExpectedFeedUrl)"
125 AccountKey="$(AccountKey)"
126 ItemsToPush="@(ItemsToPush)"
127 Overwrite="$(OverwriteOnPublish)" />
129 <!-- now upload the items -->
130 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
131 AccountKey="$(AccountKey)"
132 AccountName="$(AccountName)"
133 ContainerName="$(ContainerName)"
134 Items="@(ItemsToPush)"
135 Overwrite="$(OverwriteOnPublish)" />
138 <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>