This commit is contained in:
Gabe Stocco 2022-11-16 07:44:23 -08:00 коммит произвёл GitHub
Родитель 4f9900398a
Коммит 629dfeb109
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
15 изменённых файлов: 142 добавлений и 87 удалений

Просмотреть файл

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<RootNamespace>Microsoft.ApplicationInspector.CLI</RootNamespace>
<AssemblyName>ApplicationInspector.CLI</AssemblyName>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
@ -29,20 +29,20 @@
</PropertyGroup>
<ItemGroup>
<None Remove="Writers\AnalyzeHtmlWriter.cs.foo"/>
<None Remove="Writers\AnalyzeHtmlWriter.cs.foo" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="html\partials\_file_listing.liquid"/>
<EmbeddedResource Include="html\partials\_report_overview.liquid"/>
<EmbeddedResource Include="html\partials\_report_profile.liquid"/>
<EmbeddedResource Include="html\partials\_report_summary.liquid"/>
<EmbeddedResource Include="html\partials\_file_listing.liquid" />
<EmbeddedResource Include="html\partials\_report_overview.liquid" />
<EmbeddedResource Include="html\partials\_report_profile.liquid" />
<EmbeddedResource Include="html\partials\_report_summary.liquid" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AppInspector.Logging\AppInspector.Logging.csproj"/>
<ProjectReference Include="..\AppInspector.RulesEngine\AppInspector.RulesEngine.csproj"/>
<ProjectReference Include="..\AppInspector\AppInspector.Commands.csproj"/>
<ProjectReference Include="..\AppInspector.Logging\AppInspector.Logging.csproj" />
<ProjectReference Include="..\AppInspector.RulesEngine\AppInspector.RulesEngine.csproj" />
<ProjectReference Include="..\AppInspector\AppInspector.Commands.csproj" />
</ItemGroup>
<ItemGroup>
@ -61,18 +61,22 @@
</ItemGroup>
<ItemGroup>
<None Include="..\LICENSE.txt" Pack="true" PackagePath=""/>
<None Include="..\icon-128.png" Pack="true" PackagePath=""/>
<None Include="..\LICENSE.txt" Pack="true" PackagePath="" />
<None Include="..\icon-128.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DotLiquid" Version="2.2.656"/>
<PackageReference Include="Sarif.Sdk" Version="3.1.0"/>
<PackageReference Include="Serilog" Version="2.11.0"/>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0"/>
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1"/>
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0"/>
<PackageReference Include="ShellProgressBar" Version="5.2.0"/>
<PackageReference Include="DotLiquid" Version="2.2.656" />
<PackageReference Include="Sarif.Sdk" Version="3.1.0" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.5.119" />
</ItemGroup>
</Project>

Просмотреть файл

@ -30,7 +30,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1"/>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
</ItemGroup>
@ -50,8 +50,12 @@
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig"/>
<None Include="..\LICENSE.txt" Pack="true" PackagePath=""/>
<None Include="..\icon-128.png" Pack="true" PackagePath=""/>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="..\LICENSE.txt" Pack="true" PackagePath="" />
<None Include="..\icon-128.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.5.119" />
</ItemGroup>
</Project>

Просмотреть файл

@ -26,20 +26,24 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<TargetFrameworks>net6.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1"/>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0"/>
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1"/>
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0"/>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig"/>
<None Include="..\LICENSE.txt" Pack="true" PackagePath=""/>
<None Include="..\icon-128.png" Pack="true" PackagePath=""/>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="..\LICENSE.txt" Pack="true" PackagePath="" />
<None Include="..\icon-128.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.5.119" />
</ItemGroup>
</Project>

Просмотреть файл

@ -26,16 +26,16 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<TargetFrameworks>net6.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JsonCons.JsonPath" Version="1.1.0" />
<PackageReference Include="Microsoft.CST.OAT" Version="1.2.25" />
<PackageReference Include="Microsoft.CST.RecursiveExtractor" Version="1.1.11" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
<PackageReference Include="Microsoft.CST.OAT" Version="1.2.38" />
<PackageReference Include="Microsoft.CST.RecursiveExtractor" Version="1.1.19" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="YamlDotNet" Version="12.0.1" />
<PackageReference Include="YamlDotNet" Version="12.0.2" />
</ItemGroup>
@ -58,4 +58,8 @@
<None Include="..\LICENSE.txt" Pack="true" PackagePath="" />
<None Include="..\icon-128.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.5.119" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0;net6.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>

