-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow publishing file-based apps #49310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
be499ce
d8955ca
9f69d76
d7c9d45
0e1233e
44fd7ec
ce4d9e4
27e6d9f
01dd25a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ internal sealed class VirtualProjectBuildingCommand : CommandBase | |
|
||
public VirtualProjectBuildingCommand( | ||
string entryPointFileFullPath, | ||
string[] msbuildArgs, | ||
IReadOnlyList<string> msbuildArgs, | ||
VerbosityOptions? verbosity, | ||
bool interactive) | ||
{ | ||
|
@@ -77,12 +77,12 @@ public VirtualProjectBuildingCommand( | |
|
||
public string EntryPointFileFullPath { get; } | ||
public Dictionary<string, string> GlobalProperties { get; } | ||
public string[] BinaryLoggerArgs { get; } | ||
public IReadOnlyList<string> BinaryLoggerArgs { get; } | ||
public VerbosityOptions Verbosity { get; } | ||
public bool NoRestore { get; init; } | ||
public bool NoCache { get; init; } | ||
public bool NoBuild { get; init; } | ||
public bool NoIncremental { get; init; } | ||
public string BuildTarget { get; init; } = "Build"; | ||
|
||
public override int Execute() | ||
{ | ||
|
@@ -164,7 +164,7 @@ public override int Execute() | |
{ | ||
var buildRequest = new BuildRequestData( | ||
CreateProjectInstance(projectCollection), | ||
targetsToBuild: [NoIncremental ? "Rebuild" : "Build"]); | ||
targetsToBuild: [BuildTarget]); | ||
var buildResult = BuildManager.DefaultBuildManager.BuildRequest(buildRequest); | ||
if (buildResult.OverallResult != BuildResultCode.Success) | ||
{ | ||
|
@@ -195,10 +195,10 @@ public override int Execute() | |
consoleLogger.Shutdown(); | ||
} | ||
|
||
static ILogger? GetBinaryLogger(string[] args) | ||
static ILogger? GetBinaryLogger(IReadOnlyList<string> args) | ||
{ | ||
// Like in MSBuild, only the last binary logger is used. | ||
for (int i = args.Length - 1; i >= 0; i--) | ||
for (int i = args.Count - 1; i >= 0; i--) | ||
{ | ||
var arg = args[i]; | ||
if (LoggerUtility.IsBinLogArgument(arg)) | ||
|
@@ -534,6 +534,7 @@ public static void WriteProjectFile( | |
<TargetFramework>net10.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<PublishAot>true</PublishAot> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we unconditionally do this? What if the user has the following code? #:property PublishAot false There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The project will get |
||
</PropertyGroup> | ||
"""); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chsienki has a PR out to remove the need for the
.cs
suffix in the files. Think this needs to adjust to account for that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't need any adjusting - Chris's logic lives inside
VirtualProjectBuildingCommand.IsValidEntryPointPath
so this will pick it up automatically - and hencedotnet publish no-cs-extension
will work (and similarly others like build/restore) - assuming we want that?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Def want it to work. I just want to make sure we're confident these PRs will converge correctly.