From 2112f37637e398919600acf27caa4218ebc18dc3 Mon Sep 17 00:00:00 2001 From: Viji Date: Tue, 23 Jul 2024 12:03:11 +0530 Subject: [PATCH] conan process bug fix --- src/LCT.PackageIdentifier/ConanProcessor.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/LCT.PackageIdentifier/ConanProcessor.cs b/src/LCT.PackageIdentifier/ConanProcessor.cs index fde5e496..9bade284 100644 --- a/src/LCT.PackageIdentifier/ConanProcessor.cs +++ b/src/LCT.PackageIdentifier/ConanProcessor.cs @@ -246,15 +246,14 @@ private void ParsingInputFileForBOM(CommonAppSettings appSettings, ref Bom bom) AddingIdentifierType(components, "PackageFile"); componentsForBOM.AddRange(components); } - else if (filepath.EndsWith(FileConstant.CycloneDXFileExtension) && !filepath.EndsWith(FileConstant.SBOMTemplateFileExtension)) + else if (filepath.EndsWith(FileConstant.CycloneDXFileExtension) + && !filepath.EndsWith(FileConstant.SBOMTemplateFileExtension)) { Logger.Debug($"ParsingInputFileForBOM():Found as CycloneDXFile"); bom = _cycloneDXBomParser.ParseCycloneDXBom(filepath); CheckValidComponentsForProjectType(bom.Components, appSettings.ProjectType); + GetDetailsforManuallyAddedComp(bom.Components); componentsForBOM.AddRange(bom.Components); - GetDetailsforManuallyAddedComp(componentsForBOM);// todo: this step should come before - // merging the manually added components - // to discoverd } } @@ -273,11 +272,13 @@ private void ParsingInputFileForBOM(CommonAppSettings appSettings, ref Bom bom) bom.Dependencies = dependencies; } - if (File.Exists(appSettings.CycloneDxSBomTemplatePath) && appSettings.CycloneDxSBomTemplatePath.EndsWith(FileConstant.SBOMTemplateFileExtension)) + if (File.Exists(appSettings.CycloneDxSBomTemplatePath) + && appSettings.CycloneDxSBomTemplatePath.EndsWith(FileConstant.SBOMTemplateFileExtension)) { //Adding Template Component Details Bom templateDetails; - templateDetails = ExtractSBOMDetailsFromTemplate(_cycloneDXBomParser.ParseCycloneDXBom(appSettings.CycloneDxSBomTemplatePath)); + templateDetails = ExtractSBOMDetailsFromTemplate( + _cycloneDXBomParser.ParseCycloneDXBom(appSettings.CycloneDxSBomTemplatePath)); CheckValidComponentsForProjectType(templateDetails.Components, appSettings.ProjectType); SbomTemplate.AddComponentDetails(bom.Components, templateDetails); }