Removing VCPKG Properties (#890)
* removing the VCPKG properties because they do not need to be in CD public * changes --------- Co-authored-by: Amitla Vannikumar <avannikumar@microsoft.com>
This commit is contained in:
Родитель
b61d0ec02c
Коммит
f42b36b1f8
|
@ -1,6 +1,5 @@
|
|||
namespace Microsoft.ComponentDetection.Contracts.TypedComponent;
|
||||
|
||||
using System.Linq;
|
||||
using PackageUrl;
|
||||
|
||||
public class VcpkgComponent : TypedComponent
|
||||
|
@ -21,11 +20,6 @@ public class VcpkgComponent : TypedComponent
|
|||
this.Triplet = triplet;
|
||||
this.Description = description;
|
||||
this.DownloadLocation = downloadLocation;
|
||||
|
||||
if (!string.IsNullOrEmpty(downloadLocation) && downloadLocation.ToLower().Contains("https://github.com/"))
|
||||
{
|
||||
this.SetGitRepoProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public string SPDXID { get; set; }
|
||||
|
@ -42,10 +36,6 @@ public class VcpkgComponent : TypedComponent
|
|||
|
||||
public int PortVersion { get; set; }
|
||||
|
||||
public string GitRepositoryOwner { get; set; }
|
||||
|
||||
public string GitRepositoryName { get; set; }
|
||||
|
||||
public override ComponentType Type => ComponentType.Vcpkg;
|
||||
|
||||
public override string Id
|
||||
|
@ -81,22 +71,4 @@ public class VcpkgComponent : TypedComponent
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetGitRepoProperties()
|
||||
{
|
||||
/* example download locations
|
||||
* "git+https://github.com/leethomason/tinyxml2@9.0.0"
|
||||
* "git+https://github.com/Microsoft/vcpkg#ports/nlohmann-json"
|
||||
*/
|
||||
var locationArr = this.DownloadLocation.Split('/');
|
||||
if (!string.IsNullOrEmpty(locationArr[2]))
|
||||
{
|
||||
this.GitRepositoryOwner = locationArr[2];
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(locationArr[3]))
|
||||
{
|
||||
this.GitRepositoryName = locationArr[3].TakeWhile(ch => char.IsLetterOrDigit(ch)).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Microsoft.ComponentDetection.Detectors.Vcpkg;
|
||||
namespace Microsoft.ComponentDetection.Detectors.Vcpkg;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
Загрузка…
Ссылка в новой задаче