diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..33df1aa --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,28 @@ +name: Pull Request + +on: + pull_request: + branches: [ main ] + +jobs: + windows_build: + strategy: + matrix: + configuration: [Debug, Release] + + runs-on: windows-2019 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup NuGet.exe for use with actions + uses: NuGet/setup-nuget@v1.0.5 + + - name: Build.cmd + run: ${{ github.workspace }}\build.cmd /p:Configuration=$env:Configuration + env: + Configuration: ${{ matrix.configuration }} + diff --git a/BuildAndTest.proj b/BuildAndTest.proj deleted file mode 100644 index 0fcb1de..0000000 --- a/BuildAndTest.proj +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - Debug - $(MSBuildThisFileDirectory)bin\$(Configuration)\ - $(MSBuildThisFileDirectory)NuGet\NuGet.exe - $(MSBuildThisFileDirectory)Iris\ - $(MSBuildThisFileDirectory)HelloWorld\ - - Build;Test - - - - - -
- - - - - - - maxTries) - { - throw; - } - else - { - Log.LogMessage(MessageImportance.High, "Download failed, retrying: {0}", e.Message); - } - } - } - - try - { - if (!File.Exists(FileName)) - File.Move(tempFile, FileName); - } - finally - { - if (File.Exists(tempFile)) - File.Delete(tempFile); - } - ]]> - - - - - - - Configuration=$(Configuration);Platform=Any CPU - - - Configuration=$(Configuration);Platform=Win32 - - - Configuration=$(Configuration);Platform=x86 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 02e7c40..91a258e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,6 @@ ## ConcordExtensibilitySamples Visual Studio Debug Engine Extensibility Samples -Build | Status ------------- | ------------- -Release | [![Build Status](https://ci.dot.net/job/Microsoft_ConcordExtensibilitySamples/job/master/job/windows_release/badge/icon)](https://ci.dot.net/job/Microsoft_ConcordExtensibilitySamples/job/master/job/windows_release/) -Debug | [![Build Status](https://ci.dot.net/job/Microsoft_ConcordExtensibilitySamples/job/master/job/windows_debug/badge/icon)](https://ci.dot.net/job/Microsoft_ConcordExtensibilitySamples/job/master/job/windows_debug/) - - ### What are "Concord Extensibility Samples"? [Concord](https://github.com/Microsoft/ConcordExtensibilitySamples/wiki/Overview) is the code name for Visual Studio's new debug engine that first shipped in Visual Studio 2012. Concord was designed to be extensible and this repo contains samples of these extensions. diff --git a/build.cmd b/build.cmd index dcff2a1..487dc8f 100644 --- a/build.cmd +++ b/build.cmd @@ -1,6 +1,11 @@ @echo off setlocal +if "%~1"=="/?" goto :Help +if "%~1"=="-?" goto :Help +if "%~1"=="-h" goto :Help +set AdditionalBuildArgs=%* + if NOT "%VSINSTALLDIR%"=="" goto InDevPrompt set x86ProgramFiles=%ProgramFiles(x86)% @@ -8,23 +13,68 @@ if "%x86ProgramFiles%"=="" set x86ProgramFiles=%ProgramFiles% set VSWherePath=%x86ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe if NOT exist "%VSWherePath%" echo ERROR: Could not find vswhere.exe (%VSWherePath%). Ensure that Visual Studio 2017 version 15.5 or newer is installed. & exit /b -1 -for /f "usebackq tokens=1 delims=" %%a in (`"%VSWherePath%" -version [15.0, -prerelease -property installationPath`) do call :ProcessIDE "%%a" +for /f "usebackq tokens=1 delims=" %%a in (`"%VSWherePath%" -version [16.0, -prerelease -requires Microsoft.VisualStudio.Workload.NativeDesktop;Microsoft.VisualStudio.Workload.VisualStudioExtension;Microsoft.VisualStudio.Workload.ManagedDesktop -property installationPath`) do call :ProcessIDE "%%a" if NOT "%VSINSTALLDIR%"=="" goto InDevPrompt echo ERROR: Unable to find a Visual Studio install. exit /b -1 :InDevPrompt -set _buildproj=%~dp0BuildAndTest.proj -set _buildlog=%~dp0msbuild.log -set MSBuildCmd=msbuild "%_buildproj%" /nologo /maxcpucount /nodeReuse:false %* +pushd %~dp0 +del /s msbuild.log 2>NUL +set BuildError= +call :SetNugetPath nuget.exe +call :RestoreFromSLN Iris\Iris.sln +call :RestoreFromSLN HelloWorld\cs\HelloWorld.sln +call :RestoreFromPackagesConfig CppCustomVisualizer\dll\packages.config CppCustomVisualizer\packages +call :RestoreFromPackagesConfig HelloWorld\Cpp\dll\packages.config HelloWorld\Cpp\packages +call :Build Iris\Iris.sln Iris "Any CPU" +call :Build HelloWorld\cs\HelloWorld.sln CsHelloWorld "Any CPU" +call :Build HelloWorld\cpp\HelloWorld.sln CppHelloWorld Win32 +call :Build CppCustomVisualizer\CppCustomVisualizer.sln CppCustomVisualizer x86 + +if NOT "%BuildError%"=="" exit /b -1 +echo build.cmd completed successfully. +exit /b 0 + +:RestoreFromPackagesConfig +if NOT "%BuildError%"=="" goto :EOF +set NugetCmd="%NUGET_EXE%" restore %1 -PackagesDirectory %2 +echo %NugetCmd% +call %NugetCmd% +if NOT "%ERRORLEVEL%"=="0" echo ERROR: build.cmd: Restoring %1 failed.& set BuildError=1 +goto :EOF + +:RestoreFromSLN +if NOT "%BuildError%"=="" goto :EOF +set NugetCmd="%NUGET_EXE%" restore %1 +echo %NugetCmd% +call %NugetCmd% +if NOT "%ERRORLEVEL%"=="0" echo ERROR: build.cmd: Restoring %1 failed.& set BuildError=1 +goto :EOF + +:Build +if NOT "%BuildError%"=="" goto :EOF +REM NOTE: To enable binary logs, add: `/bl:%2.binlog` after `%1` +set MSBuildCmd=msbuild.exe %1 /nologo /maxcpucount /nodeReuse:false /p:Platform=%3 %AdditionalBuildArgs% echo %MSBuildCmd% call %MSBuildCmd% -set BUILDERRORLEVEL=%ERRORLEVEL% +if NOT "%ERRORLEVEL%"=="0" echo ERROR: build.cmd: Building %1 failed.& set BuildError=1 +goto :EOF + +:SetNugetPath +set NUGET_EXE=%~$PATH:1 +if NOT "%NUGET_EXE%"=="" goto :EOF +if exist obj\nuget.exe set NUGET_EXE=%~dp0obj\nuget.exe& goto :EOF -echo Build Exit Code = %BUILDERRORLEVEL% -exit /b %BUILDERRORLEVEL% +if not exist obj mkdir obj +call powershell.exe -NoProfile -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile obj\nuget.exe" +if NOT "%ERRORLEVEL%"=="0" echo ERROR: build.cmd: Downloading nuget.exe failed.& set BuildError=1& goto :EOF +if NOT exist obj\nuget.exe echo ERROR: build.cmd: nuget.exe is unexpectedly missing.& set BuildError=1& goto :EOF + +set NUGET_EXE=%~dp0obj\nuget.exe +goto :EOF :ProcessIDE if NOT "%VSINSTALLDIR%"=="" goto :EOF @@ -32,3 +82,10 @@ if NOT exist "%~1\Common7\Tools\VsDevCmd.bat" goto :EOF echo Using Visual Studio from %1 call "%~1\Common7\Tools\VsDevCmd.bat" goto :EOF + +:Help +echo Build.cmd [Additional msbuild arguments] +echo. +echo This script restores and builds all projects in this repo. +echo. +echo Example usage: build.cmd /p:Configuration=Debug \ No newline at end of file diff --git a/netci.groovy b/netci.groovy deleted file mode 100644 index 4e5d8d2..0000000 --- a/netci.groovy +++ /dev/null @@ -1,38 +0,0 @@ -// Import the utility functionality. -import jobs.generation.Utilities; -import jobs.generation.JobReport; - -def project = GithubProject -def branch = GithubBranchName - -// Generate the builds for debug and release, commit and PRJob -[true, false].each { isPR -> // Defines a closure over true and false, value assigned to isPR - ['Debug', 'Release'].each { configuration -> - // Determine the name for the new job. The first parameter is the project, - // the second parameter is the base name for the job, and the last parameter - // is a boolean indicating whether the job will be a PR job. If true, the - // suffix _prtest will be appended. - def newJobName = Utilities.getFullJobName(project, "windows_${configuration.toLowerCase()}", isPR) - - // Create a new job with the specified name. The brace opens a new closure - // and calls made within that closure apply to the newly created job. - def newJob = job(newJobName) { - steps { - batchFile("call build.cmd /p:Configuration=${configuration}") - } - } - - Utilities.setMachineAffinity(newJob, 'Windows_NT', 'latest-or-auto') - Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}") - // Archive only on commit builds. - if (isPR) { - Utilities.addGithubPRTriggerForBranch(newJob, branch, "Windows ${configuration}") - } - else { - Utilities.addGithubPushTrigger(newJob) - } - } -} - -// Generate the job report -JobReport.Report.generateJobReport(out) \ No newline at end of file