-
Notifications
You must be signed in to change notification settings - Fork 86
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
Switch --runtime value to linux-x64 #112
Conversation
…for runtimes using Amazon Linux 2.
// If you set the runtime to RUNTIME_HIERARCHY_STARTING_POINT it will trim out the Windows and Mac OS specific dependencies but Razor view precompilation | ||
// will not run. So only do this packaging optimization if there are no Razor views. |
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.
Could you comment on why this is different for "netcoreapp2.0" and "netcoreapp2.1"? Why you don't need p:PreserveCompilationContext
for other targets? Also why you don't need to check for Razor views for other targets?
Also this comment was useful, I think.
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.
Added comment
arguments.Append($" -r {LambdaConstants.RUNTIME_HIERARCHY_STARTING_POINT}"); | ||
if(Directory.GetFiles(fullProjectLocation, "*.cshtml", SearchOption.AllDirectories).Length == 0) | ||
{ | ||
arguments.Append($" -r {LambdaConstants.LEGACY_RUNTIME_HIERARCHY_STARTING_POINT}"); |
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.
You could do arguments.Append($" -r {LambdaUtilities.DetermineRuntimeParameter(targetFramework)}");
instead and have the same code for both "netcoreapp2.0", "netcoreapp2.1"
and other targets.
You can also consider moving the common configurations for both "netcoreapp2.0", "netcoreapp2.1"
and other targets to a function or adjust the if
s to avoid duplicating the code.
You can disregard this if you think it is more readable like this.
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.
Switch to call LambdaUtilities.DetermineRuntimeParameter and put the setting of runtime and self contained in a shared Action.
{ | ||
arguments.Append($" -r {LambdaConstants.RUNTIME_HIERARCHY_STARTING_POINT}"); | ||
if(Directory.GetFiles(fullProjectLocation, "*.cshtml", SearchOption.AllDirectories).Length == 0) |
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.
Since we still have this, the comment reason that got deleted still seems important (With slight modifications).
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.
Added comment
{ | ||
arguments.Append(" --self-contained false "); | ||
arguments.Append($" -r {LambdaUtilities.DetermineRuntimeParameter(targetFramework)}"); |
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.
I believe --runtime and -r are the same. Should probably pick one. Also this seems like it could end up duplicating the same thing already added always on line 87.
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.
Standardized on --runtime
Description of changes:
Change what the value set --runtime when calling dotnet CLI commands for runtimes using Amazon Linux 2.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.