-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add dotnetcore 2.1 support for init command #665
Conversation
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.
looks good!
If you're making dotnetcore 2.1 the default then I think you also need to change the version in the aws-lambda-tools-defaults.json file in the src/HelloWorld folder. |
Good catch!! Didn’t know about that.
Will make that change tomorrow
…On Thu, 13 Sep 2018 at 20:56, gitsno ***@***.***> wrote:
If you're making dotnetcore 2.1 the default then I think you also need to
change the version in the aws-lambda-tools-defaults.json file in the
src/HelloWorld folder.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#665 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADL4BFJ3qW8fcp_tKeMod7VOwor65qhnks5uarhdgaJpZM4Wm6vZ>
.
|
@gitsno Change made and I also found another file that needed changing so Visual Studio would pick up the changes too (not only SAM). Followed guidelines here: https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1 Installed latest Visual Studio and it recognized the latest and the target framework to 2.1 too. |
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.
Overall this looks good. Just a couple questions, that might make it easier to expand this in the future.
@@ -16,7 +16,11 @@ Resources: | |||
Properties: | |||
CodeUri: src/HelloWorld/bin/Debug/netcoreapp2.0/publish | |||
Handler: HelloWorld::HelloWorld.Function::FunctionHandler | |||
{%- if cookiecutter.runtime == 'dotnetcore2.0' %} | |||
Runtime: dotnetcore2.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.
Can runtime just be the value of cookiecutter.runtime
?
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.
We could for explicit runtimes (non-defaults) but not default as we allow customers to also use the shorthand dotnet
to use the latest we support.
I'll change the flow control to only hardcode a value for non-default as it'll keep it clean
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.
Done for explicit and valid runtime value
"framework": "netcoreapp2.0", | ||
"function-runtime": "dotnetcore2.0", | ||
{%- else %} | ||
"function-runtime": "dotnetcore2.1", |
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.
If there becomes a dotnetcore2.2, we will default to dotnetcore2.1.
What if we had defaults to set here and then explicitly checked the runtime for each dotnetcore version:
if runtime == dotnetcore2.0:
# stuff for 2.0 version
elif runtime == dotnetcore2.1:
# stuff for 2.1 version
else:
# default
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.
As of now I don't know of any VS defaults and purely following the migration guidelines. Now that you mentioned, I think it's best to explicit check runtime and remove else
altogether until there are known defaults
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.
done
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.
Thanks for taking the time and adding this example in! 🎉
Issue #, if available: #609
Description of changes:
dotnet
is selectedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.