Conversation
By preventing the templating engine from matching the AppID to the App's name (the sourceName), we allow the parameter to work
Contributor
|
@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.
Eilon
reviewed
Feb 28, 2023
Contributor
Author
|
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 :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
We prevent the templating engine from matching the AppID to the App's name (the sourceName). This allows the
applicationIdparameter 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:
defaultAppIdthat is the concatenation of "com.company." with the lowercased app namefinalAppID. The result depends on whether theapplicationIdparameter was passed by the user. If theapplicationIdis null (i.e not given), we use thedefaultAppId; otherwise we use whatever the user provided.Issues Fixed
fixes #13297