Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5548480
Return workload manifests in defined, controllable order
dsplaisted Oct 17, 2022
bcaed25
Don't infer rid on non exe project type
nagilson Oct 17, 2022
a80d6b5
Add opt out feature and tests
nagilson Oct 18, 2022
10c3bc5
Update src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Runt…
nagilson Oct 18, 2022
47c024b
Make it a win only fact
nagilson Oct 18, 2022
0f654d6
Merge branch 'nagilson-exe-rids' of https://github.com/nagilson/sdk i…
nagilson Oct 18, 2022
fb14de3
make the test fail in the old scenario
nagilson Oct 18, 2022
d3ed325
Consider that TestProjects May be Exe Projects without Being Tagged a…
nagilson Oct 18, 2022
d97c27e
Update dependencies from https://github.com/dotnet/fsharp build 20221…
dotnet-maestro[bot] Oct 19, 2022
9299986
Update dependencies from https://github.com/microsoft/vstest build 20…
dotnet-maestro[bot] Oct 19, 2022
b256814
Remove opt out feature and put it into UCR
nagilson Oct 19, 2022
d1c8744
Fix tests. Only thing remaining is to improve test quality
nagilson Oct 19, 2022
141ab83
Merge pull request #28655 from dotnet/darc-release/7.0.1xx-a8bfada8-e…
marcpopMSFT Oct 19, 2022
63b3654
Merge pull request #28627 from dsplaisted/workload-manifest-targets-i…
dsplaisted Oct 19, 2022
a00b2cf
Fix whitespace
nagilson Oct 19, 2022
d3173a2
Fix tests
nagilson Oct 19, 2022
6942fe7
Merge pull request #28628 from nagilson/nagilson-exe-rids
nagilson Oct 20, 2022
24f5a85
Merge branch 'release/7.0.1xx' into release/7.0.2xx
Oct 20, 2022
f88e36e
Merge remote-tracking branch 'upstream/release/7.0.2xx' into merge/re…
nagilson Oct 31, 2022
2939b90
Account for changes in 7.0.2xx not in 7.0.1xx
nagilson Oct 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add opt out feature and tests
  • Loading branch information
nagilson committed Oct 18, 2022
commit a80d6b5fa1bca09e9938f1d10120d0c9df94cca4
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace newc;

static class Program
{
static void Main()
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace lib;
public class Class1
{

}
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>
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>
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ Copyright (c) .NET Foundation. All rights reserved.
(
'$(RuntimeIdentifier)' == '' and
'$(RuntimeIdentifiers)' == '' and
'$(OutputType)' == 'Exe' and
'$(_IsExecutable)' == 'true' and
'$(DisableImplicitRuntimeIdentifier)' == '' and
(
'$(SelfContained)' == 'true' or
'$(PublishReadyToRun)' == 'true' or
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// 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 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)
{
}

[Fact]
// Tests regression on https://github.com/dotnet/sdk/pull/28484
public void ItPublishesSuccessfullyWithRIDAndPublishSingleFileLibrary()
{
var testAsset = _testAssetsManager
.CopyTestAsset("AppWithLibrarySDKStyleThatPublishesSingleFile")
.WithSource();

var publishCommand = new PublishCommand(testAsset);
publishCommand.Execute()
.Should()
.Pass();
}

}

}
24 changes: 24 additions & 0 deletions src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,30 @@ public void PublishWithRuntimeIdentifier(bool publishNoBuild)
}
}

[Fact]
public void ImplicitRuntimeIdentifierOptOutCorrecltyOptsOut()
{
var targetFramework = ToolsetInfo.CurrentTargetFramework;
var runtimeIdentifier = EnvironmentInfo.GetCompatibleRid(targetFramework);
var testProject = new TestProject()
{
IsExe = true,
TargetFrameworks = targetFramework
};
testProject.AdditionalProperties["SelfContained"] = "true";
testProject.AdditionalProperties["DisableImplicitRuntimeIdentifier"] = "true";

var testAsset = _testAssetsManager.CreateTestProject(testProject);

var publishCommand = new PublishCommand(testAsset);
publishCommand
.Execute()
.Should()
.Fail()
.And
.HaveStdOutContaining("NETSDK1191");
}

[Fact]
public void DuplicateRuntimeIdentifiers()
{
Expand Down