63 lines
2.3 KiB
XML
63 lines
2.3 KiB
XML
<Project>
|
|
<PropertyGroup>
|
|
<RestoreDependsOn Condition="'$(OS)'=='Windows_NT'">$(RestoreDependsOn);RestoreVSIX</RestoreDependsOn>
|
|
<PackageDependsOn Condition="'$(OS)'=='Windows_NT'">$(PackageDependsOn);PackageVSIX</PackageDependsOn>
|
|
<VSIXName>Microsoft.VisualStudio.RazorExtension</VSIXName>
|
|
<VSIXProject>$(RepositoryRoot)tooling\$(VSIXName)\$(VSIXName).csproj</VSIXProject>
|
|
</PropertyGroup>
|
|
|
|
<Target
|
|
Name="GenerateVSIX"
|
|
DependsOnTargets="RestoreVSIX;PackageVSIX"
|
|
Condition="'$(OS)'=='Windows_NT'" />
|
|
|
|
<Target Name="_LocateMSBuildExe" Condition="Exists('$(MSBuildProgramFiles32)')">
|
|
<ItemGroup>
|
|
<MSBuild15ExePaths Include="$(MSBuildProgramFiles32)\Microsoft Visual Studio\**\MSBuild\15.0\Bin\MSBuild.exe" />
|
|
</ItemGroup>
|
|
|
|
<Warning
|
|
Text="Unable to locate MSBuild 15.0 under $(MSBuildProgramFiles32)\Microsoft Visual Studio"
|
|
Condition="'@(MSBuild15ExePaths)'==''"/>
|
|
|
|
<PropertyGroup Condition="'@(MSBuild15ExePaths)'!=''">
|
|
<MSBuildExePath>%(MSBuild15ExePaths.FullPath)</MSBuildExePath>
|
|
</PropertyGroup>
|
|
</Target>
|
|
|
|
<Target Name="RestoreVSIX" DependsOnTargets="_LocateMSBuildExe">
|
|
<Exec Command=""$(MSBuildExePath)" "$(VSIXProject)" /t:Restore /v:m /p:BuildNumber=$(BuildNumber)" />
|
|
</Target>
|
|
|
|
<Target Name="PackageVSIX" DependsOnTargets="_LocateMSBuildExe">
|
|
<PropertyGroup>
|
|
<MSBuildArtifactsDir>$(ArtifactsDir)msbuild\</MSBuildArtifactsDir>
|
|
<VSIXLogFilePath>$(MSBuildArtifactsDir)vsix.log</VSIXLogFilePath>
|
|
<VSIXResponseFilePath>$(MSBuildArtifactsDir)vsix.rsp</VSIXResponseFilePath>
|
|
<VSIXOutputPath>$(BuildDir)$(VSIXName).vsix</VSIXOutputPath>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<MSBuildArguments Include="
|
|
$(VSIXProject);
|
|
/m;
|
|
/v:M;
|
|
/fl;
|
|
/flp:LogFile=$(VSIXLogFilePath);
|
|
/p:DeployExtension=false;
|
|
/p:TargetVSIXContainer=$(VSIXOutputPath);
|
|
/p:Configuration=$(Configuration);" />
|
|
</ItemGroup>
|
|
|
|
<MakeDir Directories="$(MSBuildArtifactsDir)" Condition="!Exists('$(MSBuildArtifactsDir)')" />
|
|
|
|
<WriteLinesToFile
|
|
File="$(VSIXResponseFilePath)"
|
|
Lines="@(MSBuildArguments)"
|
|
Overwrite="true" />
|
|
|
|
<Exec Command=""$(MSBuildExePath)" @"$(VSIXResponseFilePath)"" />
|
|
</Target>
|
|
|
|
</Project>
|