Просмотреть файл

@ -4,7 +4,7 @@
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
@ -17,8 +17,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
@ -31,4 +31,8 @@
<ProjectReference Include="..\AppInspector.Logging\AppInspector.Logging.csproj" />
<ProjectReference Include="..\AppInspector\AppInspector.Commands.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.5.119" />
</ItemGroup>
</Project>

Просмотреть файл

@ -31,7 +31,7 @@
<Target DependsOnTargets="ResolveReferences" Name="CopyProjectReferencesToPackage">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))"/>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
</ItemGroup>
</Target>
@ -43,23 +43,23 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants/>
<DefineConstants />
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="rules\default\**\*.json"/>
<EmbeddedResource Include="rules\default\**\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1"/>
<PackageReference Include="DotLiquid" Version="2.2.656"/>
<PackageReference Include="Glob" Version="1.1.9"/>
<PackageReference Include="Microsoft.CST.OAT" Version="1.2.25"/>
<PackageReference Include="Microsoft.CST.RecursiveExtractor" Version="1.1.11"/>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
<PackageReference Include="ShellProgressBar" Version="5.2.0"/>
<PackageReference Include="System.Reflection.Metadata" Version="6.0.1"/>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="DotLiquid" Version="2.2.656" />
<PackageReference Include="Glob" Version="1.1.9" />
<PackageReference Include="Microsoft.CST.OAT" Version="1.2.38" />
<PackageReference Include="Microsoft.CST.RecursiveExtractor" Version="1.1.19" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
<PackageReference Include="System.Reflection.Metadata" Version="7.0.0" />
</ItemGroup>
@ -83,12 +83,16 @@
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<IncludeAssets>ApplicationInspector.Common.dll</IncludeAssets>
</ProjectReference>
<ProjectReference Include="..\AppInspector.RulesEngine\AppInspector.RulesEngine.csproj"/>
<ProjectReference Include="..\AppInspector.RulesEngine\AppInspector.RulesEngine.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig"/>
<None Include="..\LICENSE.txt" Pack="true" PackagePath=""/>
<None Include="..\icon-128.png" Pack="true" PackagePath=""/>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="..\LICENSE.txt" Pack="true" PackagePath="" />
<None Include="..\icon-128.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.5.119" />
</ItemGroup>
</Project>

Просмотреть файл

