Skip to content

Commit

Permalink
Enable PublishReadyToRunComposite for R2R singlefile apps (#25963)
Browse files Browse the repository at this point in the history
* Enable PublishReadyToRunComposite for R2R singlefile apps

* fix tests
  • Loading branch information
VSadov authored Jun 11, 2022
1 parent ca079f6 commit cf6c9d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Copyright (c) .NET Foundation. All rights reserved.
-->
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_TargetFrameworkVersionWithoutV)' >= '3.0'">
<PublishReadyToRunUseCrossgen2 Condition="'$(_TargetFrameworkVersionWithoutV)' >= '6.0'">true</PublishReadyToRunUseCrossgen2>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == '' and '$(PublishSingleFile)' == 'true' and '$(PublishReadyToRun)' == 'true' and '$(_TargetFrameworkVersionWithoutV)' >= '7.0'">true</PublishReadyToRunComposite>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == '' and '$(_TargetFrameworkVersionWithoutV)' >= '6.0'">false</PublishReadyToRunComposite>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunComposite)' == ''">true</PublishReadyToRunComposite>
<PublishReadyToRunComposite Condition="'$(PublishReadyToRunUseCrossgen2)' != 'true' or '$(SelfContained)' != 'true'">false</PublishReadyToRunComposite>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public class GivenThatWeWantToPublishASingleFileApp : SdkTest
private const string ExcludeAlways = "/p:ExcludeAlways=true";
private const string DontUseAppHost = "/p:UseAppHost=false";
private const string ReadyToRun = "/p:PublishReadyToRun=true";
private const string ReadyToRunComposite = "/p:PublishReadyToRunComposite=true";
private const string ReadyToRunCompositeOn = "/p:PublishReadyToRunComposite=true";
private const string ReadyToRunCompositeOff = "/p:PublishReadyToRunComposite=false";
private const string ReadyToRunWithSymbols = "/p:PublishReadyToRunEmitSymbols=true";
private const string UseAppHost = "/p:UseAppHost=true";
private const string IncludeDefault = "/p:IncludeSymbolsInSingleFile=false";
Expand Down Expand Up @@ -314,7 +315,7 @@ public void It_supports_composite_r2r(bool extractAll)

var testAsset = _testAssetsManager.CreateTestProject(testProject);
var publishCommand = new PublishCommand(testAsset);
var extraArgs = new List<string>() { PublishSingleFile, ReadyToRun, ReadyToRunComposite, RuntimeIdentifier };
var extraArgs = new List<string>() { PublishSingleFile, ReadyToRun, ReadyToRunCompositeOn, RuntimeIdentifier };

if (extractAll)
{
Expand Down Expand Up @@ -434,7 +435,7 @@ public void It_excludes_ni_pdbs_from_single_file()

var publishCommand = GetPublishCommand();
publishCommand
.Execute(PublishSingleFile, RuntimeIdentifier, IncludeAllContent, ReadyToRun, ReadyToRunWithSymbols)
.Execute(PublishSingleFile, RuntimeIdentifier, IncludeAllContent, ReadyToRun, ReadyToRunWithSymbols, ReadyToRunCompositeOff)
.Should()
.Pass();

Expand Down Expand Up @@ -505,7 +506,7 @@ public void It_generates_a_single_file_for_R2R_compiled_Apps()
{
var publishCommand = GetPublishCommand();
publishCommand
.Execute(PublishSingleFile, RuntimeIdentifier, IncludeAllContent, ReadyToRun)
.Execute(PublishSingleFile, RuntimeIdentifier, IncludeAllContent, ReadyToRun, ReadyToRunCompositeOff)
.Should()
.Pass();

Expand Down

0 comments on commit cf6c9d1

Please sign in to comment.