-
Notifications
You must be signed in to change notification settings - Fork 402
Lay foundation for VSIX localization and re-enable Single-project MSIX Packaging templates #1341
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
Merged
Conversation
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
… groundwork for localization (split into separate Dev16 and Dev17 extensions)
b4745d0 to
d49802f
Compare
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
kythant
approved these changes
Aug 31, 2021
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…rosoft/WindowsAppSDK into user/alwu-msft/localize-vsix
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
ZenBird-zz
pushed a commit
that referenced
this pull request
Sep 4, 2021
…X Packaging templates (#1341) * Add back project templates for Single-project MSIX Packaging, and lay groundwork for localization (split into separate Dev16 and Dev17 extensions) * Extract strings from .vstemplate into .resx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
There are two major, somewhat intertwined, changes in this PR:
Lay foundation for VSIX localization
There is an undocumented method for localizing string resources in VS project and item templates. Firstly, the extension containing the templates must provide a VSPackage. Next, a
VSPackage.resx(Visual Studio first looks for theVSPackageresource stream) is added to the extension project to hold the string resources; the IDs of these resources must be integers (specifically, within the range of aunsigned int). Finally, the Name and Description elements in each.vstemplate's<TemplateData>section so that:Packageattribute is the GUID assigned to the extension's VSPackageIDattribute is the ID of the string resource as defined in the.resxThe convention that we will use for choosing resource IDs is as follows:
.resxdesigner use of a lexical sort.1004) then it is the default resource ID, and N+1 (e.g.1005) is the resource ID to be used when we are creating an experimental VSIX.A consequence of the above is that we now have an assembly that ships with the extension and therefore must have separate versions for Dev16 and Dev17. We thus now have a total of four VSIXs: C++ Dev16, C++ Dev17, C# Dev16, C# Dev17.
This change also refactors how we perform our
.vstemplate/source.extension.vsixmanifestedits. Previously, we were using a combination of XmlPeek and XmlPoke tasks to modify them in-place early in the build; an unfortunate side-effect was that when loading the extension solution in Visual Studio, the targets responsible for restoring those files at the end of the build would often not run, resulting in a repo polluted with undesired changes. Worse, because each template is built independently by its own project which is then referenced by the actual extension project, there was no way to update each.vstemplatewith the correct package GUID (since each template is included in two different extensions, each with its own package GUID). Therefore, it was necessary to move the rewriting step to later in the build, right before the VSIX container is built from the intermediate output. This allows the correct edits to be made while also increasing the reliability of the build (since we are now modifying the intermediate outputs rather than the source files). Finally, the rewriting of the.vstemplateswas simplified by switching to an XSL transformation;source.extension.vsixmanifestcontinues to be modified usingXmlPeek/XmlPokebecause switching it to use an XSL transformation was a) unnecessary, and b) out of scope.Re-enable Single-project MSIX Packaging project templates
The Visual Studio Marketplace backend error that required us to pull out the Single-project MSIX Packaging project templates at the last minute prior to the 1.0 Experimental release has resolved itself, thereby allowing us to re-enable the templates for the upcoming 1.0 Preview release. In addition to promoting the templates out of the "experimental" feature set, the extension pack has been updated to be compatible with both Dev16 and Dev17.