Skip to content
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

Merged
merged 3 commits into from
Mar 23, 2020
Merged

Switch --runtime value to linux-x64 #112

merged 3 commits into from
Mar 23, 2020

Conversation

normj
Copy link
Member

@normj normj commented Mar 23, 2020

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.

Comment on lines -210 to -211
// 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.

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.

Copy link
Member Author

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}");

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 ifs to avoid duplicating the code.

You can disregard this if you think it is more readable like this.

Copy link
Member Author

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)
Copy link
Contributor

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).

Copy link
Member Author

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)}");
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardized on --runtime

@normj normj merged commit 5907fd3 into dev-netcore31 Mar 23, 2020
@normj normj deleted the switch-linux-x64 branch September 29, 2021 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants