-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
2 changed files
with
1 addition
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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; } | ||
|
@@ -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 | ||
|
@@ -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(); | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/Microsoft.ComponentDetection.Detectors/vcpkg/VcpkgComponentDetector.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters