Skip to content

Commit

Permalink
Bump NoTargets SDK in tests and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed Feb 25, 2023
1 parent 38c07d6 commit b6d8405
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 23 deletions.
8 changes: 3 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -447,11 +447,9 @@ You can also add a reference to a CLI *tools* program like the following:
<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>
```
Expand Down
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>
Expand Down
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>
Expand Down
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
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
18 changes: 9 additions & 9 deletions src/NuGetizer.Tests/given_a_packaging_project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
7 changes: 3 additions & 4 deletions src/NuGetizer.Tests/given_a_tool_project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class given_a_tool_project
public void when_pack_as_tool_then_packs_no_dependencies()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>MyTool</PackageId>
<TargetFramework>net6.0</TargetFramework>
Expand Down Expand Up @@ -67,7 +67,7 @@ public void when_pack_as_tool_then_packs_dotnet_tool_runtime_assets()
public void when_pack_folder_tool_but_no_pack_as_tool_then_packs_dependencies_normally()
{
var result = Builder.BuildProject(@"
<Project Sdk='Microsoft.Build.NoTargets/3.5.0'>
<Project Sdk='Microsoft.Build.NoTargets/3.7.0'>
<PropertyGroup>
<PackageId>MyTool</PackageId>
<TargetFramework>net6.0</TargetFramework>
Expand All @@ -94,9 +94,8 @@ public void when_pack_folder_tool_no_pack_as_tool_and_executable_then_packs_as_p
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<PackageId>MyTool</PackageId>
<TargetFramework>net6.0</TargetFramework>
<PackageId>MyTool</PackageId>
<PackageId>MyTool</PackageId>
<PackFolder>tools</PackFolder>
</PropertyGroup>
<ItemGroup>
Expand Down

0 comments on commit b6d8405

Please sign in to comment.