summaryrefslogtreecommitdiff
path: root/src/publish.proj
diff options
context:
space:
mode:
authorwtgodbe <wigodbe@microsoft.com>2017-08-28 13:14:52 -0700
committerwtgodbe <wigodbe@microsoft.com>2017-10-10 17:31:48 -0700
commit978a6dc612e3ccbeb5222df24971f0ba70518aff (patch)
treefe2f8908d730ef4c29ccc271a0e5f1f76aba299b /src/publish.proj
parent4c2e60f9fe57e1401410df9ee55dde673e11ff7e (diff)
downloadcoreclr-978a6dc612e3ccbeb5222df24971f0ba70518aff.tar.gz
coreclr-978a6dc612e3ccbeb5222df24971f0ba70518aff.tar.bz2
coreclr-978a6dc612e3ccbeb5222df24971f0ba70518aff.zip
Proof-of-concept of using new Publish infra in coreclr
Diffstat (limited to 'src/publish.proj')
-rw-r--r--src/publish.proj87
1 files changed, 61 insertions, 26 deletions
diff --git a/src/publish.proj b/src/publish.proj
index c6c2149ba3..9def32ab0c 100644
--- a/src/publish.proj
+++ b/src/publish.proj
@@ -1,41 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <Import Project="$(ToolsDir)PublishContent.targets" />
- <Import Project="$(ToolsDir)versioning.targets" />
- <!-- gathers the items to be published -->
- <Target Name="GatherItemsForPattern">
- <Error Condition="'$(PublishPattern)' == ''" Text="Please specify a value for PublishPattern using standard msbuild 'include' syntax." />
+ <PropertyGroup>
+ <FeedsDir Condition="'$(RunningOnCore)' != 'true'">$(ToolsDir)Microsoft.Dotnet.Build.Tasks.Feed/net46/</FeedsDir>
+ <FeedsDir Condition="'$(RunningOnCore)' == 'true'">$(ToolsDir)microsoft.dotnet.build.tasks.feed/netstandard1.5/</FeedsDir>
+ </PropertyGroup>
+
+ <UsingTask TaskName="PushToBlobFeed" AssemblyFile="$(FeedsDir)Microsoft.DotNet.Build.Tasks.Feed.dll"/>
+
+ <PropertyGroup>
+ <PackagesPattern Condition="'$(PackagesPattern)' == ''">$(PackagesBinDir)pkg\*.nupkg</PackagesPattern>
+ <TestNativeBinariesPattern Condition="'$(TestNativeBinariesPattern)' == ''">$(OutputPath)\bin\**</TestNativeBinariesPattern>
+ <SymbolsPackagesPattern Condition="'$(SymbolPackagesPattern)' == ''">$(PackagesBinDir)symbolpkg\*.nupkg</SymbolsPackagesPattern>
+ <PublishFlatContainer Condition="'$(PublishFlatContainer)' == ''">true</PublishFlatContainer>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
+ <AccountName>$(CloudDropAccountName)</AccountName>
+ <AccountKey>$(CloudDropAccessToken)</AccountKey>
+ </PropertyGroup>
+
+ <Target Name="PublishPackages" Condition="'$(__PublishPackages)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
+ <PropertyGroup>
+ <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/pkg</RelativePath>
+ <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
+ </PropertyGroup>
<ItemGroup>
- <ForPublishing Include="$(PublishPattern)" />
+ <ItemsToPush Remove="*.nupkg" />
+ <ItemsToPush Include="$(PackagesPattern)" Exclude="$(SymbolsPackagesPattern)"/>
</ItemGroup>
- <!-- add relative blob path metadata -->
+ <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
+ AccountKey="$(AccountKey)"
+ ItemsToPush="@(ItemsToPush)"
+ PublishFlatContainer="$(PublishFlatContainer)"
+ Overwrite="$(OverwriteOnPublish)"
+ IndexDirectory="$(__IntermediatesDir)"/>
+ </Target>
+
+ <Target Name="PublishSymbolPackages" Condition="'$(__PublishSymbols)' == 'true' and ('$(OfficialPublish)' != 'true' or '$(__BuildType)' == 'Release')">
+ <PropertyGroup>
+ <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/symbolpkg</RelativePath>
+ <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
+ </PropertyGroup>
<ItemGroup>
- <ForPublishing>
- <RelativeBlobPath Condition="'$(PublishTestNativeBins)' != 'true'">$(__BuildType)/%(RecursiveDir)%(Filename)%(Extension)</RelativeBlobPath>
- <RelativeBlobPath Condition="'$(PublishTestNativeBins)' == 'true'">$(__BuildType)/%(RecursiveDir)%(Filename)%(Extension)</RelativeBlobPath>
- </ForPublishing>
+ <ItemsToPush Remove="*.nupkg" />
+ <ItemsToPush Include="$(SymbolsPackagesPattern)"/>
</ItemGroup>
- <Error Condition="'@(ForPublishing)' == ''" Text="No items were found matching pattern '$(PublishPattern)'." />
+ <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
+ AccountKey="$(AccountKey)"
+ ItemsToPush="@(ItemsToPush)"
+ PublishFlatContainer="$(PublishFlatContainer)"
+ Overwrite="$(OverwriteOnPublish)" />
</Target>
- <PropertyGroup>
- <PublishPattern Condition="'$(PublishPattern)' == '' and '$(PublishTestNativeBins)' != 'true'">$(PackagesBinDir)**\*.nupkg</PublishPattern>
- <PublishPattern Condition="'$(PublishPattern)' == '' and '$(PublishTestNativeBins)' == 'true'">$(OutputPath)\bin\**</PublishPattern>
- </PropertyGroup>
-
- <Target Name="CreateContainerName"
- DependsOnTargets="CreateVersionFileDuringBuild"
- Condition="'$(ContainerName)' == '' or '$(PublishTestNativeBins)' == 'true'">
+ <Target Name="PublishTestNativeBinaries" Condition="'$(PublishTestNativeBins)' == 'true' and '$(OfficialPublish)' != 'true'">
<PropertyGroup>
- <ContainerName Condition="'$(__Container)' == '' and '$(PublishTestNativeBins)' != 'true'">coreclr-$(PreReleaseLabel)-$(BuildNumberMajor)-$(BuildNumberMinor)</ContainerName>
- <ContainerName Condition="'$(__Container)' == '' and '$(PublishTestNativeBins)' == 'true'">coreclr-$(PreReleaseLabel)-$(BuildNumberMajor)-$(BuildNumberMinor)-$(__DistroRid)-$(__BuildArch)</ContainerName>
- <ContainerName Condition="'$(__Container)' != '' and '$(PublishTestNativeBins)' != 'true'">$(__Container)</ContainerName>
- <ContainerName Condition="'$(__Container)' != '' and '$(PublishTestNativeBins)' == 'true'">$(__Container)-$(__DistroRid)-$(__BuildArch)</ContainerName>
- <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
+ <RelativePath Condition="'$(RelativePath)' == ''">$(__BuildType)/TestNativeBins</RelativePath>
+ <ExpectedFeedUrl>https://$(AccountName).blob.core.windows.net/$(ContainerName)/$(RelativePath)/index.json</ExpectedFeedUrl>
</PropertyGroup>
+ <ItemGroup>
+ <ItemsToPush Remove="*.nupkg" />
+ <ItemsToPush Include="$(TestNativeBinariesPattern)"/>
+ </ItemGroup>
+ <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
+ AccountKey="$(AccountKey)"
+ ItemsToPush="@(ItemsToPush)"
+ PublishFlatContainer="$(PublishFlatContainer)"
+ Overwrite="$(OverwriteOnPublish)" />
</Target>
- <Target Name="Build" DependsOnTargets="CreateContainerName;UploadToAzure" />
+
+ <Target Name="Build" DependsOnTargets="PublishPackages;PublishSymbolPackages;PublishTestNativeBinaries"/>
</Project> \ No newline at end of file