-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kevin Sigmund
committed
Jun 22, 2022
1 parent
1157f24
commit a92935c
Showing
26 changed files
with
359 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<PackAsTool>true</PackAsTool> | ||
<ToolCommandName>manifesttool</ToolCommandName> | ||
<PackageOutputPath>./nupkg</PackageOutputPath> | ||
<AssemblyName>Microsoft.Sbom.Tool</AssemblyName> | ||
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers> | ||
<SignAssembly>true</SignAssembly> | ||
<IsPublishable>true</IsPublishable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Microsoft.Sbom.Api\Microsoft.Sbom.Api.csproj" /> | ||
<ProjectReference Include="..\Microsoft.Sbom.Common\Microsoft.Sbom.Common.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="signtool.exe"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Update="MS.ThirdPartyMarketplaceRoot.cer"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using PowerArgs; | ||
using Serilog; | ||
using System; | ||
using System.Reflection; | ||
using System.Threading.Tasks; | ||
using Microsoft.Sbom.Api; | ||
//using Microsoft.Sbom.Common.Config; | ||
using Microsoft.Sbom.Api.Config; | ||
|
||
namespace Microsoft.Sbom.Tool | ||
{ | ||
internal class Program | ||
{ | ||
internal static string Name => NameValue.Value; | ||
|
||
internal static string Version => VersionValue.Value; | ||
|
||
private static readonly Lazy<string> NameValue = new Lazy<string>(() => | ||
{ | ||
return typeof(Program).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyProductAttribute>()?.Product ?? "DropValidator"; | ||
}); | ||
|
||
private static readonly Lazy<string> VersionValue = new Lazy<string>(() => | ||
{ | ||
return typeof(Program).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? string.Empty; | ||
}); | ||
|
||
public static async Task<int> Main(string[] args) | ||
{ | ||
var result = await Args.InvokeActionAsync<ManifestToolCmdRunner>(args); | ||
Log.CloseAndFlush(); | ||
if (result.Cancelled || result.HandledException != null || result.Args.IsFailed) | ||
{ | ||
if (result.Args != null && result.Args.IsAccessError) | ||
{ | ||
return (int)ExitCode.WriteAccessError; | ||
} | ||
|
||
return (int)ExitCode.GeneralError; | ||
} | ||
|
||
return (int)ExitCode.Success; | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.