Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract Sarif.Multitool.Library from Sarif.Multitool #2054

Merged
10 commits merged into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/Projects.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ $Projects.Libraries = @(
"Sarif",
"Sarif.Converters",
"Sarif.Driver",
"Sarif.WorkItems"
"Sarif.Multitool.Library"
Copy link
Contributor

@rtaket rtaket Sep 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sarif.Multitool.Library [](start = 5, length = 23)

Will the multitool library be shipped in the Sarif.Sdk nuget package? #ByDesign

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's a separate NuGet package Sarif.Multitool.Library.


In reply to: 483762094 [](ancestors = 483762094)

"Sarif.WorkItems",
"WorkItems"
)

$Projects.Applications = @(
Expand Down
2 changes: 0 additions & 2 deletions src/Nuget/Sarif.Multitool.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
/>

<file src="src\ReleaseHistory.md" />
<file src="policies\github-dsp.config.xml" target="policies" />
<file src="policies\github-dsp.config.sarif-external-properties" target="policies" />
<file src="src\Sarif.Multitool\**\*.cs" target="src" />
</files>
</package>
8 changes: 8 additions & 0 deletions src/ReleaseHistory.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# SARIF Package Release History (SDK, Driver, Converters, and Multitool)

## **v2.3.5** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.3.5) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.3.5) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.3.5) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.3.5) | [Multitool Library](https://www.nuget.org/packages/Sarif.Multitool.Library/2.3.5)
* FEATURE: COMMAND-LINE BREAKING: Validation rule `SARIF2005.ProvideToolProperties` now requires `informationUri`, it allows `dottedQuadFileVersion` to satisfy the requirement that version information be present, and it is configurable.
* FEATURE: COMMAND-LINE BREAKING: The analysis rules that validate a SARIF file's compatibility with the GitHub Developer Security Portal now have rule ids that begin with `DSP` rather than `SARIF`.
* FEATURE: Extract the public APIs from Sarif.Multitool into a new dependency package Sarif.Multitool.Library. Sarif.Multitool remains as a dotnet tool package.
* FEATURE: Validation rule `SARIF2012` now checks for the presence of a friendly name in PascalCase in the `name` property, and is renamed from `ProvideHelpUris` to `ProvideRuleProperties`.
* FEATURE: The Multitool `rewrite` command now accepts `VersionControlInformation` as an argument to the `--insert` option. This argument populates `run.versionControlProvenance`, and it re-expresses all absolute URIs as relative references with respect to the nearest enclosing repository root, if any.

## **v2.3.4** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.3.4) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.3.4) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.3.4) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.3.4)
* COMMAND-LINE BREAKING: Change `merge` command output directory argument name to `output-directory`.
* FEATURE: Add analysis rules appropriate for SARIF files that are to be uploaded to the GitHub Developer Security Portal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace Microsoft.CodeAnalysis.Sarif.Multitool
{
public abstract class CommandBase
{
internal const int SUCCESS = 0;
internal const int FAILURE = 1;
public const int SUCCESS = 0;
public const int FAILURE = 1;

protected static bool ValidateNonNegativeCommandLineOption<T>(long optionValue, string optionName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices.WindowsRuntime;

using Microsoft.CodeAnalysis.Sarif.Driver;
using Microsoft.CodeAnalysis.Sarif.Driver.Sdk;
using Microsoft.CodeAnalysis.Sarif.Processors;
using Microsoft.CodeAnalysis.Sarif.Visitors;
using Microsoft.CodeAnalysis.Sarif.Writers;
using Microsoft.Extensions.Options;
using Microsoft.TeamFoundation.Work.WebApi;
using Microsoft.VisualStudio.Services.OAuth;

using Newtonsoft.Json;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions src/Sarif.Multitool.Library/Sarif.Multitool.Library.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="AssemblyAttributes">
<AssemblyTitle>SARIF Multitool Library</AssemblyTitle>
<Description>The public API exposing the commands used by the SARIF Multitool.</Description>
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<RootNamespace>Microsoft.CodeAnalysis.Sarif.Multitool</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Json.Pointer" Version="1.1.2" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="$(MsBuildThisFileDirectory)..\Sarif\Schemata\sarif-$(SchemaVersionAsPublishedToSchemaStoreOrg).json" Link="sarif-2.1.0.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
<Compile Update="MultitoolResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>MultitoolResources.resx</DependentUpon>
</Compile>
<Compile Update="Rules\RuleResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>RuleResources.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="MultitoolResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>MultitoolResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Rules\RuleResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>RuleResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<None Include="default.configuration.xml"
Pack="true"
PackagePath="lib/netstandard2.0;lib/net461"
CopyToOutputDirectory="PreserveNewest" />
<None Include="..\..\policies\*"
Pack="true"
PackagePath="policies" />
<None Include="**\*.cs"
Pack="true"
PackagePath="src" />
<None Include="..\ReleaseHistory.md"
Pack="true"
PackagePath="/" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Sarif.Converters\Sarif.Converters.csproj" />
<ProjectReference Include="..\Sarif.Driver\Sarif.Driver.csproj" />
<ProjectReference Include="..\Sarif.WorkItems\Sarif.WorkItems.csproj" />
<ProjectReference Include="..\Sarif\Sarif.csproj" />
</ItemGroup>

</Project>
41 changes: 5 additions & 36 deletions src/Sarif.Multitool/Sarif.Multitool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<PropertyGroup Label="AssemblyAttributes">
<AssemblyTitle>SARIF Multitool</AssemblyTitle>
<Description>Command line tool to perform transformations of input files to SARIF.</Description>
<Description>Command line tool to manipulate SARIF files.</Description>
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />
Expand All @@ -39,45 +39,17 @@

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.7.82" />
<PackageReference Include="Microsoft.Json.Pointer" Version="1.1.1" />
<PackageReference Include="Microsoft.Json.Schema" Version="1.1.1" />
<PackageReference Include="Microsoft.Json.Schema.Validation" Version="1.1.1" />
<PackageReference Include="Microsoft.Json.Pointer" Version="1.1.2" />
<PackageReference Include="Microsoft.Json.Schema" Version="1.1.2" />
<PackageReference Include="Microsoft.Json.Schema.Validation" Version="1.1.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Sarif\Sarif.csproj" />
<ProjectReference Include="..\Sarif.Driver\Sarif.Driver.csproj" />
<ProjectReference Include="..\Sarif.WorkItems\Sarif.WorkItems.csproj" />
<ProjectReference Include="..\Sarif.Converters\Sarif.Converters.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="MultitoolResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>MultitoolResources.resx</DependentUpon>
</Compile>
<Compile Update="Rules\RuleResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>RuleResources.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="MultitoolResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>MultitoolResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Rules\RuleResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>RuleResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<ProjectReference Include="..\Sarif.Multitool.Library\Sarif.Multitool.Library.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include=".\DotnetToolSettings.xml" CopyToOutputDirectory="PreserveNewest" />
<EmbeddedResource Include="$(MsBuildThisFileDirectory)..\Sarif\Schemata\sarif-$(SchemaVersionAsPublishedToSchemaStoreOrg).json" Link="sarif-2.1.0.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
Expand All @@ -87,9 +59,6 @@
<None Update="appsettings.local.json">
<CopyToOutputDirectory Condition="'$(Configuration)' == 'Debug'">PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="default.configuration.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading