Skip to content

Commit

Permalink
Removing VCPKG Properties (#890)
Browse files Browse the repository at this point in the history
* removing the VCPKG properties because they do not need to be in CD public

* changes

---------

Co-authored-by: Amitla Vannikumar <[email protected]>
  • Loading branch information
amitla1 and Amitla Vannikumar authored Nov 6, 2023
1 parent b61d0ec commit f42b36b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace Microsoft.ComponentDetection.Contracts.TypedComponent;

using System.Linq;
using PackageUrl;

public class VcpkgComponent : TypedComponent
Expand All @@ -21,11 +20,6 @@ public VcpkgComponent(string spdxid, string name, string version, string triplet
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; }
Expand All @@ -42,10 +36,6 @@ public VcpkgComponent(string spdxid, string name, string version, string triplet

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
Expand Down Expand Up @@ -81,22 +71,4 @@ public override PackageURL PackageUrl
}
}
}

private void SetGitRepoProperties()
{
/* example download locations
* "git+https://github.com/leethomason/[email protected]"
* "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();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Microsoft.ComponentDetection.Detectors.Vcpkg;
namespace Microsoft.ComponentDetection.Detectors.Vcpkg;

using System;
using System.Collections.Generic;
Expand Down

0 comments on commit f42b36b

Please sign in to comment.