Skip to content

Commit bdeb874

Browse files
committed
OX-02: create the VSIX container (import Microsoft.VsSDK.targets, as Snipper's SDK-style project does)
The first Windows CI run built Owen.VisualStudio.dll but no .vsix: an SDK-style project gets no VSIX packaging from the build tools package alone. The build step now fails loudly when no .vsix is produced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ZFvhLx1fM9Gerg4dKsZcL
1 parent 5b89a93 commit bdeb874

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3548,7 +3548,9 @@ jobs:
35483548
$msbuild = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -find "MSBuild\**\Bin\MSBuild.exe" | Select-Object -First 1
35493549
& $msbuild frontend\roslyn\Owen.VisualStudio\Owen.VisualStudio.csproj /restore /p:Configuration=Release /p:DeployExtension=false /v:m
35503550
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
3551-
Get-ChildItem -Recurse frontend\roslyn\Owen.VisualStudio -Filter *.vsix | ForEach-Object { $_.FullName }
3551+
$built = @(Get-ChildItem -Recurse frontend\roslyn\Owen.VisualStudio -Filter Owen.VisualStudio.vsix)
3552+
if ($built.Count -eq 0) { Write-Error "no Owen.VisualStudio.vsix was produced"; exit 1 }
3553+
$built | ForEach-Object { "$($_.FullName) ($($_.Length) bytes)" }
35523554
- name: The acceptance in Visual Studio
35533555
shell: powershell
35543556
run: |

‎frontend/roslyn/Owen.VisualStudio/Owen.VisualStudio.csproj‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@
3030
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
3131
<TargetVsixContainerName>Owen.VisualStudio.vsix</TargetVsixContainerName>
3232
<VSSDKBuildToolsAutoSetup>true</VSSDKBuildToolsAutoSetup>
33+
<TargetVsixContainer>$(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetFramework)\$(TargetVsixContainerName)</TargetVsixContainer>
34+
<CreatePkgDefAssemblyToProcess>$(MSBuildProjectDirectory)\obj\$(Configuration)\$(TargetFramework)\$(AssemblyName).dll</CreatePkgDefAssemblyToProcess>
35+
<!-- the VSSDK's intermediate layout, spelled out for an SDK-style project (as Snipper does) -->
36+
<VsixIntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework)\vsix\</VsixIntermediateOutputPath>
37+
<IntermediateVsixManifest>$(VsixIntermediateOutputPath)extension.vsixmanifest</IntermediateVsixManifest>
38+
<FileManifest>$(VsixIntermediateOutputPath)files.json</FileManifest>
39+
<TemplateFileManifest>$(VsixIntermediateOutputPath)templateFiles.json</TemplateFileManifest>
40+
<ResourceManifest>$(VsixIntermediateOutputPath)resources.json</ResourceManifest>
41+
<CtoFileManifest>$(VsixIntermediateOutputPath)ctoFiles.json</CtoFileManifest>
42+
<CtoCacheFile>$(VsixIntermediateOutputPath)mergeCto.cache</CtoCacheFile>
43+
<CreateTemplateManifestsCacheFile>$(VsixIntermediateOutputPath)createTemplateManifests.cache</CreateTemplateManifestsCacheFile>
44+
<TemplateOutputDirectory>$(VsixIntermediateOutputPath)</TemplateOutputDirectory>
3345
<!-- the service client runs on its own threads by design (never the UI thread); the
3446
analyzers that assume a JoinableTaskFactory context everywhere do not apply to it -->
3547
<NoWarn>$(NoWarn);VSTHRD003;VSTHRD010;VSTHRD100;VSTHRD110;VSTHRD200;VSSDK007</NoWarn>
@@ -53,4 +65,14 @@
5365
<ItemGroup>
5466
<None Include="source.extension.vsixmanifest" SubType="Designer" />
5567
</ItemGroup>
68+
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets"
69+
Condition="'$(OS)' == 'Windows_NT' and '$(VSToolsPath)' != '' and Exists('$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets')" />
70+
71+
<Target Name="OwenVsixIntermediate" BeforeTargets="DetokenizeVsixManifestFile;GenerateFileManifest"
72+
Condition="'$(OS)' == 'Windows_NT'">
73+
<MakeDir Directories="$(VsixIntermediateOutputPath)" />
74+
</Target>
75+
76+
<Target Name="OwenCreateVsix" AfterTargets="Build" DependsOnTargets="CreateVsixContainer"
77+
Condition="'$(OS)' == 'Windows_NT'" />
5678
</Project>

0 commit comments

Comments
 (0)