Convert BlazorExtension to SDK style project (#7588)

* Convert BlazorExtension to SDK style project

Fixes https://github.com/aspnet/AspNetCore/issues/7135
This commit is contained in:
Pranav K 2019-02-15 15:14:19 -08:00 committed by GitHub
parent fe1c2c84ee
commit 7daa0e0145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 177 deletions

View File

@ -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>

View File

@ -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.
@ -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>
@ -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
@ -101,174 +99,50 @@
</Target>
<ItemGroup>
<!--
Let's continue our parade of gross workarounds.
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>
<Content Include="CodeSnippets.pkgdef" CopyToOutputDirectory="PreserveNewest" IncludeInVSIX="true" />
<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="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" />
<Content Include="..\..\..\THIRD-PARTY-NOTICES.txt" CopyToOutputDirectory="PreserveNewest" IncludeInVSIX="true">
<Link>Content\THIRD-PARTY-NOTICES.txt</Link>
</Content>
<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>
<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>