diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 4ab07a9a..2256616a 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -43,7 +43,6 @@ jobs: - name: test run: dotnet test --configuration Release -f ${{ matrix.framework }} --no-restore - test_windows: runs-on: windows-latest strategy: @@ -110,10 +109,10 @@ jobs: run: dotnet restore -p:TargetFramework=${{ matrix.targetFramework }} - name: build - run: dotnet publish ./src/NuGetUtility/NuGetUtility.csproj --configuration Release -o ./release -f ${{ matrix.targetFramework }} --no-restore + run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj --configuration Release -o ./release -f ${{ matrix.targetFramework }} --no-restore - name: check - run: dotnet ./release/NuGetUtility.dll -ji ./.github/workflows/assets/${{ matrix.project }}/projectsToCheck.json -t -a ./.github/workflows/assets/${{ matrix.project }}/allowedLicenses.json -o JsonPretty -override ./.github/workflows/assets/${{ matrix.project }}/overwritePackageInformation.json -ignore ./.github/workflows/assets/${{ matrix.project }}/ignorePackages.json -mapping ./.github/workflows/assets/${{ matrix.project }}/urlToLicenseMapping.json -d ./licenses/${{ matrix.project }}/${{ matrix.targetFramework }} + run: dotnet ./release/NuGetLicenseCore.dll -ji ./.github/workflows/assets/${{ matrix.project }}/projectsToCheck.json -t -a ./.github/workflows/assets/${{ matrix.project }}/allowedLicenses.json -o JsonPretty -override ./.github/workflows/assets/${{ matrix.project }}/overwritePackageInformation.json -ignore ./.github/workflows/assets/${{ matrix.project }}/ignorePackages.json -mapping ./.github/workflows/assets/${{ matrix.project }}/urlToLicenseMapping.json -d ./licenses/${{ matrix.project }}/${{ matrix.targetFramework }} - name: show downloaded licenses shell: pwsh @@ -124,6 +123,46 @@ jobs: Get-Content $file.FullName Write-Host ::endgroup:: } + check_licenses_net472: + runs-on: windows-latest + strategy: + matrix: + project: [App, Tests] + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: nuget/setup-nuget@v2 + - run: nuget restore NuGetUtility.sln + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: fully qualify release path + id: release_path + shell: pwsh + run: | + $path = [System.IO.Path]::GetFullPath("./release"); + echo "publish to path: $path" + echo "path=$path" >> $env:GITHUB_OUTPUT + + - name: build + run: msbuild ./src/NuGetLicenseFramework/NuGetLicenseFramework.csproj /t:Publish /p:configuration=Release /p:PublishDir=${{ steps.release_path.outputs.path }} + + - name: check + run: ${{ steps.release_path.outputs.path }}/NuGetLicenseFramework.exe -ji ./.github/workflows/assets/${{ matrix.project }}/projectsToCheck.json -t -a ./.github/workflows/assets/${{ matrix.project }}/allowedLicenses.json -o JsonPretty -override ./.github/workflows/assets/${{ matrix.project }}/overwritePackageInformation.json -ignore ./.github/workflows/assets/${{ matrix.project }}/ignorePackages.json -mapping ./.github/workflows/assets/${{ matrix.project }}/urlToLicenseMapping.json -d ./licenses/${{ matrix.project }} + + - name: show downloaded licenses + shell: pwsh + run: | + foreach($file in Get-ChildItem -Path ./licenses/${{ matrix.project }}) + { + Write-Host ::group::$file + Get-Content $file.FullName + Write-Host ::endgroup:: + } check_version_command: runs-on: ubuntu-latest @@ -162,12 +201,51 @@ jobs: version_format: "${major}.${minor}.${patch}-test${increment}" - name: build - run: dotnet publish ./src/NuGetUtility/NuGetUtility.csproj --configuration Release -o ./release -f ${{ matrix.targetFramework }} --no-restore -p:Version=${{ steps.version.outputs.version }} + run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj --configuration Release -o ./release -f ${{ matrix.targetFramework }} --no-restore -p:Version=${{ steps.version.outputs.version }} + + - name: check app version + shell: pwsh + run: | + $cmdOutput = dotnet ./release/NuGetLicenseCore.dll --version | Out-String + if(!($cmdOutput.Trim() -like '${{ steps.version.outputs.version }}')) { + Write-Host Versions do not match: read $cmdOutput, expected ${{ steps.version.outputs.version }} + exit 1; + } + check_version_command_net472: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: nuget/setup-nuget@v2 + - run: nuget restore NuGetUtility.sln + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: fully qualify release path + id: release_path + shell: pwsh + run: | + $path = [System.IO.Path]::GetFullPath("./release"); + echo "publish to path: $path" + echo "path=$path" >> $env:GITHUB_OUTPUT + + - uses: paulhatch/semantic-version@v5.4.0 + id: version + name: version + with: + tag_prefix: "v" + version_format: "${major}.${minor}.${patch}-test${increment}" + + - name: build + run: msbuild ./src/NuGetLicenseFramework/NuGetLicenseFramework.csproj /t:Publish /p:configuration=Release /p:PublishDir=${{ steps.release_path.outputs.path }} /p:Version=${{ steps.version.outputs.version }} - name: check app version shell: pwsh run: | - $cmdOutput = dotnet ./release/NuGetUtility.dll --version | Out-String + $cmdOutput = ${{ steps.release_path.outputs.path }}/NuGetLicenseFramework.exe --version | Out-String if(!($cmdOutput.Trim() -like '${{ steps.version.outputs.version }}')) { Write-Host Versions do not match: read $cmdOutput, expected ${{ steps.version.outputs.version }} exit 1; diff --git a/.github/workflows/assets/App/projectsToCheck.json b/.github/workflows/assets/App/projectsToCheck.json index dea169f2..91bcdb8e 100644 --- a/.github/workflows/assets/App/projectsToCheck.json +++ b/.github/workflows/assets/App/projectsToCheck.json @@ -1 +1 @@ -["./src/NuGetUtility/NuGetUtility.csproj"] +["./src/NuGetLicenseCore/NuGetLicenseCore.csproj","./src/NuGetLicenseFramework/NuGetLicenseFramework.csproj"] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 79502da5..9738b81c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,27 +48,27 @@ jobs: id: artifacts_path shell: pwsh run: | - New-Item -ItemType "directory" -Path "./artifacts" - $path = Resolve-Path ./artifacts - echo "::set-output name=path::$path" + $path = [System.IO.Path]::GetFullPath("./artifacts"); + echo "publish to path: $path" + echo "path=$path" >> $env:GITHUB_OUTPUT - name: Publish the application binaries (.net6) - run: msbuild ./src/NuGetUtility/NuGetUtility.csproj /t:Publish /p:configuration=Release /p:OutDir=${{ steps.artifacts_path.path}}/net6 /p:TargetFramework=net6.0 /p:Version=${{ steps.version.outputs.full_without_prefix }} + run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net6 -f net6.0 -p:Version=${{ steps.version.outputs.full_without_prefix }} - name: Publish the application binaries (.net7) - run: msbuild ./src/NuGetUtility/NuGetUtility.csproj /t:Publish /p:configuration=Release /p:OutDir=${{ steps.artifacts_path.path}}/net7 /p:TargetFramework=net7.0 /p:Version=${{ steps.version.outputs.full_without_prefix }} + run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net7 -f net7.0 -p:Version=${{ steps.version.outputs.full_without_prefix }} - name: Publish the application binaries (.net8) - run: msbuild ./src/NuGetUtility/NuGetUtility.csproj /t:Publish /p:configuration=Release /p:OutDir=${{ steps.artifacts_path.path}}/net8 /p:TargetFramework=net8.0 /p:Version=${{ steps.version.outputs.full_without_prefix }} + run: dotnet publish ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-restore -o ${{ steps.artifacts_path.outputs.path }}/net8 -f net8.0 -p:Version=${{ steps.version.outputs.full_without_prefix }} - name: Publish the application binaries (.net472) - run: msbuild ./src/NuGetUtility/NuGetUtility.csproj /t:Publish /p:configuration=Release /p:OutDir=${{ steps.artifacts_path.path}}/net472 /p:TargetFramework=net472 /p:Version=${{ steps.version.outputs.full_without_prefix }} + run: msbuild ./src/NuGetLicenseFramework/NuGetLicenseFramework.csproj /t:Publish /p:configuration=Release /p:PublishDir=${{ steps.artifacts_path.outputs.path }}/net472 /p:Version=${{ steps.version.outputs.full_without_prefix }} - name: Create nuget package - run: msbuild ./src/NuGetUtility/NuGetUtility.csproj /t:Pack /p:configuration=Release /p:OutDir=${{ steps.artifacts_path.path}} /p:Version=${{ steps.version.outputs.full_without_prefix }} - + run: dotnet pack ./src/NuGetLicenseCore/NuGetLicenseCore.csproj -c Release --no-build -o ${{ steps.artifacts_path.outputs.path }} -p:Version=${{ steps.version.outputs.full_without_prefix }} + - name: Zip artifacts uses: thedoctor0/zip-release@0.7.6 with: type: 'zip' filename: 'release.zip' - path: ${{ steps.artifacts_path.path}} + path: ${{ steps.artifacts_path.outputs.path }} - name: Release uses: softprops/action-gh-release@v1 @@ -81,4 +81,4 @@ jobs: - name: publish nuget package to nuget.org id: publish_nuget - run: dotnet nuget push ${{ steps.artifacts_path.path}}/*.nupkg -s 'https://api.nuget.org/v3/index.json' -k ${{secrets.NUGET_KEY}} --skip-duplicate + run: dotnet nuget push ${{ steps.artifacts_path.outputs.path }}/*.nupkg -s 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGET_KEY }} --skip-duplicate diff --git a/NuGetUtility.sln b/NuGetUtility.sln index 074624cb..910955a0 100644 --- a/NuGetUtility.sln +++ b/NuGetUtility.sln @@ -31,6 +31,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleCppProject", "tests\targets\SimpleCppProject\SimpleCppProject.vcxproj", "{380FBD90-2CF0-4F83-A58E-EB98CE2EAE15}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetLicenseCore", "src\NuGetLicenseCore\NuGetLicenseCore.csproj", "{FBA6622A-C9E3-4250-AB79-35F02CAD2419}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetLicenseFramework", "src\NuGetLicenseFramework\NuGetLicenseFramework.csproj", "{DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -184,6 +188,42 @@ Global {380FBD90-2CF0-4F83-A58E-EB98CE2EAE15}.TestWindows|x64.Build.0 = Debug|x64 {380FBD90-2CF0-4F83-A58E-EB98CE2EAE15}.TestWindows|x86.ActiveCfg = Debug|Win32 {380FBD90-2CF0-4F83-A58E-EB98CE2EAE15}.TestWindows|x86.Build.0 = Debug|Win32 + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Debug|x64.ActiveCfg = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Debug|x64.Build.0 = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Debug|x86.ActiveCfg = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Debug|x86.Build.0 = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Release|Any CPU.Build.0 = Release|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Release|x64.ActiveCfg = Release|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Release|x64.Build.0 = Release|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Release|x86.ActiveCfg = Release|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.Release|x86.Build.0 = Release|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|Any CPU.ActiveCfg = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|Any CPU.Build.0 = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|x64.ActiveCfg = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|x64.Build.0 = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|x86.ActiveCfg = Debug|Any CPU + {FBA6622A-C9E3-4250-AB79-35F02CAD2419}.TestWindows|x86.Build.0 = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Debug|x64.ActiveCfg = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Debug|x64.Build.0 = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Debug|x86.ActiveCfg = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Debug|x86.Build.0 = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Release|Any CPU.Build.0 = Release|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Release|x64.ActiveCfg = Release|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Release|x64.Build.0 = Release|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Release|x86.ActiveCfg = Release|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.Release|x86.Build.0 = Release|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|Any CPU.ActiveCfg = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|Any CPU.Build.0 = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|x64.ActiveCfg = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|x64.Build.0 = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|x86.ActiveCfg = Debug|Any CPU + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F}.TestWindows|x86.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -198,6 +238,8 @@ Global {3DDEC6CB-4FDA-49D1-A358-06BE9200C174} = {FA92392F-D895-4D1E-A5ED-E6DC3C08223E} {3150479E-4370-408D-8A93-7C0CDC281CC3} = {FA92392F-D895-4D1E-A5ED-E6DC3C08223E} {380FBD90-2CF0-4F83-A58E-EB98CE2EAE15} = {FA92392F-D895-4D1E-A5ED-E6DC3C08223E} + {FBA6622A-C9E3-4250-AB79-35F02CAD2419} = {D2AB2D00-1F48-487D-BFE0-99FDB4E071CC} + {DE079B9C-B6BA-4D53-8B83-03D3CBD4027F} = {D2AB2D00-1F48-487D-BFE0-99FDB4E071CC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {70887D40-0182-4C32-BFA1-B5A02E405F11} diff --git a/src/NuGetLicenseCore/NuGetLicenseCore.csproj b/src/NuGetLicenseCore/NuGetLicenseCore.csproj new file mode 100644 index 00000000..fcacf09c --- /dev/null +++ b/src/NuGetLicenseCore/NuGetLicenseCore.csproj @@ -0,0 +1,40 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks> + <IsPackable>true</IsPackable> + <PackAsTool>true</PackAsTool> + <PackageType>DotnetTool</PackageType> + <RepositoryType>git</RepositoryType> + <Version>100.100.100</Version> + <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> + <PackageId>nuget-license</PackageId> + <ToolCommandName>nuget-license</ToolCommandName> + <Authors>Tom Chavakis,Simon Ensslen</Authors> + <Company>-</Company> + <Title>.NET Tool to print and validate the licenses of dotnet project(s)</Title> + <PackageProjectUrl>https://github.com/sensslen/nuget-license</PackageProjectUrl> + <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> + <GeneratePackageOnBuild Condition="'$(GeneratePackageOnBuild)' == ''">false</GeneratePackageOnBuild> + <ProduceReferenceAssembly>false</ProduceReferenceAssembly> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + <Configurations>Debug;Release;TestWindows</Configurations> + <Platforms>AnyCPU</Platforms> + <PackageReadmeFile>README.md</PackageReadmeFile> + <Description>A .net tool to print and validate the licenses of .net code. This tool supports .NET (Core), .NET Standard and .NET Framework projects.</Description> + </PropertyGroup> + + <ItemGroup> + <Content Include="..\..\README.md"> + <Pack>true</Pack> + <PackagePath>README.md</PackagePath> + </Content> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\NuGetUtility\NuGetUtility.csproj" /> + </ItemGroup> + +</Project> diff --git a/src/NuGetLicenseCore/Program.cs b/src/NuGetLicenseCore/Program.cs new file mode 100644 index 00000000..853588ff --- /dev/null +++ b/src/NuGetLicenseCore/Program.cs @@ -0,0 +1,18 @@ +// Licensed to the projects contributors. +// The license conditions are provided in the LICENSE file located in the project root + +using McMaster.Extensions.CommandLineUtils; +using NuGetUtility; + +namespace NuGetLicenseCore +{ + public static class Program + { + public static async Task Main(string[] args) + { + var lifetime = new AppLifetime(); + int returnCode = await CommandLineApplication.ExecuteAsync<NuGetUtility.Program>(args, lifetime.Token); + lifetime.Done(returnCode); + } + } +} diff --git a/src/NuGetLicenseFramework/NuGetLicenseFramework.csproj b/src/NuGetLicenseFramework/NuGetLicenseFramework.csproj new file mode 100644 index 00000000..b43b6c58 --- /dev/null +++ b/src/NuGetLicenseFramework/NuGetLicenseFramework.csproj @@ -0,0 +1,36 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net472</TargetFramework> + <RepositoryType>git</RepositoryType> + <Version>100.100.100</Version> + <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> + <PackageId>nuget-license</PackageId> + <ToolCommandName>nuget-license</ToolCommandName> + <Authors>Tom Chavakis,Simon Ensslen</Authors> + <Company>-</Company> + <Title>.NET Tool to print and validate the licenses of dotnet project(s)</Title> + <PackageProjectUrl>https://github.com/sensslen/nuget-license</PackageProjectUrl> + <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> + <ProduceReferenceAssembly>false</ProduceReferenceAssembly> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + <Configurations>Debug;Release;TestWindows</Configurations> + <Platforms>AnyCPU</Platforms> + <Description>A .net tool to print and validate the licenses of .net code. This tool supports .NET (Core), .NET Standard and .NET Framework projects.</Description> + <LangVersion>10.0</LangVersion> + </PropertyGroup> + + <ItemGroup> + <Content Include="..\..\README.md"> + <Pack>true</Pack> + <PackagePath>README.md</PackagePath> + </Content> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\NuGetUtility\NuGetUtility.csproj" /> + </ItemGroup> + +</Project> diff --git a/src/NuGetLicenseFramework/Program.cs b/src/NuGetLicenseFramework/Program.cs new file mode 100644 index 00000000..e03eb2f7 --- /dev/null +++ b/src/NuGetLicenseFramework/Program.cs @@ -0,0 +1,18 @@ +// Licensed to the projects contributors. +// The license conditions are provided in the LICENSE file located in the project root + +using McMaster.Extensions.CommandLineUtils; +using NuGetUtility; + +namespace NuGetLicenseFramework +{ + public static class Program + { + public static async Task Main(string[] args) + { + var lifetime = new AppLifetime(); + int returnCode = await CommandLineApplication.ExecuteAsync<NuGetUtility.Program>(args, lifetime.Token); + lifetime.Done(returnCode); + } + } +} diff --git a/src/NuGetUtility/AppLifetime.cs b/src/NuGetUtility/AppLifetime.cs index b1cd8e32..72d02d55 100644 --- a/src/NuGetUtility/AppLifetime.cs +++ b/src/NuGetUtility/AppLifetime.cs @@ -6,7 +6,7 @@ namespace NuGetUtility /// <summary> /// Inspired by: https://github.com/dotnet/aspnetcore/search?q=WebHostLifetime /// </summary> - internal class AppLifetime + public class AppLifetime { private readonly CancellationTokenSource _cts = new CancellationTokenSource(); private readonly ManualResetEventSlim _doneEvent = new ManualResetEventSlim(); diff --git a/src/NuGetUtility/NuGetUtility.csproj b/src/NuGetUtility/NuGetUtility.csproj index a7666c1e..3e01510e 100644 --- a/src/NuGetUtility/NuGetUtility.csproj +++ b/src/NuGetUtility/NuGetUtility.csproj @@ -1,29 +1,23 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <OutputType>Exe</OutputType> <TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks> - <IsPackable>true</IsPackable> - <PackAsTool>true</PackAsTool> - <PackageType>DotnetTool</PackageType> <RepositoryType>git</RepositoryType> <Version>100.100.100</Version> <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> - <PackageId>nuget-license</PackageId> - <ToolCommandName>nuget-license</ToolCommandName> + <PackageId>nuget-license-core</PackageId> <Authors>Tom Chavakis,Simon Ensslen</Authors> <Company>-</Company> - <Title>.NET Core Tool to print and validate the licenses of dotnet project(s)</Title> + <Title>.NET Tool to print and validate the licenses of dotnet project(s)</Title> <PackageProjectUrl>https://github.com/sensslen/nuget-license</PackageProjectUrl> <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> - <GeneratePackageOnBuild Condition="'$(GeneratePackageOnBuild)' == ''">false</GeneratePackageOnBuild> <ProduceReferenceAssembly>false</ProduceReferenceAssembly> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <Configurations>Debug;Release;TestWindows</Configurations> <Platforms>AnyCPU</Platforms> <PackageReadmeFile>README.md</PackageReadmeFile> - <Description>A .net core tool to print and validate the licenses of .net code. This tool supports .NET (Core), .NET Standard and .NET Framework projects.</Description> + <Description>A .net tool to print and validate the licenses of .net code. This tool supports .NET (Core), .NET Standard and .NET Framework projects.</Description> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net472' "> diff --git a/src/NuGetUtility/Program.cs b/src/NuGetUtility/Program.cs index 22a2b247..80128f0f 100644 --- a/src/NuGetUtility/Program.cs +++ b/src/NuGetUtility/Program.cs @@ -90,13 +90,6 @@ public class Program private static string GetVersion() => typeof(Program).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? string.Empty; - public static async Task Main(string[] args) - { - var lifetime = new AppLifetime(); - int returnCode = await CommandLineApplication.ExecuteAsync<Program>(args, lifetime.Token); - lifetime.Done(returnCode); - } - private async Task<int> OnExecuteAsync(CancellationToken cancellationToken) { using var httpClient = new HttpClient(); @@ -161,6 +154,7 @@ private static IAsyncEnumerable<ReferencedPackageWithContext> GetPackageInformat IEnumerable<CustomPackageInformation> overridePackageInformation, CancellationToken cancellation) { + Console.WriteLine($"get package information for {projectWithReferences}"); ISettings settings = Settings.LoadDefaultSettings(projectWithReferences.Project); var sourceProvider = new PackageSourceProvider(settings);