@ -2,18 +2,21 @@
using System.IO;
using System.Reflection;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using Microsoft.ApplicationInspector.Commands;
namespace Benchmarks;
namespace ApplicationInspector.Benchmarks;
[MemoryDiagnoser]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.Net60)]
//[ConcurrencyVisualizerProfiler]
public class AnalyzeBenchmark
{
// Manually put the file you want to benchmark. But don't put this in a path with "Test" in the name ;)
private const string path = "C:\\Users\\gstocco\\Documents\\GitHub\\ApplicationInspector\\RulesEngine\\";
private const string path = "C:\\Users\\gstocco\\Documents\\GitHub\\ApplicationInspector\\AppInspector.RulesEngine";
[Benchmark(Baseline = true)]
public static void AnalyzeSingleThreaded()
public void AnalyzeSingleThreaded()
{
AnalyzeCommand command = new(new AnalyzeOptions
{
@ -28,7 +31,7 @@ public class AnalyzeBenchmark
}
[Benchmark]
public static void AnalyzeMultiThread()
public void AnalyzeMultiThread()
{
AnalyzeCommand command = new(new AnalyzeOptions
{

Просмотреть файл

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
</PropertyGroup>
@ -21,4 +21,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.5.119" />
</ItemGroup>
</Project>

Просмотреть файл

@ -8,7 +8,7 @@ public class Program
public static void Main(string[] args)
{
// new DebugInProcessConfig()
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, new DebugInProcessConfig());
//var summary = BenchmarkRunner.Run<AnalyzeBenchmark>();
//BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, new DebugInProcessConfig());
var summary = BenchmarkRunner.Run<AnalyzeBenchmark>();
}
}

Просмотреть файл

@ -1,6 +1,16 @@
# Azure Pipelines
# https://aka.ms/yaml
variables:
- name: CurrentSDK
value: 7.0.x
- name: CurrentFramework
value: net7.0
- name: LTS_SDK
value: 6.0.x
- name: LTS_Framework
value: net6.0
name: ApplicationInspector_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
trigger:
batch: true
@ -34,7 +44,9 @@ stages:
jobs:
- template: templates/dotnet-test-job.yml
parameters:
dotnetVersion: 6.0.x
jobName: "test_current"
dotnetVersion: ${{ variables.currentSDK }}
dotnetVersionLTS: ${{ variables.LTS_SDK }}
projectPath: 'AppInspector.Tests/AppInspector.Tests.csproj'
- stage: SDL
@ -49,14 +61,16 @@ stages:
jobs:
- template: templates/dotnet-publish-linux-mac-job.yml
parameters:
dotnetVersion: '6.0.x'
dotnetVersion: '${{ variables.CurrentSDK }}'
publishFrameworkVersion: '${{ variables.CurrentFramework }}'
projectPath: 'AppInspector.CLI/AppInspector.CLI.csproj'
projectName: 'ApplicationInspector'
preBuild:
- template: templates/nbgv-set-version-steps.yml
- template: templates/dotnet-publish-win-netcore-job.yml
parameters:
dotnetVersion: '6.0.x'
dotnetVersion: '${{ variables.CurrentSDK }}'
publishFrameworkVersion: '${{ variables.CurrentFramework }}'
projectPath: 'AppInspector.CLI/AppInspector.CLI.csproj'
projectName: 'ApplicationInspector'
preBuild:
@ -64,31 +78,31 @@ stages:
- template: templates/nuget-build-job.yml
parameters:
jobName: 'pack_lib'
dotnetVersion: '6.0.x'
dotnetVersion: '${{ variables.CurrentSDK }}'
projectPath: 'AppInspector/AppInspector.Commands.csproj'
projectName: 'ApplicationInspector_Commands'
- template: templates/nuget-build-job.yml
parameters:
jobName: 'pack_engine'
dotnetVersion: '6.0.x'
dotnetVersion: '${{ variables.CurrentSDK }}'
projectPath: 'AppInspector.RulesEngine/AppInspector.RulesEngine.csproj'
projectName: 'ApplicationInspector_RulesEngine'
- template: templates/nuget-build-job.yml
parameters:
jobName: 'pack_common'
dotnetVersion: '6.0.x'
dotnetVersion: '${{ variables.CurrentSDK }}'
projectPath: 'AppInspector.Common/AppInspector.Common.csproj'
projectName: 'ApplicationInspector_Common'
- template: templates/nuget-build-job.yml
parameters:
jobName: 'pack_logging'
dotnetVersion: '6.0.x'
dotnetVersion: '${{ variables.CurrentSDK }}'
projectPath: 'AppInspector.Logging/AppInspector.Logging.csproj'
projectName: 'ApplicationInspector_Logging'
- template: templates/nuget-build-job.yml
parameters:
jobName: 'pack_cli'
dotnetVersion: '6.0.x'
dotnetVersion: '${{ variables.CurrentSDK }}'
projectPath: 'AppInspector.CLI/AppInspector.CLI.csproj'
projectName: 'ApplicationInspector_CLI'
@ -106,7 +120,7 @@ stages:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.0.x'
version: '${{ variables.CurrentSDK }}'
- script: 'dotnet tool update -g nbgv'
displayName: 'Install GitVersioning'
- task: PowerShell@2
@ -130,7 +144,7 @@ stages:
destinationFolder: '$(Build.BinariesDirectory)'
cleanDestinationFolder: false
overwriteExistingFiles: true
- task: AntiMalware@3
- task: AntiMalware@4
displayName: Anti-Malware Scan
inputs:
InputType: 'Basic'

Просмотреть файл

@ -11,6 +11,10 @@ parameters:
- name: dotnetVersion
type: string
default: '6.0.x'
# Version of Dotnet SDK to use
- name: publishFrameworkVersion
type: string
default: 'net6.0'
# Version of NuGet Tool to use
- name: nugetVersion
type: string
@ -62,14 +66,14 @@ jobs:
displayName: Publish Linux x64
inputs:
command: 'publish'
arguments: '${{ parameters.projectPath }} -c ${{ parameters.buildConfiguration }} -o bin/linux/${{ parameters.projectName }}_linux_$(ReleaseVersion) -r linux-x64'
arguments: '${{ parameters.projectPath }} -f ${{ parameters.publishFrameworkVersion}} -c ${{ parameters.buildConfiguration }} -o bin/linux/${{ parameters.projectName }}_linux_$(ReleaseVersion) -r linux-x64'
publishWebProjects: false
zipAfterPublish: false
- task: DotNetCoreCLI@2
displayName: Publish MacOS x64
inputs:
command: 'publish'
arguments: '${{ parameters.projectPath }} -c ${{ parameters.buildConfiguration }} -o bin/macos/${{ parameters.projectName }}_macos_$(ReleaseVersion) -r osx-x64'
arguments: '${{ parameters.projectPath }} -f ${{ parameters.publishFrameworkVersion}} -c ${{ parameters.buildConfiguration }} -o bin/macos/${{ parameters.projectName }}_macos_$(ReleaseVersion) -r osx-x64'
publishWebProjects: false
zipAfterPublish: false
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0

Просмотреть файл

@ -11,6 +11,10 @@ parameters:
- name: dotnetVersion
type: string
default: '6.0.x'
# Version of Dotnet SDK to use
- name: publishFrameworkVersion
type: string
default: 'net6.0'
# Version of NuGet Tool to use
- name: nugetVersion
type: string
@ -62,17 +66,17 @@ jobs:
displayName: Publish Win x64
inputs:
command: 'publish'
arguments: '${{ parameters.projectPath }} -c ${{ parameters.buildConfiguration }} -o bin/win/${{ parameters.projectName }}_win_$(ReleaseVersion) -r win-x64'
arguments: '${{ parameters.projectPath }} -f ${{ parameters.publishFrameworkVersion}} -c ${{ parameters.buildConfiguration }} -o bin/win/${{ parameters.projectName }}_win_$(ReleaseVersion) -r win-x64'
publishWebProjects: false
zipAfterPublish: false
- task: DotNetCoreCLI@2
displayName: Build .NET Core App
inputs:
command: 'build'
arguments: '${{ parameters.projectPath }} -c ${{ parameters.buildConfiguration }} -o bin/netcoreapp/${{ parameters.projectName }}_netcoreapp_$(ReleaseVersion)'
arguments: '${{ parameters.projectPath }} -f ${{ parameters.publishFrameworkVersion}} -c ${{ parameters.buildConfiguration }} -o bin/netcoreapp/${{ parameters.projectName }}_netcoreapp_$(ReleaseVersion)'
publishWebProjects: false
zipAfterPublish: false
- task: AntiMalware@3
- task: AntiMalware@4
displayName: Anti-Malware Scan
inputs:
InputType: 'Basic'

Просмотреть файл

@ -5,6 +5,10 @@ parameters:
default: 'dotnet_test'
# Version of Dotnet SDK to use
- name: dotnetVersion
type: string
default: '7.0.x'
# Version of Dotnet SDK to use
- name: dotnetVersionLTS
type: string
default: '6.0.x'
# List of paths to .csproj
@ -22,17 +26,16 @@ jobs:
displayName: Install Dotnet SDK
inputs:
packageType: 'sdk'
version: ${{ parameters.dotnetVersion }}
- task: DotNetCoreCLI@2
displayName: Dotnet Restore
version: ${{ parameters.dotnetVersionLTS }}
- task: UseDotNet@2
displayName: Install Dotnet SDK
inputs:
command: 'restore'
projects: ${{ parameters.projectPath }}
verbosityRestore: 'Normal'
packageType: 'sdk'
version: ${{ parameters.dotnetVersion }}
- task: DotNetCoreCLI@2
displayName: Dotnet Test
inputs:
command: 'test'
projects: ${{ parameters.projectPath }}
arguments: '-f net6.0 --collect "Code coverage"'
arguments: '--collect "Code coverage"'
publishTestResults: true

Просмотреть файл

@ -6,7 +6,7 @@ parameters:
# Version of Dotnet SDK to use
- name: dotnetVersion
type: string
default: '6.0.x'
default: '7.0.x'
# Version of NuGet Tool to use
- name: nugetVersion
type: string
@ -55,7 +55,7 @@ jobs:
command: 'custom'
custom: 'pack'
arguments: '${{ parameters.projectPath }} -c ${{ parameters.buildConfiguration }} -o Packages'
- task: AntiMalware@3
- task: AntiMalware@4
displayName: Anti-Malware Scan
inputs:
InputType: 'Basic'