-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[templates] Fix applicationId template option #13509
Conversation
By preventing the templating engine from matching the AppID to the App's name (the sourceName), we allow the parameter to work
@jknaudt21 very nice! Can you confirm what happens with:
I want to make sure that those cases are also handled reasonably well. Or will they just get the default value |
This comment was marked as outdated.
This comment was marked as outdated.
I'm looking into seeing if something can be done with a symbol generator. https://github.com/dotnet/templating/wiki/Available-Symbols-Generators. Marking PR as a draft until I arrive at a conclusion. Edit: a solution was found that is the best of both worlds :) |
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.
Amazing!
Description of Change
We prevent the templating engine from matching the AppID to the App's name (the sourceName). This allows the
applicationId
parameter to work as expected when doingdotnet new -ap com.my.name
. I also make sure that if we're using the (lowercased) app name as an AppID in case no parameter is passed.The changes required some tricks using the templating engine. Mainly:
defaultAppId
that is the concatenation of "com.company." with the lowercased app namefinalAppID
. The result depends on whether theapplicationId
parameter was passed by the user. If theapplicationId
is null (i.e not given), we use thedefaultAppId
; otherwise we use whatever the user provided.Issues Fixed
fixes #13297