-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28668 from dotnet-maestro-bot/merge/release/7.0.1…
…xx-to-release/7.0.2xx [automated] Merge branch 'release/7.0.1xx' => 'release/7.0.2xx'
- Loading branch information
Showing
9 changed files
with
185 additions
and
16 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
src/Assets/TestProjects/AppWithLibrarySDKStyleThatPublishesSingleFile/Program.cs
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,8 @@ | ||
namespace newc; | ||
|
||
static class Program | ||
{ | ||
static void Main() | ||
{ | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/Assets/TestProjects/AppWithLibrarySDKStyleThatPublishesSingleFile/lib/Class1.cs
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,5 @@ | ||
namespace lib; | ||
public class Class1 | ||
{ | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/Assets/TestProjects/AppWithLibrarySDKStyleThatPublishesSingleFile/lib/lib.csproj
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,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
</PropertyGroup> | ||
|
||
</Project> |
17 changes: 17 additions & 0 deletions
17
src/Assets/TestProjects/AppWithLibrarySDKStyleThatPublishesSingleFile/newc.csproj
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,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net7.0-windows</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<UseWindowsForms>true</UseWindowsForms> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
<RuntimeIdentifier>win-x86</RuntimeIdentifier> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="lib\lib.csproj" /> | ||
</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
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
44 changes: 44 additions & 0 deletions
44
src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileLibrary.cs
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,44 @@ | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System.IO; | ||
using FluentAssertions; | ||
using Microsoft.NET.TestFramework; | ||
using Microsoft.NET.TestFramework.Assertions; | ||
using Microsoft.NET.TestFramework.Commands; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Microsoft.NET.Publish.Tests | ||
{ | ||
public class GivenThatWeWantToPublishASingleFileLibrary : SdkTest | ||
{ | ||
public GivenThatWeWantToPublishASingleFileLibrary(ITestOutputHelper log) : base(log) | ||
{ | ||
} | ||
|
||
[WindowsOnlyFact] | ||
// Tests regression on https://github.com/dotnet/sdk/pull/28484 | ||
public void ItPublishesSuccessfullyWithRIDAndPublishSingleFileLibrary() | ||
{ | ||
var targetFramework = ToolsetInfo.CurrentTargetFramework; | ||
var testAsset = _testAssetsManager | ||
.CopyTestAsset("AppWithLibrarySDKStyleThatPublishesSingleFile") | ||
.WithTargetFramework(targetFramework) | ||
.WithSource(); | ||
|
||
var publishCommand = new PublishCommand(testAsset); | ||
publishCommand.Execute() | ||
.Should() | ||
.Pass(); | ||
|
||
// It would be better if we could somehow check the library binlog or something for a RID instead. | ||
var exeFolder = publishCommand.GetOutputDirectory(targetFramework: targetFramework); | ||
// Parent: RID, then TFM, then Debug, then bin, then the test folder | ||
var ridlessLibraryDllPath = Path.Combine(exeFolder.Parent.Parent.Parent.Parent.FullName, "lib", "bin", "Debug", targetFramework, "lib.dll"); | ||
Assert.True(File.Exists(ridlessLibraryDllPath)); | ||
} | ||
|
||
} | ||
|
||
} |
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