|
122 | 122 | <Delete Files="$(_VsixVersionSentinel)" /> |
123 | 123 | </Target> |
124 | 124 |
|
125 | | - <!-- |
126 | | - Generate Publish Manifest (publish.manifest.json) |
127 | | - Creates a VS Marketplace publish manifest from project properties and VSIX manifest |
128 | | - --> |
129 | | - <Target Name="GeneratePublishManifest" |
130 | | - AfterTargets="Build" |
131 | | - Condition="'$(GeneratePublishManifest)' == 'true' and '$(_SourceVsixManifestPath)' != '' and Exists('$(_SourceVsixManifestPath)')"> |
132 | | - |
133 | | - <PropertyGroup> |
134 | | - <_VsixNsForPeek><Namespace Prefix='vsix' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011'/></_VsixNsForPeek> |
135 | | - </PropertyGroup> |
136 | | - |
137 | | - <!-- Read Publisher from VSIX manifest --> |
138 | | - <XmlPeek XmlInputPath="$(_SourceVsixManifestPath)" |
139 | | - Query="/vsix:PackageManifest/vsix:Metadata/vsix:Identity/@Publisher" |
140 | | - Namespaces="$(_VsixNsForPeek)"> |
141 | | - <Output TaskParameter="Result" PropertyName="_VsixPublisher" /> |
142 | | - </XmlPeek> |
143 | | - |
144 | | - <!-- Read MoreInfo (repo URL) from VSIX manifest --> |
145 | | - <XmlPeek XmlInputPath="$(_SourceVsixManifestPath)" |
146 | | - Query="/vsix:PackageManifest/vsix:Metadata/vsix:MoreInfo/text()" |
147 | | - Namespaces="$(_VsixNsForPeek)"> |
148 | | - <Output TaskParameter="Result" PropertyName="_VsixMoreInfo" /> |
149 | | - </XmlPeek> |
150 | | - |
151 | | - <!-- Read Tags (categories) from VSIX manifest --> |
152 | | - <XmlPeek XmlInputPath="$(_SourceVsixManifestPath)" |
153 | | - Query="/vsix:PackageManifest/vsix:Metadata/vsix:Tags/text()" |
154 | | - Namespaces="$(_VsixNsForPeek)"> |
155 | | - <Output TaskParameter="Result" PropertyName="_VsixTags" /> |
156 | | - </XmlPeek> |
157 | | - |
158 | | - <!-- Convert comma-separated tags to JSON array format --> |
159 | | - <PropertyGroup> |
160 | | - <!-- First trim spaces after commas, then replace commas with JSON array separators --> |
161 | | - <_VsixTagsNormalized>$(_VsixTags.Replace(', ', ','))</_VsixTagsNormalized> |
162 | | - <_CategoriesJson>$(_VsixTagsNormalized.Replace(',', '", "'))</_CategoriesJson> |
163 | | - <_CategoriesJson>"$(_CategoriesJson)"</_CategoriesJson> |
164 | | - <_QnAValue Condition="'$(VsixPublishQnA)' == 'true'">true</_QnAValue> |
165 | | - <_QnAValue Condition="'$(VsixPublishQnA)' != 'true'">false</_QnAValue> |
166 | | - <_RepoLine Condition="'$(_VsixMoreInfo)' != ''">, |
167 | | - "repo": "$(_VsixMoreInfo)"</_RepoLine> |
168 | | - <_RepoLine Condition="'$(_VsixMoreInfo)' == ''"></_RepoLine> |
169 | | - </PropertyGroup> |
170 | | - |
171 | | - <!-- Write the publish manifest JSON --> |
172 | | - <PropertyGroup> |
173 | | - <_PublishManifestContent><![CDATA[{ |
174 | | - "$schema": "http://json.schemastore.org/vsix-publish", |
175 | | - "categories": [ |
176 | | - $(_CategoriesJson) |
177 | | - ], |
178 | | - "identity": { |
179 | | - "internalName": "$(MSBuildProjectName)" |
180 | | - }, |
181 | | - "overview": "$(VsixPublishOverview)", |
182 | | - "publisher": "$(_VsixPublisher)", |
183 | | - "qna": $(_QnAValue)$(_RepoLine) |
184 | | -}]]></_PublishManifestContent> |
185 | | - </PropertyGroup> |
186 | | - |
187 | | - <WriteLinesToFile File="$(MSBuildProjectDirectory)\publish.manifest.json" |
188 | | - Lines="$(_PublishManifestContent)" |
189 | | - Overwrite="true" /> |
190 | | - |
191 | | - <Message Importance="high" Text="Generated publish manifest: $(MSBuildProjectDirectory)\publish.manifest.json" /> |
192 | | - </Target> |
193 | | - |
194 | 125 | <!-- |
195 | 126 | Target to validate VSIX project configuration |
196 | 127 | Runs early in the build to catch common mistakes |
|
0 commit comments