diff --git a/build-vsix.cmd b/build-vsix.cmd deleted file mode 100644 index 2b67caa48c..0000000000 --- a/build-vsix.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build-vsix.ps1' %*; exit $LASTEXITCODE" diff --git a/build-vsix.ps1 b/build-vsix.ps1 deleted file mode 100644 index 8ad4e603b4..0000000000 --- a/build-vsix.ps1 +++ /dev/null @@ -1,84 +0,0 @@ -#requires -version 4 -param( - [string]$MSBuildPath, - [string]$Configuration='Debug', - [string]$VsixName='Microsoft.VisualStudio.RazorExtension.vsix' -) -$ErrorActionPreference='Stop' -######################## -# Helpers -######################## - -function exec($cmd) { - $cmdName = [IO.Path]::GetFileName($cmd) - Write-Host -ForegroundColor Cyan "> $cmdName $args" - & $cmd @args - $exitCode = $LASTEXITCODE - if($exitCode -ne 0) { - throw "'$cmdName $args' failed with exit code: $exitCode" - } -} - -function Get-BuildConfiguration { - if ($env:Configuration) { - return $env:Configuration - } - return $Configuration -} - -function Get-MSBuildPath { - if ($MSBuildPath) { - return $MSBuildPath - } - - $vsDir=$ENV:VSINSTALLDIR - if (!($vsDir)) { - $vsDir = Join-Path ${ENV:ProgramFiles(x86)} 'Microsoft Visual Studio/2017*/*' - } - - $msbuild = Get-ChildItem $(Join-Path $vsDir 'MSBuild/15.0/bin/MSBuild.exe') - - if (!($msbuild) -or ($msbuild | Measure-Object).Count -ne 1) { - throw "MSBuild 15.0 could not be located automatically in '$vsDir'. Use -MSBuildPath to specify its location." - } - - return $msbuild -} - -######################## -# Variables -######################## - -$intermediateDir = Join-Path $PSScriptRoot 'obj' -$nugetExePath = Join-Path $intermediateDir 'nuget.exe' -$artifactsDir = Join-Path $PSScriptRoot 'artifacts' -$buildDir = Join-Path $artifactsDir 'build' -$vsixPath = Join-Path $buildDir $VsixName -$msbuildDir = Join-Path $artifactsDir 'msbuild' -$logPath = Join-Path $msbuildDir 'vsix-msbuild.log' -$vsixCsproj = Join-Path $PSScriptRoot 'tooling/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.csproj' -$msbuild = Get-MSBuildPath -$config = Get-BuildConfiguration - -######################## -# Main -######################## - -exec .\build.ps1 initialize - -mkdir $buildDir -ErrorAction Ignore | out-null -mkdir $msbuildDir -ErrorAction Ignore | out-null -mkdir $intermediateDir -ErrorAction Ignore | out-null - -if (!(Test-Path $nugetExePath)) -{ - Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/v4.0.0-rc4/NuGet.exe" -OutFile "$nugetExePath" -} - -exec $nugetExePath restore $vsixCsproj -SolutionDirectory $PSScriptRoot -Verbosity quiet -exec $msbuild $vsixCsproj ` - /v:m ` - /p:DeployExtension=false ` - /fl "/flp:v=D;LogFile=$logPath" ` - /p:TargetVsixContainer=$vsixPath ` - /p:Configuration=$config diff --git a/build/VSIX.targets b/build/VSIX.targets new file mode 100644 index 0000000000..3d5115a829 --- /dev/null +++ b/build/VSIX.targets @@ -0,0 +1,66 @@ + + + $(PackageDependsOn);GenerateVSIX + 3.5.0 + Microsoft.VisualStudio.RazorExtension + $(RepositoryRoot)tooling\$(VSIXName)\$(VSIXName).csproj + + + + + + + + + + + + + + + + + %(MSBuild15ExePaths.FullPath) + + + + + + $(NuGetPackageFolders)nuget.commandline\$(NuGetCommandLineVersion)\tools\nuget.exe + + + + + + + $(ArtifactsDir)msbuild\vsix.log + $(ArtifactsDir)msbuild\vsix.rsp + $(BuildDir)$(VSIXName).vsix + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/repo.targets b/build/repo.targets index 9976ca808d..b56c922230 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -1,8 +1,5 @@ - +