Merge pull request #14334 from BruceForstall/AddTestEnvToWindows
[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   <PropertyGroup>
6     <FeedsDir Condition="'$(RunningOnCore)' != 'true'">$(ToolsDir)Microsoft.Dotnet.Build.Tasks.Feed/net46/</FeedsDir>
7     <FeedsDir Condition="'$(RunningOnCore)' == 'true'">$(ToolsDir)microsoft.dotnet.build.tasks.feed/netstandard1.5/</FeedsDir>
8   </PropertyGroup>
9
10   <UsingTask TaskName="PushToBlobFeed" AssemblyFile="$(FeedsDir)Microsoft.DotNet.Build.Tasks.Feed.dll"/>
11
12   <PropertyGroup>
13     <PackagesPattern Condition="'$(PackagesPattern)' == ''">$(PackagesBinDir)pkg\*.nupkg</PackagesPattern>
14     <TestNativeBinariesPattern Condition="'$(TestNativeBinariesPattern)' == ''">$(OutputPath)\bin\**</TestNativeBinariesPattern>
15     <SymbolsPackagesPattern Condition="'$(SymbolPackagesPattern)' == ''">$(PackagesBinDir)symbolpkg\*.nupkg</SymbolsPackagesPattern>
16     <PublishFlatContainer Condition="'$(PublishFlatContainer)' == ''">true</PublishFlatContainer>
17   </PropertyGroup>
18
19   <PropertyGroup>
20     <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
21     <AccountName>$(CloudDropAccountName)</AccountName>
22     <AccountKey>$(CloudDropAccessToken)</AccountKey>
23   </PropertyGroup>
24
25   <Target Name="PublishPackages" Condition="'$(__PublishPackages)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
26     <PropertyGroup>
27       <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/pkg</RelativePath>
28       <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
29     </PropertyGroup>
30     <ItemGroup>
31       <ItemsToPush Remove="*.nupkg" />
32       <ItemsToPush Include="$(PackagesPattern)" Exclude="$(SymbolsPackagesPattern)"/>
33     </ItemGroup>
34     <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
35                     AccountKey="$(AccountKey)"
36                     ItemsToPush="@(ItemsToPush)"
37                     PublishFlatContainer="$(PublishFlatContainer)"
38                     Overwrite="$(OverwriteOnPublish)" 
39                     IndexDirectory="$(__IntermediatesDir)"/>
40   </Target>
41
42   <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
43     <PropertyGroup>
44       <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/symbolpkg</RelativePath>
45       <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
46     </PropertyGroup>
47     <ItemGroup>
48       <ItemsToPush Remove="*.nupkg" />
49       <ItemsToPush Include="$(SymbolsPackagesPattern)"/>
50     </ItemGroup>
51     <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
52                     AccountKey="$(AccountKey)"
53                     ItemsToPush="@(ItemsToPush)"
54                     PublishFlatContainer="$(PublishFlatContainer)"
55                     Overwrite="$(OverwriteOnPublish)" />
56   </Target>
57
58   <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
59     <PropertyGroup>
60       <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
61       <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
62     </PropertyGroup>
63     <ItemGroup>
64       <ItemsToPush Remove="*.nupkg" />
65       <ItemsToPush Include="$(TestNativeBinariesPattern)"/>
66     </ItemGroup>
67     <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
68                     AccountKey="$(AccountKey)"
69                     ItemsToPush="@(ItemsToPush)"
70                     PublishFlatContainer="$(PublishFlatContainer)"
71                     Overwrite="$(OverwriteOnPublish)" />
72   </Target>
73
74
75   <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>
76 </Project>