Use new feed tasks package & auto-update version
[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   <PropertyGroup>
8     <PackagesPattern Condition="'$(PackagesPattern)' == ''">$(PackagesBinDir)pkg\*.nupkg</PackagesPattern>
9     <TestNativeBinariesPattern Condition="'$(TestNativeBinariesPattern)' == ''">$(OutputPath)\bin\**</TestNativeBinariesPattern>
10     <SymbolsPackagesPattern Condition="'$(SymbolPackagesPattern)' == ''">$(PackagesBinDir)symbolpkg\*.nupkg</SymbolsPackagesPattern>
11     <PublishFlatContainer Condition="'$(PublishFlatContainer)' == ''">true</PublishFlatContainer>
12   </PropertyGroup>
13
14   <PropertyGroup>
15     <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
16     <AccountName>$(CloudDropAccountName)</AccountName>
17     <AccountKey>$(CloudDropAccessToken)</AccountKey>
18   </PropertyGroup>
19
20   <Target Name="PublishPackages" Condition="'$(__PublishPackages)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
21     <PropertyGroup>
22       <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/pkg</RelativePath>
23       <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
24     </PropertyGroup>
25     <ItemGroup>
26       <ItemsToPush Remove="*.nupkg" />
27       <ItemsToPush Include="$(PackagesPattern)" Exclude="$(SymbolsPackagesPattern)"/>
28     </ItemGroup>
29     <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
30                     AccountKey="$(AccountKey)"
31                     ItemsToPush="@(ItemsToPush)"
32                     PublishFlatContainer="$(PublishFlatContainer)"
33                     Overwrite="$(OverwriteOnPublish)" 
34                     IndexDirectory="$(__IntermediatesDir)"/>
35   </Target>
36
37   <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
38     <PropertyGroup>
39       <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/symbolpkg</RelativePath>
40       <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
41     </PropertyGroup>
42     <ItemGroup>
43       <ItemsToPush Remove="*.nupkg" />
44       <ItemsToPush Include="$(SymbolsPackagesPattern)"/>
45     </ItemGroup>
46     <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
47                     AccountKey="$(AccountKey)"
48                     ItemsToPush="@(ItemsToPush)"
49                     PublishFlatContainer="$(PublishFlatContainer)"
50                     Overwrite="$(OverwriteOnPublish)" />
51   </Target>
52
53   <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
54     <PropertyGroup>
55       <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
56       <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
57     </PropertyGroup>
58     <ItemGroup>
59       <ItemsToPush Remove="*.nupkg" />
60       <ItemsToPush Include="$(TestNativeBinariesPattern)"/>
61     </ItemGroup>
62     <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
63                     AccountKey="$(AccountKey)"
64                     ItemsToPush="@(ItemsToPush)"
65                     PublishFlatContainer="$(PublishFlatContainer)"
66                     Overwrite="$(OverwriteOnPublish)" />
67   </Target>
68
69
70   <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>
71 </Project>