diff --git a/src/SourceBuild/Arcade/src/Tarball_WriteSourceRepoProperties.cs b/src/SourceBuild/Arcade/src/Tarball_WriteSourceRepoProperties.cs index 0fedf05db..39fe823e8 100644 --- a/src/SourceBuild/Arcade/src/Tarball_WriteSourceRepoProperties.cs +++ b/src/SourceBuild/Arcade/src/Tarball_WriteSourceRepoProperties.cs @@ -54,12 +54,13 @@ namespace Microsoft.DotNet.SourceBuild.Tasks foreach (var dependency in Dependencies.Select(dep => new { Name = dep.GetMetadata("Name"), + SourceBuildRepoName = dep.GetMetadata("SourceBuildRepoName"), Version = dep.GetMetadata("ExactVersion"), Sha = dep.GetMetadata("Sha"), Uri = dep.GetMetadata("Uri") })) { - string repoName = GetDefaultRepoNameFromUrl(dependency.Uri); + string repoName = dependency.SourceBuildRepoName; string safeRepoName = repoName.Replace("-", "").Replace(".", ""); string propsPath = Path.Combine(SourceBuildMetadataDir, $"{repoName.Replace(".", "-")}.props"); DerivedVersion derivedVersion = GetVersionInfo(dependency.Version, "0"); @@ -147,15 +148,6 @@ namespace Microsoft.DotNet.SourceBuild.Tasks throw new FormatException($"Can't derive a build ID from version {version} (commit count {commitCount}, release {string.Join(";", nugetVersion.Release.Split('-', '.'))})"); } - private static string GetDefaultRepoNameFromUrl(string repoUrl) - { - if (repoUrl.EndsWith(".git")) - { - repoUrl = repoUrl.Substring(0, repoUrl.Length - ".git".Length); - } - return repoUrl.Substring(repoUrl.LastIndexOf("/") + 1); - } - private static void UpdatePropsFile(string filePath, Dictionary properties) { if (!File.Exists(filePath))