Skip to content

Convert BlazorExtension to SDK style project #7588

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
merged 4 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" />

<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<TargetFramework>net472</TargetFramework>

<!-- Use the same experimental hive as Roslyn and Razor. This makes it easy to mix private builds. -->
<VSSDKTargetPlatformRegRootSuffix>RoslynDev</VSSDKTargetPlatformRegRootSuffix>

<!-- Required to run the project localy -->
<StartAction>Program</StartAction>
<StartProgram>$(DevEnvDir)devenv.exe</StartProgram>
<StartArguments>/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log</StartArguments>

<!--
Mark the VSIX as a per-computer install (not-per-user). Putting a component "in the box"
requires this, and trying to change it after doing a release has lot of problems.
-->
<ExtensionInstallationRoot>CommonExtensions</ExtensionInstallationRoot>
<ExtensionInstallationFolder>Microsoft\Blazor</ExtensionInstallationFolder>

<!-- This should be set as true if we're ever building the VSIX for inclusion by the VS installer. -->
<IsProductComponent Condition="'$(IsProductComponent)'==''">false</IsProductComponent>

<!-- Update the VSToolsPath to ensure VSIX builds -->
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<UseCodebase>true</UseCodebase>
<ImportDirectoryBuildProps>true</ImportDirectoryBuildProps>
<ImportDirectoryBuildTargets>true</ImportDirectoryBuildTargets>
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<!-- Other projects should not reference this assembly. It is only meaning to be used in Visual Studio. -->
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
<IsShippingPackage>false</IsShippingPackage>

<IsPackable>false</IsPackable>
<EnableSourceLink>false</EnableSourceLink>
<GenerateSourceLinkFile>false</GenerateSourceLinkFile>
<UseCodebase>true</UseCodebase>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<DeployExtension Condition="'$(CI)' == 'true'">false</DeployExtension>
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

<!--
Since the VSSDK doeesn't support SDK-based projects, we have to use the long/verbose version.
Expand All @@ -38,6 +51,8 @@
<VsixVersionSuffix Condition="'$(BuildNumberSuffix)'=='t000'">424242.424242</VsixVersionSuffix>
<VsixVersionSuffix Condition="'$(VsixVersionSuffix)'==''">$(BuildNumberSuffix.Replace('-', '.'))</VsixVersionSuffix>
<VsixVersion>$(VsixVersionPrefix).$(VsixVersionSuffix)</VsixVersion>

<InformationalVersion>$(VsixVersion)</InformationalVersion>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -50,23 +65,6 @@
-->
<Target Name="GetBuildVersion" Outputs="$(VsixVersion)" />

<PropertyGroup>
<!-- Use the same experimental hive as Roslyn and Razor. This makes it easy to mix private builds. -->
<StartAction>Program</StartAction>
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
<StartArguments>/rootsuffix RoslynDev</StartArguments>
<VSSDKTargetPlatformRegRootSuffix>RoslynDev</VSSDKTargetPlatformRegRootSuffix>
</PropertyGroup>
<PropertyGroup>
<!--
Mark the VSIX as a per-computer install (not-per-user). Putting a component "in the box"
requires this, and trying to change it after doing a release has lot of problems.
-->
<ExtensionInstallationRoot>CommonExtensions</ExtensionInstallationRoot>
<ExtensionInstallationFolder>Microsoft\Blazor</ExtensionInstallationFolder>
<!-- This should be set as true if we're ever building the VSIX for inclusion by the VS installer. -->
<IsProductComponent Condition="'$(IsProductComponent)'==''">false</IsProductComponent>
</PropertyGroup>
<PropertyGroup>
<!--
Include this assembly in the VSIX but not its symbols, except when installing it to the experimental
Expand Down Expand Up @@ -101,174 +99,50 @@
</Target>

<ItemGroup>
<!--
Let's continue our parade of gross workarounds.
<Content Include="CodeSnippets.pkgdef" CopyToOutputDirectory="PreserveNewest" IncludeInVSIX="true" />
<Content Include="Templates.pkgdef" />
<Content Include="CodeSnippets\Blazor\para.snippet" CopyToOutputDirectory="PreserveNewest" IncludeInVSIX="true" />
<Content Include="Content\WebConfiguration.png" CopyToOutputDirectory="PreserveNewest" IncludeInVSIX="true" />
<Content Include="Resources\BlazorPackage.ico" CopyToOutputDirectory="PreserveNewest" IncludeInVSIX="true" />

Referencing a cross-targeting project using a P2P from a VSIX project doesn't work well. To work around
this problem, we're only using the P2P references to force build ordering. Then we include the build
output of those projects as content.
-->
<Content Include="CodeSnippets.pkgdef">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
<Content Include="..\..\..\THIRD-PARTY-NOTICES.txt" CopyToOutputDirectory="PreserveNewest" IncludeInVSIX="true">
<Link>Content\THIRD-PARTY-NOTICES.txt</Link>
</Content>
<Content Include="Templates.pkgdef" />
<ProjectReference Include="..\..\Templates\src\Microsoft.AspNetCore.Blazor.Templates.csproj">
<Project>{edd21533-c6e6-4f85-be4f-10e06756e24c}</Project>
<Name>Microsoft.AspNetCore.Blazor.Templates</Name>
<Targets>Pack</Targets>
<Private>False</Private>
<IncludeOutputGroupsInVSIX>
</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>
</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<Content Include="$(RepositoryRoot)LICENSE.txt" CopyToOutputDirectory="PreserveNewest" IncludeInVSIX="true">
<Link>Content\LICENSE.txt</Link>
</Content>

<None Include="source.extension.vsixmanifest" SubType="Designer" />
</ItemGroup>
<!--
We need to generate the assembly attributes for our assembly using the version from the build, so
we can flow it to the about dialog.
-->

<ItemGroup>
<_VSIXAssemblyAttribute Include="System.Reflection.AssemblyInformationalVersionAttribute">
<_Parameter1>$(VersionPrefix)-$(VersionSuffix)</_Parameter1>
</_VSIXAssemblyAttribute>
<ProjectReference Include="..\..\Templates\src\Microsoft.AspNetCore.Blazor.Templates.csproj" />
</ItemGroup>
<Target Name="_GenerateVSIXAssemblyAttributesHash" DependsOnTargets="PrepareForBuild" Condition="'@(_VSIXAssemblyAttribute)' != ''">
<!-- We only use up to _Parameter1 for most attributes, but other targets may add additional assembly attributes with multiple parameters. -->
<Hash ItemsToHash="@(_VSIXAssemblyAttribute->'%(Identity)%(_Parameter1)%(_Parameter2)%(_Parameter3)%(_Parameter4)%(_Parameter5)%(_Parameter6)%(_Parameter7)%(_Parameter8)')">
<Output TaskParameter="HashResult" PropertyName="_VSIXAssemblyAttributesHash" />
</Hash>
<WriteLinesToFile Lines="$(_VSIXAssemblyAttributesHash)" File="$(_GeneratedVSIXAssemblyInfoInputsCacheFile)" Overwrite="True" WriteOnlyWhenDifferent="True" />
<ItemGroup>
<FileWrites Include="$(_GeneratedVSIXAssemblyInfoInputsCacheFile)" />
</ItemGroup>
</Target>
<Target Name="_GenerateVSIXAssemblyAttributes" DependsOnTargets="_GenerateVSIXAssemblyAttributesHash" Inputs="$(_GeneratedVSIXAssemblyInfoInputsCacheFile)" Outputs="$(_GeneratedVSIXAssemblyInfoFile)" BeforeTargets="CoreCompile">
<ItemGroup>
<Compile Include="$(_GeneratedVSIXAssemblyInfoFile)">
<Visible>false</Visible>
</Compile>
</ItemGroup>
<WriteCodeFragment AssemblyAttributes="@(_VSIXAssemblyAttribute)" Language="C#" OutputFile="$(_GeneratedVSIXAssemblyInfoFile)" />
<ItemGroup>
<FileWrites Include="$(_GeneratedVSIXAssemblyInfoFile)" />
</ItemGroup>
</Target>
<!--

END INTERESTING STUFF

-->
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{9088E4E4-B855-457F-AE9E-D86709A5E1F4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.VisualStudio.BlazorExtension</RootNamespace>
<AssemblyName>Microsoft.VisualStudio.BlazorExtension</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure, but I think this Microsoft.NET.Sdk sets this to portable. Not sure if that's important or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the Razor vsix, and it produces portable pdbs:

image

Guess it doesn't matter.

<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="15.7.27703" />
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="15.9.3032" />
<PackageReference Include="StreamJsonRpc" Version="1.5.43" />
</ItemGroup>
<ItemGroup>
<Compile Include="AboutDialogInfoAttribute.cs" />
<Compile Include="AutoRebuild\AutoRebuildService.cs" />
<Compile Include="AutoRebuild\BuildEventsWatcher.cs" />
<Compile Include="AutoRebuild\StreamProtocolExtensions.cs" />
<Compile Include="BlazorPackage.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="CodeSnippets\Blazor\para.snippet">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="Key.snk" />
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\THIRD-PARTY-NOTICES.txt">
<Link>Content\THIRD-PARTY-NOTICES.txt</Link>
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="$(RepositoryRoot)LICENSE.txt">
<Link>Content\LICENSE.txt</Link>
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\WebConfiguration.png">
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Resources\BlazorPackage.ico">
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<!-- Resources are a little bit special in a VSIX -->
<PropertyGroup>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Include="Resources.resx">
<MergeWithCTO>true</MergeWithCTO>
<ManifestResourceName>VSPackage</ManifestResourceName>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.CommandBars, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<!-- Must be defined after the CSharp.targets -->
<PropertyGroup>
<_GeneratedVSIXAssemblyInfoInputsCacheFile>$(IntermediateOutputPath)$(MSBuildProjectName).VSIXAssemblyInfo.cache.txt</_GeneratedVSIXAssemblyInfoInputsCacheFile>
<_GeneratedVSIXAssemblyInfoFile>$(IntermediateOutputPath)$(MSBuildProjectName).VSIXAssemblyInfo.cs</_GeneratedVSIXAssemblyInfoFile>
</PropertyGroup>

<!-- This needs to be here because the build will try to call it -->
<Target Name="Pack">
</Target>
</Project>