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 <TestNativeBinariesPattern Condition="'$(TestNativeBinariesPattern)' == ''">$(OutputPath)\bin\**</TestNativeBinariesPattern>
14 <SymbolsPackagesPattern Condition="'$(SymbolPackagesPattern)' == ''">$(PackagesPatternDir)symbolpkg\*.nupkg</SymbolsPackagesPattern>
15 <PublishFlatContainer Condition="'$(PublishFlatContainer)' == ''">true</PublishFlatContainer>
16 <RelativePathWithSlash>$(RelativePath)</RelativePathWithSlash>
17 <RelativePathWithSlash Condition="'$(RelativePathWithSlash)' != '' and !HasTrailingSlash('$(RelativePathWithSlash)')">$(RelativePathWithSlash)/</RelativePathWithSlash>
21 <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
22 <AccountName>$(CloudDropAccountName)</AccountName>
23 <AccountKey>$(CloudDropAccessToken)</AccountKey>
26 <Target Name="PublishPackages" Condition="'$(__PublishPackages)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
28 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
31 <ItemsToPush Remove="*.nupkg" />
32 <ItemsToPush Include="$(PackagesPattern)" Exclude="$(SymbolsPackagesPattern)">
33 <ManifestArtifactData>NonShipping=true</ManifestArtifactData>
36 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
40 <!-- create the container if it doesn't exist -->
41 <CreateAzureContainer AccountKey="$(AccountKey)"
42 AccountName="$(AccountName)"
43 ContainerName="$(ContainerName)"
46 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
47 ExpectedFeedUrl="$(ExpectedFeedUrl)"
48 AccountKey="$(AccountKey)"
49 ItemsToPush="@(ItemsToPush)"
50 Overwrite="$(OverwriteOnPublish)"
51 ManifestName="$(GitHubRepositoryName)"
52 ManifestBuildId="$(ManifestBuildId)"
53 ManifestBranch="$(ManifestBranch)"
54 ManifestCommit="$(ManifestCommit)" />
56 <!-- now upload the items -->
57 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
58 AccountKey="$(AccountKey)"
59 AccountName="$(AccountName)"
60 ContainerName="$(ContainerName)"
61 Items="@(ItemsToPush)"
62 Overwrite="$(OverwriteOnPublish)" />
65 <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
67 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePathWithSlash)index.json</ExpectedFeedUrl>
70 <ItemsToPush Remove="*.nupkg" />
71 <ItemsToPush Include="$(SymbolsPackagesPattern)"/>
73 <RelativeBlobPath>$(RelativePathWithSlash)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
77 <!-- create the container if it doesn't exist -->
78 <CreateAzureContainer AccountKey="$(AccountKey)"
79 AccountName="$(AccountName)"
80 ContainerName="$(ContainerName)"
83 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
84 ExpectedFeedUrl="$(ExpectedFeedUrl)"
85 AccountKey="$(AccountKey)"
86 ItemsToPush="@(ItemsToPush)"
87 Overwrite="$(OverwriteOnPublish)"
88 ManifestName="$(GitHubRepositoryName)"
89 ManifestBuildId="$(ManifestBuildId)"
90 ManifestBranch="$(ManifestBranch)"
91 ManifestCommit="$(ManifestCommit)" />
93 <!-- now upload the items -->
94 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
95 AccountKey="$(AccountKey)"
96 AccountName="$(AccountName)"
97 ContainerName="$(ContainerName)"
98 Items="@(ItemsToPush)"
99 Overwrite="$(OverwriteOnPublish)" />
102 <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
104 <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
105 <ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
108 <ItemsToPush Remove="*.nupkg" />
109 <ItemsToPush Include="$(TestNativeBinariesPattern)" />
111 <RelativeBlobPath>$(RelativePath)/$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
115 <!-- create the container if it doesn't exist -->
116 <CreateAzureContainer AccountKey="$(AccountKey)"
117 AccountName="$(AccountName)"
118 ContainerName="$(ContainerName)"
121 <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
122 ExpectedFeedUrl="$(ExpectedFeedUrl)"
123 AccountKey="$(AccountKey)"
124 ItemsToPush="@(ItemsToPush)"
125 Overwrite="$(OverwriteOnPublish)" />
127 <!-- now upload the items -->
128 <UploadToAzure Condition="'$(PublishFlatContainer)' == 'true'"
129 AccountKey="$(AccountKey)"
130 AccountName="$(AccountName)"
131 ContainerName="$(ContainerName)"
132 Items="@(ItemsToPush)"
133 Overwrite="$(OverwriteOnPublish)" />
136 <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>