diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index ee33eaa8..f2b385c1 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -95,7 +95,7 @@ jobs: $sourceFolder = Join-Path $env:GITHUB_WORKSPACE "out" | Join-Path -ChildPath "*" $outFolder = Join-Path $env:GITHUB_WORKSPACE "out" | Join-Path -ChildPath "continuous-clearing" New-Item -ItemType Directory -Force -Path $outFolder - $fileName = "continuous-clearing-v6.1.0.zip" + $fileName = "continuous-clearing-v6.2.0.zip" Write-Host "Filename: '$fileName'" Write-Host "sourceFolder: '$sourceFolder'" Write-Host "Outfolder: '$outFolder'" @@ -139,8 +139,8 @@ jobs: - name: Create Nuget Packages id: createNupkg run: | - nuget pack CA.nuspec -Version 6.1.0 - Write-Host "::set-output name=nupkg-LicenseClearingTool::continuous-clearing.6.1.0.nupkg" + nuget pack CA.nuspec -Version 6.2.0 + Write-Host "::set-output name=nupkg-LicenseClearingTool::continuous-clearing.6.2.0.nupkg" - name: Archive NuGet Packages uses: actions/upload-artifact@v2 @@ -153,9 +153,9 @@ jobs: id: builddocker #if: ${{ false }} # disable for now run: | - docker build . --file Dockerfile --tag ${{ github.repository }}:continuous-clearing-v6.1.0 - docker save ${{ github.repository }}:continuous-clearing-v6.1.0 -o continuous-clearing-v6.1.0.tar - Write-Host "::set-output name=docker-LicenseClearingTool::continuous-clearing-v6.1.0.tar" + docker build . --file Dockerfile --tag ${{ github.repository }}:continuous-clearing-v6.2.0 + docker save ${{ github.repository }}:continuous-clearing-v6.2.0 -o continuous-clearing-v6.2.0.tar + Write-Host "::set-output name=docker-LicenseClearingTool::continuous-clearing-v6.2.0.tar" - name: Archive docker image #if: ${{ false }} # disable for now @@ -196,8 +196,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v6.1.0 - release_name: Release v6.1.0 + tag_name: v6.2.0 + release_name: Release v6.2.0 body: | ${{ github.event.head_commit.message }} draft: true diff --git a/src/LCT.PackageIdentifier/NugetProcessor.cs b/src/LCT.PackageIdentifier/NugetProcessor.cs index 898da0d4..878697d0 100644 --- a/src/LCT.PackageIdentifier/NugetProcessor.cs +++ b/src/LCT.PackageIdentifier/NugetProcessor.cs @@ -43,25 +43,14 @@ public Bom ParsePackageFile(CommonAppSettings appSettings) { Logger.Debug($"ParsePackageFile():Start"); List listComponentForBOM = new List(); - Bom bom = new Bom(); - int totalComponentsIdentified = 0; + Bom bom = new Bom(); ParsingInputFileForBOM(appSettings, ref listComponentForBOM, ref bom); - totalComponentsIdentified = listComponentForBOM.Count; - - listComponentForBOM = listComponentForBOM.Distinct(new ComponentEqualityComparer()).ToList(); - if (BomCreator.bomKpiData.DuplicateComponents == 0) - { - BomCreator.bomKpiData.DuplicateComponents = totalComponentsIdentified - listComponentForBOM.Count; - } - - var componentsWithMultipleVersions = listComponentForBOM.GroupBy(s => s.Name) - .Where(g => g.Count() > 1).SelectMany(g => g).ToList(); + var componentsWithMultipleVersions = bom.Components.GroupBy(s => s.Name).Where(g => g.Count() > 1).SelectMany(g => g).ToList(); CheckForMultipleVersions(appSettings, componentsWithMultipleVersions); Logger.Debug($"ParsePackageFile():End"); - bom.Components = listComponentForBOM; return bom; } @@ -362,6 +351,7 @@ private void ParsingInputFileForBOM(CommonAppSettings appSettings, ref List configFiles; List componentsForBOM = new List(); List dependencies = new List(); + int totalComponentsIdentified = 0; configFiles = FolderScanner.FileScanner(appSettings.PackageFilePath, appSettings.Nuget); @@ -399,7 +389,13 @@ private void ParsingInputFileForBOM(CommonAppSettings appSettings, ref List s.Properties[0].Value == "true"); bom.Components = listComponentForBOM; @@ -411,9 +407,8 @@ private void ParsingInputFileForBOM(CommonAppSettings appSettings, ref List listComponentForBOM, List listofComponents, List dependencies)