Skip to content

Commit

Permalink
Add options to be able to specify specific feeds for PublishArtifacts…
Browse files Browse the repository at this point in the history
…InManifest (#6993)

* Add options to be able to specify specific feeds for PublishArtifactsInManifest

* Rename the variables to be more descriptive

* Move feed manipulation to a helper function
  • Loading branch information
michellemcdaniel authored Feb 25, 2021
1 parent ce7effc commit c18606a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<InternalInstallersFeedKey>$(InternalInstallersAzureAccountKey)</InternalInstallersFeedKey>
<ChecksumsFeedKey>$(ChecksumsAzureAccountKey)</ChecksumsFeedKey>
<InternalChecksumsFeedKey>$(InternalChecksumsAzureAccountKey)</InternalChecksumsFeedKey>
<AllowFeedOverrides Condition="'$(AllowFeedOverrides)' == ''">false</AllowFeedOverrides>
</PropertyGroup>

<Error
Expand Down Expand Up @@ -131,7 +132,13 @@
SymbolPublishingExclusionsFile="$(SymbolPublishingExclusionsFile)"
PdbArtifactsBasePath="$(PDBArtifactsBasePath)"
PublishSpecialClrFiles="$(PublishSpecialClrFiles)"
BuildQuality="$(BuildQuality)" />
BuildQuality="$(BuildQuality)"
AllowFeedOverrides="$(AllowFeedOverrides)"
InstallersFeedOverride="$(InstallersFeedOverride)"
ChecksumsFeedOverride="$(ChecksumsFeedOverride)"
TransportFeedOverride="$(TransportFeedOverride)"
ShippingFeedOverride="$(ShippingFeedOverride)"
SymbolsFeedOverride="$(SymbolsFeedOverride)" />
</Target>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,14 @@ public class PublishArtifactsInManifest : MSBuildTaskBase

public string AzureStorageTargetFeedKey { get; set; }

public bool AllowFeedOverrides { get; set; }

public string ChecksumsFeedOverride { get; set; }

public string ChecksumsFeedKey { get; set; }

public string InstallersFeedOverride { get; set; }

public string InstallersFeedKey { get; set; }

public string InternalInstallersFeedKey { get; set; }
Expand All @@ -122,6 +128,12 @@ public class PublishArtifactsInManifest : MSBuildTaskBase

public string AzureDevOpsFeedsKey { get; set; }

public string TransportFeedOverride { get; set; }

public string ShippingFeedOverride { get; set; }

public string SymbolsFeedOverride { get; set; }

/// <summary>
/// Path to dll and pdb files
/// </summary>
Expand Down Expand Up @@ -354,7 +366,13 @@ internal PublishArtifactsInManifestBase ConstructPublishingV3Task(BuildModel bui
MsdlToken = this.MsdlToken,
SymbolPublishingExclusionsFile = this.SymbolPublishingExclusionsFile,
PublishSpecialClrFiles = this.PublishSpecialClrFiles,
BuildQuality = this.BuildQuality
BuildQuality = this.BuildQuality,
AllowFeedOverrides = this.AllowFeedOverrides,
InstallersFeedOverride = this.InstallersFeedOverride,
ChecksumsFeedOverride = this.ChecksumsFeedOverride,
ShippingFeedOverride = this.ShippingFeedOverride,
TransportFeedOverride = this.TransportFeedOverride,
SymbolsFeedOverride = this.SymbolsFeedOverride
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ public class PublishArtifactsInManifestV3 : PublishArtifactsInManifestBase

public bool PublishSpecialClrFiles { get; set; }

public bool AllowFeedOverrides { get; set; }

public string InstallersFeedOverride { get; set; }

public string ChecksumsFeedOverride { get; set; }

public string ShippingFeedOverride { get; set; }

public string TransportFeedOverride { get; set; }

public string SymbolsFeedOverride { get; set; }

public override bool Execute()
{
ExecuteAsync().GetAwaiter().GetResult();
Expand Down Expand Up @@ -143,13 +155,13 @@ public override async Task<bool> ExecuteAsync()
BuildModel.Identity.Commit,
AzureStorageTargetFeedKey,
PublishInstallersAndChecksums,
targetChannelConfig.InstallersFeed,
GetFeed(targetChannelConfig.InstallersFeed, InstallersFeedOverride),
targetChannelConfig.IsInternal? InternalInstallersFeedKey : InstallersFeedKey,
targetChannelConfig.ChecksumsFeed,
GetFeed(targetChannelConfig.ChecksumsFeed, ChecksumsFeedOverride),
targetChannelConfig.IsInternal? InternalCheckSumsFeedKey : CheckSumsFeedKey,
targetChannelConfig.ShippingFeed,
targetChannelConfig.TransportFeed,
targetChannelConfig.SymbolsFeed,
GetFeed(targetChannelConfig.ShippingFeed, ShippingFeedOverride),
GetFeed(targetChannelConfig.TransportFeed, TransportFeedOverride),
GetFeed(targetChannelConfig.SymbolsFeed, SymbolsFeedOverride),
shortLinkUrl,
AzureDevOpsFeedsKey,
BuildEngine = this.BuildEngine,
Expand Down Expand Up @@ -277,5 +289,10 @@ public void DeleteSymbolTemporaryDirectory(string temporarySymbolLocation)
Directory.Delete(temporarySymbolLocation);
}
}

public string GetFeed(string feed, string feedOverride)
{
return (AllowFeedOverrides && !string.IsNullOrEmpty(feedOverride)) ? feedOverride : feed;
}
}
}

0 comments on commit c18606a

Please sign in to comment.