Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: devlooped/nugetizer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.9.4
Choose a base ref
...
head repository: devlooped/nugetizer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.9.5
Choose a head ref
  • 9 commits
  • 14 files changed
  • 3 contributors

Commits on Feb 23, 2023

  1. Copy the full SHA
    3aa66fc View commit details
  2. Bump Devlooped.SponsorLink from 0.9.6 to 0.9.7

    Bumps [Devlooped.SponsorLink](https://github.com/devlooped/SponsorLink) from 0.9.6 to 0.9.7.
    - [Release notes](https://github.com/devlooped/SponsorLink/releases)
    - [Changelog](https://github.com/devlooped/SponsorLink/blob/main/releases.md)
    - [Commits](https://github.com/devlooped/SponsorLink/commits)
    
    ---
    updated-dependencies:
    - dependency-name: Devlooped.SponsorLink
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and kzu committed Feb 23, 2023
    Copy the full SHA
    66bc31d View commit details
  3. Bump Microsoft.NET.Test.Sdk from 17.4.1 to 17.5.0

    Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.4.1 to 17.5.0.
    - [Release notes](https://github.com/microsoft/vstest/releases)
    - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
    - [Commits](microsoft/vstest@v17.4.1...v17.5.0)
    
    ---
    updated-dependencies:
    - dependency-name: Microsoft.NET.Test.Sdk
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and kzu committed Feb 23, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e08ac1c View commit details

Commits on Feb 24, 2023

  1. Allow extending the build with local-only targets

    These are always ignored and can therefore be tweaked without fear of inadvertently checking them in.
    kzu committed Feb 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f821aee View commit details
  2. Render nuspec as a relative path to the nugetize output

    This makes it easier to take screenshots without revealing full local paths, while still preserving the click-ability of those file links if the terminal supports it.
    kzu committed Feb 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ed1106f View commit details
  3. Ensure transitive dependencies are properly resolved for inference

    .NET 7.0 SDK changed from:
    
    ```xml
        <ResolvePackageDependencies
          ProjectPath="$(MSBuildProjectFullPath)"
          ProjectAssetsFile="$(ProjectAssetsFile)"
          ProjectLanguage="$(Language)"
          EmitLegacyAssetsFileItems="$(EmitLegacyAssetsFileItems)"
          TargetFramework="$(TargetFramework)"
          ContinueOnError="ErrorAndContinue">
    
          <Output TaskParameter="PackageDefinitions" ItemName="PackageDefinitions" />
          <Output TaskParameter="PackageDependencies" ItemName="PackageDependencies" />
    
          <!-- These outputs only produced when EmitLegacyAssetsFileItems is true -->
          <Output TaskParameter="TargetDefinitions" ItemName="TargetDefinitions" />
          <Output TaskParameter="FileDefinitions" ItemName="FileDefinitions" />
          <Output TaskParameter="FileDependencies" ItemName="FileDependencies" />
        </ResolvePackageDependencies>
    ```
    
    to:
    
    ```xml
        <ResolvePackageDependencies
          ProjectPath="$(MSBuildProjectFullPath)"
          ProjectAssetsFile="$(ProjectAssetsFile)"
          ProjectLanguage="$(Language)"
          TargetFramework="$(TargetFramework)"
          ContinueOnError="ErrorAndContinue"
          Condition="'$(EmitLegacyAssetsFileItems)' == 'true'">
    
          <Output TaskParameter="PackageDefinitions" ItemName="PackageDefinitions" />
          <Output TaskParameter="PackageDependencies" ItemName="PackageDependencies" />
          <Output TaskParameter="TargetDefinitions" ItemName="TargetDefinitions" />
          <Output TaskParameter="FileDefinitions" ItemName="FileDefinitions" />
          <Output TaskParameter="FileDependencies" ItemName="FileDependencies" />
        </ResolvePackageDependencies>
    ```
    
    Since the SDK now conditions the execution of the resolve to the value of `EmitLegacyAssetsFileItems`, we need to explicitly set it.
    
    Since this was likely done for performance reasons, only turn on when package inference is active, since we don't use that anywhere else.
    kzu committed Feb 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2ca40f3 View commit details

Commits on Feb 25, 2023

  1. Bump Microsoft.TestPlatform.ObjectModel from 17.4.1 to 17.5.0

    Bumps [Microsoft.TestPlatform.ObjectModel](https://github.com/microsoft/vstest) from 17.4.1 to 17.5.0.
    - [Release notes](https://github.com/microsoft/vstest/releases)
    - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
    - [Commits](microsoft/vstest@v17.4.1...v17.5.0)
    
    ---
    updated-dependencies:
    - dependency-name: Microsoft.TestPlatform.ObjectModel
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and kzu committed Feb 25, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6cd5a24 View commit details
  2. Pack console apps using publish output by default

    We have an SDK-compatible mechanism for packing .NET tools: PackAsTool. This satisfies a very specific scenario for .NET tools, but doesn't work for regular CLI tools that don't need packing as standalone dotnet tools.
    
    For these CLI tools, packing the output of Publish makes much more sense, and results in way fewer customizations in package references.
    
    We introduce a new property, PackAsPublish, which is initialized to `true` whenever the project is publishable and a cross-platform executable (pending widening the definition upon feedback). In this case, we don't infer content from package dependencies and references with copy local and so on, but rather rely exclusively on Publish doing its work. We don't change the PackFolder treatment, so that property is orthogonal to PackAsPublish, although it's likely `tools` will be the most commonly used folder.
    
    The property's default `true` value is calculated dynamically in an initial target since we need to inspect `ProjectCapability` which is set by the SDK to include `CrossPlatformExecutable`. This is the more extensible approach, rather than checking the output type ourselves.
    kzu committed Feb 25, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    38c07d6 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b6d8405 View commit details
16 changes: 16 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [v0.9.4](https://github.com/devlooped/nugetizer/tree/v0.9.4) (2023-02-22)

[Full Changelog](https://github.com/devlooped/nugetizer/compare/v0.9.3...v0.9.4)

:sparkles: Implemented enhancements:

- Change nugetize default to non-verbose [\#313](https://github.com/devlooped/nugetizer/pull/313) (@kzu)
- Add SponsorLink to the nugetize CLI [\#309](https://github.com/devlooped/nugetizer/pull/309) (@kzu)
- Improve package rendering in dotnet-nugetize [\#307](https://github.com/devlooped/nugetizer/pull/307) (@kzu)
- Improve the handling of platform-suffixed target frameworks [\#306](https://github.com/devlooped/nugetizer/pull/306) (@kzu)

:twisted_rightwards_arrows: Merged:

- Devcontainer and docs experimentation [\#314](https://github.com/devlooped/nugetizer/pull/314) (@kzu)
- ⛙ ⬆️ Bump dependencies [\#311](https://github.com/devlooped/nugetizer/pull/311) (@github-actions[bot])

## [v0.9.3](https://github.com/devlooped/nugetizer/tree/v0.9.3) (2023-02-18)

[Full Changelog](https://github.com/devlooped/nugetizer/compare/v0.9.2...v0.9.3)
23 changes: 18 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -366,7 +366,7 @@ which has built-in support in Visual Studio. It can use the `Microsoft.Build.NoT

```xml
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.Build.NoTargets/3.5.0">
<Project Sdk="Microsoft.Build.NoTargets/3.7.0">
<PropertyGroup>
<PackageId>MyPackage</PackageId>
<TargetFramework>netstandard2.0</TargetFramework>
@@ -400,7 +400,7 @@ it's automatically imported in consuming projects.
The packaging project would now look as follows:

```xml
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>MyPackage</PackageId>
@@ -445,12 +445,11 @@ You can also add a reference to a CLI *tools* program like the following:
<Project Sdk='Microsoft.NET.Sdk'>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Exe</OutputType>
<PackFolder>tools</PackFolder>
<!-- We don't need this particular tool in a framework-specific subfolder under /tools -->
<BuildOutputFrameworkSpecific>false</BuildOutputFrameworkSpecific>
</PropertyGroup>
<ItemGroup>
<PackageReference Include='System.CommandLine' Version='2.0.0-beta3.22114.1' PrivateAssets='all' />
<PackageReference Include='System.CommandLine' Version='2.0.0-beta3.22114.1' />
</ItemGroup>
</Project>
```
@@ -465,6 +464,20 @@ content inference.
This section contains miscellaneous useful features that are typically used in advanced scenarios and
are not necessarily mainstream.

### PackAsPublish for CLI tools

When a project's output type is `Exe` and it's not set to `PackAsTool=true` (used specifically for .NET tools),
it will default to be use the `Publish` output for packing. This is typically what you want for a CLI
project, since dependencies are included in the publish directory automatically without having to annotate
any references with `PrivateAssets=all`.

This can be turned off by setting `PackAsPublish=false` on the project, which will cause the project
to be packed as a regular class library, with the dependencies inference rules applied (such as
`PrivateAssets=all` for package reference and `CopyLocal=true` for references).

When packing as publish, the output won't be framework-specific by default, and will just contribute
the published contents to the specified `PackFolder`.

### Dynamically Extending Package Contents

If you need to calculate additional items to inject into the package dynamically, you can run a target
2 changes: 1 addition & 1 deletion src/CodeAnalysis/CodeAnalysis.csproj
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" Visible="false" />
<PackageReference Include="ThisAssembly.AssemblyInfo" Version="1.2.9" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" Pack="false" />
<PackageReference Include="Devlooped.SponsorLink" Version="0.9.6" PackInclude="build,analyzers" PackExclude="compile,native,runtime" />
<PackageReference Include="Devlooped.SponsorLink" Version="0.9.7" PackInclude="build,analyzers" PackExclude="compile,native,runtime" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Directory.props
Original file line number Diff line number Diff line change
@@ -21,5 +21,6 @@
<Target Name="Test" />

<Import Project="NuGetizer.Tasks\NuGetizer.props" Condition="'$(NuGetize)' == 'true'" />
<Import Project="Directory.props.user" Condition="Exists('Directory.props.user')" />

</Project>
2 changes: 2 additions & 0 deletions src/Directory.targets
Original file line number Diff line number Diff line change
@@ -13,4 +13,6 @@
<PackFolderKindFile>$(IntermediateOutputPath)PackFolderKind.g$(DefaultLanguageSourceExtension)</PackFolderKindFile>
</PropertyGroup>

<Import Project="Directory.targets.user" Condition="Exists('Directory.targets.user')" />

</Project>
44 changes: 41 additions & 3 deletions src/NuGetizer.Tasks/NuGetizer.Inference.targets
Original file line number Diff line number Diff line change
@@ -39,6 +39,9 @@ Copyright (c) .NET Foundation. All rights reserved.

<_OutputFullPath Condition="$([System.IO.Path]::IsPathRooted($(OutputPath)))">$(OutputPath)</_OutputFullPath>
<_OutputFullPath Condition="'$(_OutputFullPath)' == ''">$(MSBuildProjectDirectory.TrimEnd('\'))\$(OutputPath)</_OutputFullPath>

<!-- Ensure built-in RunResolvePackageDependencies target emits stuff we need for inference of transitive dependencies -->
<EmitLegacyAssetsFileItems>true</EmitLegacyAssetsFileItems>
</PropertyGroup>

<PropertyGroup Label="Package Readme" Condition="'$(PackReadme)' == 'true' and '$(IsPackable)' == 'true'">
@@ -245,6 +248,7 @@ Copyright (c) .NET Foundation. All rights reserved.
</Target>

<Target Name="InferPackageContents" DependsOnTargets="$(InferPackageContentsDependsOn);_CollectInferenceCandidates" Returns="@(PackageFile)">
<Error Code="NG1004" Condition="'$(PackAsTool)' == 'true' and '$(PackAsPublish)' == 'true'" Text="PackAsTool and PackAsPublish are mutually exclusive." />

<!-- Even if all these conditions are false, the user can still explicitly pack the file, of course -->
<ItemGroup Label="Readme" Condition="'$(PackReadme)' == 'true' and '$(PackageReadmeFile)' != '' and '$(IsPackable)' == 'true'">
@@ -291,7 +295,7 @@ Copyright (c) .NET Foundation. All rights reserved.
'%(_InferenceCandidateWithTargetPath.CopyToOutputDirectory)' == 'Never'" />
</ItemGroup>

<ItemGroup Label="BuildOutput Inference" Condition="'$(PackBuildOutput)' == 'true'">
<ItemGroup Label="BuildOutput Inference" Condition="'$(PackBuildOutput)' == 'true' and '$(PackAsPublish)' != 'true'">
<!-- Unfortunately, even with https://github.com/Microsoft/msbuild/pull/1115, when multi-targeting
.NETFramework, the desktop WinFX.targets are imported which don't have the fix, so we need to
do it "the old way" for this particular output group -->
@@ -315,9 +319,20 @@ Copyright (c) .NET Foundation. All rights reserved.
<_InferredPackageFile Include="@(_InferredProjectOutput -> Distinct())" />
</ItemGroup>

<ItemGroup Label="Publishable Inference" Condition="'$(PackAsPublish)' == 'true' and '$(PackAsTool)' != 'true'">
<_InferredPublishItem Include="@(PublishItemsOutputGroupOutputs -> '%(OutputPath)')" />
<_InferredPackageFile Include="@(_InferredPublishItem -> '%(FullPath)')">
<PackFolder>$(PackFolder)</PackFolder>
<FrameworkSpecific>false</FrameworkSpecific>
<!-- NOTE: we don't set `BuildOutputFrameworkSpecific` since we're not packing the build output
but rather the *publish* output. Users could change that by setting a TF-specific PackFolder -->
</_InferredPackageFile>
</ItemGroup>

<ItemGroup Label="References Inference">
<_InferredPackageFile Include="@(PackageReference)"
Condition="'$(PackAsTool)' != 'true' and
'$(PackAsPublish)' != 'true' and
'%(PackageReference.Identity)' != 'NuGetizer' and
'%(PackageReference.Identity)' != 'NETStandard.Library' and
'%(PackageReference.PrivateAssets)' != 'all' and
@@ -331,6 +346,7 @@ Copyright (c) .NET Foundation. All rights reserved.
TBD: maybe include ResolvedFrom=ImplicitlyExpandDesignTimeFacades too? -->
<_InferredPackageFile Include="@(ReferencePath->'%(OriginalItemSpec)')"
Condition="'$(PackAsTool)' != 'true' and
'$(PackAsPublish)' != 'true' and
'$(PackFrameworkReferences)' == 'true' and
'%(ReferencePath.ResolvedFrom)' == '{TargetFrameworkDirectory}' and
'%(ReferencePath.Pack)' != 'false'">
@@ -382,7 +398,9 @@ Copyright (c) .NET Foundation. All rights reserved.

</Target>

<Target Name="_CollectPrimaryOutputDependencies" DependsOnTargets="ReferenceCopyLocalPathsOutputGroup;RunResolvePackageDependencies" Returns="@(ImplicitPackageReference)">
<Target Name="_CollectPrimaryOutputDependencies"
DependsOnTargets="ReferenceCopyLocalPathsOutputGroup;RunResolvePackageDependencies"
Returns="@(ImplicitPackageReference)">
<Error Code="NG1003" Text="Centrally managed package versions is only supported when using the Microsoft.NET.Sdk."
Condition="'$(ManagePackageVersionsCentrally)' == 'true' and '$(UsingMicrosoftNETSdk)' != 'true'" />
<ItemGroup>
@@ -413,6 +431,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<Target Name="_ResolvePackageDependencies" Condition="'$(UsingMicrosoftNETSdk)' == 'true'" DependsOnTargets="RunResolvePackageDependencies" />

<Target Name="InferPrimaryOutputDependencies"
Condition="'$(PackAsTool)' != 'true' and '$(PackAsPublish)' != 'true'"
Inputs="@(_PrimaryOutputRelatedFile)"
Outputs="%(_PrimaryOutputRelatedFile.NuGetPackageId)"
Returns="@(_InferredPackageFile)"
@@ -467,7 +486,7 @@ Copyright (c) .NET Foundation. All rights reserved.
</ItemGroup>
</Target>

<Target Name="_SetInferPackageContentsDependsOn" AfterTargets="_SetPropertiesFromCapabilities">
<Target Name="_SetInferenceProperties" AfterTargets="_SetPropertiesFromCapabilities">
<PropertyGroup>
<!-- NOTE: this avoids taking dependencies on targets that are only available when the project supports the concept of references -->
<_SupportsReferences Condition="
@@ -497,7 +516,26 @@ Copyright (c) .NET Foundation. All rights reserved.
$(InferPackageContentsDependsOn);
AllProjectOutputGroups
</InferPackageContentsDependsOn>

<!-- Smarter inference for publishable console apps
* PackAsTool should still do what SDK Pack does.
* PackAsPublish=false turns off this inference.
* IsPublishable is set by the SDK, but for everything, even libs :(,
but we can use that as an alternative off switch too.
* Finally, the CrossPlatformExecutable capability is set by the SDK for
.NETCoreApp projects that are actually executable (Exe or WinExe)
-->
<PackAsPublish Condition="'$(PackAsPublish)' == '' and
'$(PackAsTool)' != 'true' and
'$(IsPublishable)' == 'true' and
$(_AllProjectCapabilities.Contains('CrossPlatformExecutable'))">true</PackAsPublish>

<InferPackageContentsDependsOn Condition="'$(PackAsPublish)' == 'true'">
$(InferPackageContentsDependsOn);
PublishItemsOutputGroup
</InferPackageContentsDependsOn>
</PropertyGroup>

</Target>

</Project>
26 changes: 26 additions & 0 deletions src/NuGetizer.Tests/InlineProjectTests.cs
Original file line number Diff line number Diff line change
@@ -774,5 +774,31 @@ public void when_packing_dependencies_then_can_include_exclude_assets()
ExcludeAssets = "build"
}));
}

[Fact]
public void when_private_assets_then_packs_transitively()
{
var result = Builder.BuildProject(
"""
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>true</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" PrivateAssets="all" />
</ItemGroup>
</Project>
""", output: output);

result.AssertSuccess(output);

Assert.Contains(result.Items, item => item.Matches(new
{
NuGetPackageId = "Microsoft.Extensions.Configuration.Abstractions",
PackFolder = "Lib",
}));
}
}
}
4 changes: 2 additions & 2 deletions src/NuGetizer.Tests/NuGetizer.Tests.csproj
Original file line number Diff line number Diff line change
@@ -21,8 +21,8 @@
<PackageReference Include="System.IO.Compression.ZipFile" Version="4.3.0" />
<PackageReference Include="NuGet.Packaging" Version="6.3.0" />
<PackageReference Include="NuGet.ProjectManagement" Version="4.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.console" Version="2.4.2" />
<PackageReference Include="xunit.runner.msbuild" Version="2.4.2" />
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Build.NoTargets/3.5.0">
<Project Sdk="Microsoft.Build.NoTargets/3.7.0">
<Import Project="$([MSBuild]::GetPathOfFileAbove(Scenario.props, $(MSBuildThisFileDirectory)))" />
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Build.NoTargets/3.5.0">
<Project Sdk="Microsoft.Build.NoTargets/3.7.0">
<Import Project="$([MSBuild]::GetPathOfFileAbove(Scenario.props, $(MSBuildThisFileDirectory)))" />

<PropertyGroup>
6 changes: 3 additions & 3 deletions src/NuGetizer.Tests/given_a_notargets_sdk_project.cs
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ public void cam_reference_packaging_project()
var result = Builder.BuildProjects(
"GetPackageContents", output, null,
("main.msbuildproj", @"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Foo</PackageId>
<TargetFramework>netstandard2.0</TargetFramework>
@@ -26,7 +26,7 @@ public void cam_reference_packaging_project()
</ItemGroup>
</Project>"),
("other.msbuildproj", @"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Bar</PackageId>
<TargetFramework>netstandard2.0</TargetFramework>
@@ -76,7 +76,7 @@ public void cam_be_referenced()
</ItemGroup>
</Project>"),
("other.msbuildproj", @"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Bar</PackageId>
<TargetFramework>netstandard2.0</TargetFramework>
18 changes: 9 additions & 9 deletions src/NuGetizer.Tests/given_a_packaging_project.cs
Original file line number Diff line number Diff line change
@@ -177,7 +177,7 @@ public void when_packing_then_succeeeds()
public void when_framework_specific_then_retargets_direct_and_referenced_content()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Packer</PackageId>
<TargetFramework>net6.0</TargetFramework>
@@ -221,7 +221,7 @@ specifying PackFolder and FrameworkSpecific to match the project's. -->
public void when_referenced_project_has_packfolder_then_preserves_it()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Packer</PackageId>
<TargetFramework>net6.0</TargetFramework>
@@ -266,7 +266,7 @@ public void when_referenced_project_has_packfolder_then_preserves_it()
public void when_project_reference_packfolder_additional_properties_then_overrides_project_pack_folder()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Packer</PackageId>
<TargetFramework>net6.0</TargetFramework>
@@ -295,7 +295,7 @@ public void when_project_reference_packfolder_additional_properties_then_overrid
public void when_project_reference_packfolder_then_overrides_project_pack_folder()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Packer</PackageId>
<TargetFramework>net6.0</TargetFramework>
@@ -324,7 +324,7 @@ public void when_project_reference_packfolder_then_overrides_project_pack_folder
public void when_pack_folder_build_then_none_packs_as_build()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Packer</PackageId>
<TargetFramework>net6.0</TargetFramework>
@@ -347,7 +347,7 @@ public void when_pack_folder_build_then_none_packs_as_build()
public void when_readme_found_but_pack_readme_false_then_does_not_add_it()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Packer</PackageId>
<TargetFramework>net6.0</TargetFramework>
@@ -379,7 +379,7 @@ public void when_readme_found_but_pack_readme_false_then_does_not_add_it()
public void when_readme_found_but_project_not_packable_then_does_not_add_content()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFramework>net6.0</TargetFramework>
@@ -410,7 +410,7 @@ public void when_readme_found_but_project_not_packable_then_does_not_add_content
public void when_readme_found_then_adds_metadata_and_content()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Packer</PackageId>
<TargetFramework>net6.0</TargetFramework>
@@ -441,7 +441,7 @@ public void when_readme_found_then_adds_metadata_and_content()
public void when_readme_custom_extension_specified_then_adds_metadata_and_content()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>Packer</PackageId>
<TargetFramework>net6.0</TargetFramework>
Loading