From 90aeadbe02af9a812e3726947c95c12acc3df8c3 Mon Sep 17 00:00:00 2001 From: Adam Driscoll Date: Wed, 15 May 2019 07:41:56 -0600 Subject: [PATCH] Generate bill of materials --- .gitignore | 2 + azure-pipelines.yml | 11 + src/UniversalDashboard.MaterialUI/.gitignore | 4 +- src/UniversalDashboard.MaterialUI/build.ps1 | 1 + src/UniversalDashboard.Materialize/build.ps1 | 1 + src/bom.xml | 353 +++++++++++++++++++ src/build.ps1 | 20 +- 7 files changed, 390 insertions(+), 2 deletions(-) create mode 100644 src/bom.xml diff --git a/.gitignore b/.gitignore index ec2fe41c..4802629b 100644 --- a/.gitignore +++ b/.gitignore @@ -266,3 +266,5 @@ TEST-*.xml # vscode settings folder .vscode/tasks.json + +*.bom.xml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d6351cc6..f384caa9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -45,6 +45,17 @@ steps: #verbose: # Optional #quiet: # Optional +- task: ArchiveFiles@2 + inputs: + rootFolderOrFile: '.\src\boms' + includeRootFolder: false + #archiveType: 'zip' # Options: zip, 7z, tar, wim + #tarCompression: 'gz' # Optional. Options: gz, bz2, xz, none + archiveFile: '$(Build.ArtifactStagingDirectory)/UniversalDashboard.Community.Bom.$(Build.BuildId).zip' + #replaceExistingArchive: true + #verbose: # Optional + #quiet: # Optional + # Publish Pipeline Artifact - task: PublishPipelineArtifact@0 inputs: diff --git a/src/UniversalDashboard.MaterialUI/.gitignore b/src/UniversalDashboard.MaterialUI/.gitignore index 5847271a..511c30b4 100644 --- a/src/UniversalDashboard.MaterialUI/.gitignore +++ b/src/UniversalDashboard.MaterialUI/.gitignore @@ -61,4 +61,6 @@ public/ output/ classes/bin -classes/obj \ No newline at end of file +classes/obj + +*.bom.xml \ No newline at end of file diff --git a/src/UniversalDashboard.MaterialUI/build.ps1 b/src/UniversalDashboard.MaterialUI/build.ps1 index c50f146f..a2f0568f 100644 --- a/src/UniversalDashboard.MaterialUI/build.ps1 +++ b/src/UniversalDashboard.MaterialUI/build.ps1 @@ -15,6 +15,7 @@ Remove-Item -Path "$BuildFolder\public" -Force -Recurse New-Item -Path $OutputPath -ItemType Directory +& cyclonedx-bom -o materialui.bom.xml npm install npm run build diff --git a/src/UniversalDashboard.Materialize/build.ps1 b/src/UniversalDashboard.Materialize/build.ps1 index fbf1bb8b..27a51317 100644 --- a/src/UniversalDashboard.Materialize/build.ps1 +++ b/src/UniversalDashboard.Materialize/build.ps1 @@ -16,6 +16,7 @@ Remove-Item -Path "$BuildFolder\public" -Force -ErrorAction SilentlyContinue -Re New-Item -Path $OutputPath -ItemType Directory New-Item -Path $OutputPath\Scripts -ItemType Directory +& cyclonedx-bom -o materialize.bom.xml npm install npm run build diff --git a/src/bom.xml b/src/bom.xml new file mode 100644 index 00000000..891720fc --- /dev/null +++ b/src/bom.xml @@ -0,0 +1,353 @@ + + + + + Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv + 2.1.3 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv@2.1.3 + false + + + System.Reflection.Emit + 4.3.0 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/System.Reflection.Emit@4.3.0 + false + + + Microsoft.Extensions.Caching.Memory + 2.1.2 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.Extensions.Caching.Memory@2.1.2 + false + + + Newtonsoft.Json + 11.0.2 + + Copyright © James Newton-King 2008 + pkg:nuget/Newtonsoft.Json@11.0.2 + false + + + Microsoft.DotNet.PlatformAbstractions + 2.1.0 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.DotNet.PlatformAbstractions@2.1.0 + false + + + NLog + 4.5.8 + + Copyright (c) 2004-2018 NLog Project - http://nlog-project.org/ + pkg:nuget/NLog@4.5.8 + false + + + Quartz + 3.0.6 + + Copyright Marko Lahma + pkg:nuget/Quartz@3.0.6 + false + + + System.Runtime.Loader + 4.3.0 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/System.Runtime.Loader@4.3.0 + false + + + NLog.Web.AspNetCore + 4.6.0 + + Copyright (c) 2015-2018 NLog Project - http://nlog-project.org/ + pkg:nuget/NLog.Web.AspNetCore@4.6.0 + false + + + System.Security.Principal + 4.3.0 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/System.Security.Principal@4.3.0 + false + + + Microsoft.AspNetCore + 2.1.3 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore@2.1.3 + false + + + Microsoft.AspNetCore.Mvc + 2.1.2 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Mvc@2.1.2 + false + + + Microsoft.AspNetCore.Routing + 2.1.1 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Routing@2.1.1 + false + + + Microsoft.Extensions.Logging.Debug + 2.1.1 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.Extensions.Logging.Debug@2.1.1 + false + + + Microsoft.AspNetCore.StaticFiles + 2.1.1 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.StaticFiles@2.1.1 + false + + + Microsoft.AspNetCore.WebSockets + 2.1.1 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.WebSockets@2.1.1 + false + + + Microsoft.AspNetCore.ResponseCompression + 2.1.1 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.ResponseCompression@2.1.1 + false + + + Microsoft.AspNetCore.Server.Kestrel.Https + 2.1.3 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Server.Kestrel.Https@2.1.3 + false + + + Microsoft.AspNetCore.Authentication.Cookies + 2.1.2 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Authentication.Cookies@2.1.2 + false + + + Microsoft.AspNetCore.Authentication.Facebook + 2.1.2 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Authentication.Facebook@2.1.2 + false + + + Microsoft.AspNetCore.Authentication.Twitter + 2.1.2 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Authentication.Twitter@2.1.2 + false + + + Microsoft.AspNetCore.Authentication.Google + 2.1.2 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Authentication.Google@2.1.2 + false + + + Microsoft.AspNetCore.Authentication.MicrosoftAccount + 2.1.2 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Authentication.MicrosoftAccount@2.1.2 + false + + + Microsoft.AspNetCore.Authentication.JwtBearer + 2.1.2 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Authentication.JwtBearer@2.1.2 + false + + + Microsoft.AspNetCore.Session + 2.1.1 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.Session@2.1.1 + false + + + Microsoft.AspNetCore.SignalR + 1.0.3 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.AspNetCore.SignalR@1.0.3 + false + + + Microsoft.Extensions.Logging.Filter + 1.1.2 + + Copyright © Microsoft Corporation + pkg:nuget/Microsoft.Extensions.Logging.Filter@1.1.2 + false + + + PowerShellStandard.Library + 5.1.0-preview-06 + + (c) Microsoft Corporation. All rights reserved. + pkg:nuget/PowerShellStandard.Library@5.1.0-preview-06 + false + + + System.Net.NameResolution + 4.3.0 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/System.Net.NameResolution@4.3.0 + false + + + Microsoft.NET.Test.Sdk + 15.5.0-preview-20171031-01 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.NET.Test.Sdk@15.5.0-preview-20171031-01 + false + + + Microsoft.TestPlatform.TestHost + 15.5.0-preview-20171031-01 + + © Microsoft Corporation. All rights reserved. + pkg:nuget/Microsoft.TestPlatform.TestHost@15.5.0-preview-20171031-01 + false + + + Microsoft.CodeCoverage + 1.0.3 + + pkg:nuget/Microsoft.CodeCoverage@1.0.3 + false + + + NSubstitute + 3.1.0 + + pkg:nuget/NSubstitute@3.1.0 + false + + + xunit + 2.4.0 + + pkg:nuget/xunit@2.4.0 + false + + + xunit.analyzers + 0.10.0 + + pkg:nuget/xunit.analyzers@0.10.0 + false + + + xunit.runner.visualstudio + 2.4.0 + + pkg:nuget/xunit.runner.visualstudio@2.4.0 + false + + + DasMulli.Win32.ServiceUtils + 1.2.0 + + pkg:nuget/DasMulli.Win32.ServiceUtils@1.2.0 + false + + + \ No newline at end of file diff --git a/src/build.ps1 b/src/build.ps1 index b01f86f3..a43ae06d 100644 --- a/src/build.ps1 +++ b/src/build.ps1 @@ -17,6 +17,12 @@ if ($powerShellGet.Version -lt ([Version]'1.6.0')) { Import-Module PowerShellGet -Force } +& dotnet tool install --global CycloneDX + +& dotnet CycloneDX "$PSScriptRoot/UniversalDashboard.Sln" -o ".\" + +Rename-Item "bom.xml" "dotnet.bom.xml" + & dotnet clean "$PSScriptRoot\UniversalDashboard\UniversalDashboard.csproj" & dotnet restore "$PSScriptRoot\UniversalDashboard\UniversalDashboard.csproj" @@ -30,6 +36,8 @@ Push-Location "$PSScriptRoot\client" Start-Process npm -ArgumentList "install" -Wait +& npm install -g @cyclonedx/bom +& cyclonedx-bom -o core.bom.xml & npm run build Pop-Location @@ -52,6 +60,14 @@ if ((Test-Path $outputDirectory)) { New-Item -ItemType Directory $outputDirectory +$bomDirectory = Join-Path $PSScriptRoot "boms" +if ((Test-Path $bomDirectory)) { + Remove-Item $bomDirectory -Force -Recurse +} + +New-Item -ItemType Directory $bomDirectory + + $net472 = Join-Path $outputDirectory "net472" $netstandard20 = Join-Path $outputDirectory "netstandard2.0" $help = Join-Path $outputDirectory "en-US" @@ -99,4 +115,6 @@ Copy-Item "$PSScriptRoot\UniversalDashboard.MaterialUI\output\UniversalDashboard if (-not $NoHelp) { New-ExternalHelp -Path "$PSScriptRoot\UniversalDashboard\Help" -OutputPath $help -} \ No newline at end of file +} + +Get-ChildItem $PSScriptRoot -Include "*.bom.xml" -Recurse | ForEach-Object { Copy-Item $_.FullName ".\boms" } \ No newline at end of file