Source-build updates to handle internal repo names (#11661)
This commit is contained in:
parent
f3ea71b28f
commit
3be0fd4f08
1 changed files with 2 additions and 10 deletions
|
@ -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<string, string> properties)
|
||||
{
|
||||
if (!File.Exists(filePath))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue