Skip to content

Commit

Permalink
Let the integration test harness deploy the dependencies VSIX
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Feb 28, 2023
1 parent 3d87942 commit 6502ed2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
<!-- Don't automatically include dependencies -->
<IncludePackageReferencesInVSIXContainer>false</IncludePackageReferencesInVSIXContainer>

<CreateVsixContainer Condition="'$(BuildDependencyVsix)' == 'true'">true</CreateVsixContainer>
<CreateVsixContainer>true</CreateVsixContainer>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<DeployExtension Condition="'$(BuildDependencyVsix)' == 'true' OR '$(BuildDependencyVsix)' == ''" >true</DeployExtension>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<DefineConstants Condition="'$(IncludeRoslynDeps)' == 'true'">$(DefineConstants);INCLUDE_ROSLYN_DEPS</DefineConstants>

<!-- This extension will be deployed on demand by the integration test harness -->
<DeployExtension>false</DeployExtension>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- This is needed to mark this extension as cloud compliant. -->
<AllowClientRole>true</AllowClientRole>
</Metadata>
<Installation AllUsers="true" Experimental="true">
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,)">
<ProductArchitecture>amd64</ProductArchitecture>
</InstallationTarget>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\RazorDeployment\RazorDeployment.csproj" Private="False" Condition="'$(BuildDependencyVsix)' == 'true'">
<PrivateAssets>All</PrivateAssets>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>False</CopyLocalSatelliteAssemblies>
</ProjectReference>
<ProjectReference Include="..\..\src\Microsoft.VisualStudio.RazorExtension.Dependencies\Microsoft.VisualStudio.RazorExtension.Dependencies.csproj" Private="false" ReferenceOutputAssembly="false" CopyVsix="true" />
<ProjectReference Include="..\..\src\Microsoft.VisualStudio.RazorExtension\Microsoft.VisualStudio.RazorExtension.csproj" Private="false" ReferenceOutputAssembly="false" CopyVsix="true" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
<ProjectReference Include="..\Microsoft.VisualStudio.Editor.Razor.Test.Common\Microsoft.VisualStudio.Editor.Razor.Test.Common.csproj" />
</ItemGroup>
Expand All @@ -39,4 +36,35 @@
<ItemGroup>
<EmbeddedResource Include="**\TestFiles\**\*" />
</ItemGroup>

<ItemGroup>
<!-- Microsoft.VisualStudio.RazorExtension.vsix cannot be installed without elevation due to a bug in the experimental extension installation logic. -->
<!--<AssemblyAttribute Include="Xunit.Harness.RequireExtensionAttribute">
<_Parameter1>Microsoft.VisualStudio.RazorExtension.vsix</_Parameter1>
</AssemblyAttribute>-->
<AssemblyAttribute Include="Xunit.Harness.RequireExtensionAttribute">
<_Parameter1>Microsoft.VisualStudio.RazorExtension.Dependencies.vsix</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<Target Name="PrepareVsixProjectReferences"
BeforeTargets="ResolveProjectReferences"
DependsOnTargets="PrepareProjectReferences">
<MSBuild
Projects="@(_MSBuildProjectReferenceExistent)"
Targets="VSIXContainerProjectOutputGroup"
BuildInParallel="$(BuildInParallel)"
Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework); CreateVsixContainer=true"
Condition="'%(_MSBuildProjectReferenceExistent.CopyVsix)' == 'true'"
ContinueOnError="!$(BuildingProject)"
RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">

<Output TaskParameter="TargetOutputs" ItemName="_ProjectReferenceVsixOutputs" />
</MSBuild>

<ItemGroup>
<ReferenceCopyLocalPaths Include="@(_ProjectReferenceVsixOutputs)" />
</ItemGroup>
</Target>

</Project>

0 comments on commit 6502ed2

Please sign in to comment.