forked from dotnet/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish the SDK NuGet packages to the Transport Feed (dotnet#1687)
* Publish the SDK NuGet packages to the Transport Feed. dotnet/sdk#1637 * Changes per code review...
- Loading branch information
1 parent
3174e2a
commit fc3e52d
Showing
3 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> | ||
<PropertyGroup> | ||
<BuildTasksFeedDllVersion>1.0.0-prerelease-01929-02</BuildTasksFeedDllVersion> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)\PublishNupkgToTransportFeed.targets" /> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net46</TargetFramework> | ||
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory> | ||
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory> | ||
<OutputType>Library</OutputType> | ||
<GenerateDependencyFile>false</GenerateDependencyFile> | ||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
<NonShipping>true</NonShipping> | ||
<NoStdLib>true</NoStdLib> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(BuildTasksFeedDllVersion)" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Common.props'))\Common.props" /> | ||
|
||
<PropertyGroup> | ||
<!-- Capture 'OutputPath' before Publish.csproj modifies it --> | ||
<OutputPathTransportFeed>$(OutputPath)</OutputPathTransportFeed> | ||
<BuildTasksFeedDll>$(NuGet_Packages)\Microsoft.DotNet.Build.Tasks.Feed\$(BuildTasksFeedDllVersion)\lib\desktop\Microsoft.DotNet.Build.Tasks.Feed.dll</BuildTasksFeedDll> | ||
</PropertyGroup> | ||
|
||
<UsingTask TaskName="PushToBlobFeed" AssemblyFile="$(BuildTasksFeedDll)" /> | ||
|
||
<ItemGroup> | ||
<NupkgsForPublishing Include="$(OutputPathTransportFeed)Packages\Microsoft.NET.Sdk.*.nupkg" /> | ||
<NupkgsForPublishing Include="$(OutputPathTransportFeed)Packages\Microsoft.NET.Build.Extensions.*.nupkg" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<RelativePath>packages</RelativePath> | ||
<TransportFeedContainerName>$(TRANSPORTFEED_STORAGE_CONTAINER)</TransportFeedContainerName> | ||
<TransportFeedContainerName Condition="'$(TransportFeedContainerName)' == ''">dotnet-core</TransportFeedContainerName> | ||
<TransportFeedCloudDropAccessToken>$(TRANSPORTFEED_STORAGE_KEY)</TransportFeedCloudDropAccessToken> | ||
<TransportFeedCloudDropAccountName>$(TRANSPORTFEED_STORAGE_ACCOUNT)</TransportFeedCloudDropAccountName> | ||
<TransportFeedCloudDropAccountName Condition="'$(TransportFeedCloudDropAccountName)' == ''">dotnetfeed</TransportFeedCloudDropAccountName> | ||
</PropertyGroup> | ||
|
||
<Target Name="PublishNupkgToTransportFeed" | ||
Condition=" '$(PUBLISH_NUPKG_TO_TRANSPORT_FEED)' == 'true' " | ||
DependsOnTargets="RestorePackageForTransportFeed; | ||
PushNupkgToTransportFeed" /> | ||
|
||
<Target Name="RestorePackageForTransportFeed"> | ||
<PropertyGroup> | ||
<NewLineTF> | ||
<![CDATA[ | ||
]]> | ||
</NewLineTF> | ||
<SetNuget_PackagesTF>set NUGET_PACKAGES=$(NuGet_Packages)</SetNuget_PackagesTF> | ||
<SetDotnet_Skip_FirstTime>set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true</SetDotnet_Skip_FirstTime> | ||
<PublishProjectFile>"$(MSBuildThisFileDirectory)Publish.csproj"</PublishProjectFile> | ||
</PropertyGroup> | ||
|
||
<Exec Command="$(SetNuget_PackagesTF)$(NewLineTF)$(SetDotnet_Skip_FirstTime)$(NewLineTF)$(DotNetTool) restore $(PublishProjectFile) /v:minimal" | ||
WorkingDirectory="$(RepositoryRootDirectory)" /> | ||
</Target> | ||
|
||
<Target Name="PushNupkgToTransportFeed" > | ||
<Error Condition="'$(TransportFeedContainerName)' == ''" Text="Missing property TransportFeedContainerName." /> | ||
<Error Condition="'$(TransportFeedCloudDropAccountName)' == ''" Text="Missing property TransportFeedCloudDropAccountName." /> | ||
<Error Condition="'$(TransportFeedCloudDropAccessToken)' == ''" Text="Missing property TransportFeedCloudDropAccessToken." /> | ||
|
||
<Message Text="Publish to $(TransportFeedContainerName) started" /> | ||
<PushToBlobFeed AccountKey="$(TransportFeedCloudDropAccessToken)" | ||
AccountName="$(TransportFeedCloudDropAccountName)" | ||
ContainerName="$(TransportFeedContainerName)" | ||
IndexDirectory="$(IndexDirectory)" | ||
ItemsToPush="@(NupkgsForPublishing)" | ||
Overwrite="false" | ||
PublishFlatContainer="false" | ||
RelativePath="$(RelativePath)" /> | ||
</Target> | ||
|
||
</Project> |