Skip to content

Commit

Permalink
fix: scan non publishable projects (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
37IulianPopovici committed Sep 2, 2024
1 parent 2d9a68e commit 8829268
Show file tree
Hide file tree
Showing 5 changed files with 2,755 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/nuget-parser/cli/dotnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ export async function publish(
// about why we're not using `--output` for this.
args.push(`--property:PublishDir=${tempDir}`);

// Some projects can have <IsPublishable> turned to false, that won't allow `publish` command to generate the binary we
// need for resolution, so we're going to force <IsPublishable> to be true.
// See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish#msbuild
args.push('--p:IsPublishable=true');

// The path that contains either some form of project file, or a .sln one.
// See: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish#arguments
args.push(`"${projectPath}"`);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<IsPublishable>false</IsPublishable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NSubstitute" Version="4.3.0" />
</ItemGroup>
</Project>
Loading

0 comments on commit 8829268

Please sign in to comment.