Merge pull request #14287 from tannergooding/benchmarks-game
[platform/upstream/coreclr.git] / src / publish.proj
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" />
4
5   <Import Project="$(PackagesDir)/$(FeedTasksPackage.ToLower())/$(FeedTasksPackageVersion)/build/$(FeedTasksPackage).targets" />
6
7   <UsingTask TaskName="CreateAzureContainer" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.CloudTestTasks.dll"/>
8   <UsingTask TaskName="UploadToAzure" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.CloudTestTasks.dll"/>
9
10   <PropertyGroup>
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   </PropertyGroup>
16
17   <PropertyGroup>
18     <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
19     <AccountName>$(CloudDropAccountName)</AccountName>
20     <AccountKey>$(CloudDropAccessToken)</AccountKey>
21   </PropertyGroup>
22
23   <Target Name="PublishPackages" Condition="'$(__PublishPackages)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
24     <PropertyGroup>
25       <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)index.json</ExpectedFeedUrl>
26     </PropertyGroup>
27     <ItemGroup>
28       <ItemsToPush Remove="*.nupkg" />
29       <ItemsToPush Include="$(PackagesPattern)" Exclude="$(SymbolsPackagesPattern)">
30         <RelativeBlobPath>$(RelativePath)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
31       </ItemsToPush>
32     </ItemGroup>
33     <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
34                     ExpectedFeedUrl="$(ExpectedFeedUrl)"
35                     AccountKey="$(AccountKey)"
36                     ItemsToPush="@(ItemsToPush)"
37                     Overwrite="$(OverwriteOnPublish)" />
38
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)" />
51   </Target>
52
53   <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
54     <PropertyGroup>
55       <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)index.json</ExpectedFeedUrl>
56     </PropertyGroup>
57     <ItemGroup>
58       <ItemsToPush Remove="*.nupkg" />
59       <ItemsToPush Include="$(SymbolsPackagesPattern)">
60         <RelativeBlobPath>$(RelativePath)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
61       </ItemsToPush>
62     </ItemGroup>
63     <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
64                     ExpectedFeedUrl="$(ExpectedFeedUrl)"
65                     AccountKey="$(AccountKey)"
66                     ItemsToPush="@(ItemsToPush)"
67                     Overwrite="$(OverwriteOnPublish)" />
68
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)" />
81   </Target>
82
83   <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
84     <PropertyGroup>
85       <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
86       <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
87     </PropertyGroup>
88     <ItemGroup>
89       <ItemsToPush Remove="*.nupkg" />
90       <ItemsToPush Include="$(TestNativeBinariesPattern)">
91         <RelativeBlobPath>$(RelativePath)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
92       </ItemsToPush>
93     </ItemGroup>
94     <PushToBlobFeed Condition="'$(PublishFlatContainer)' == 'false'"
95                     ExpectedFeedUrl="$(ExpectedFeedUrl)"
96                     AccountKey="$(AccountKey)"
97                     ItemsToPush="@(ItemsToPush)"
98                     Overwrite="$(OverwriteOnPublish)" />
99
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)" />
112   </Target>
113
114   <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>
115 </Project>