diff --git a/.github/workflows/Build-And-Test.yml b/.github/workflows/Build-And-Test.yml index db5f95201..6f176ff78 100644 --- a/.github/workflows/Build-And-Test.yml +++ b/.github/workflows/Build-And-Test.yml @@ -39,7 +39,7 @@ jobs: - name: Build MIDebugEngine run: | - ${{ github.workspace }}/eng/Scripts/CI-Build.cmd -c $env:Configuration -t vs + ${{ github.workspace }}/eng/Scripts/CI-Build.cmd -c $env:Configuration env: Configuration: ${{ matrix.configuration }} @@ -71,7 +71,7 @@ jobs: - name: Build MIDebugEngine run: | - ${{ github.workspace }}/eng/Scripts/CI-Build.cmd -t vscode + ${{ github.workspace }}/eng/Scripts/CI-Build.cmd - name: Copy Test Configuration run: | diff --git a/.gitignore b/.gitignore index 6034e0b4e..044173c4c 100755 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ project.lock.json src/*/*.nuget.props src/*/*.nuget.targets .DS_Store +test/CppTests/config.xml diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..5d5cf08d2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dotnet.defaultSolution": "src/MIDebugEngine-Unix.sln" +} \ No newline at end of file diff --git a/build/Debugger.PIAs.Portable.Packages.settings.targets b/build/Debugger.PIAs.Portable.Packages.settings.targets index 3c154ca54..70a2a4758 100644 --- a/build/Debugger.PIAs.Portable.Packages.settings.targets +++ b/build/Debugger.PIAs.Portable.Packages.settings.targets @@ -1,4 +1,6 @@ - + @@ -15,4 +17,8 @@ + + + + \ No newline at end of file diff --git a/docs/Building-outside-of-VS-for-AI.md b/docs/Building-outside-of-VS-for-AI.md index da19eccbc..8d2d8edfe 100644 --- a/docs/Building-outside-of-VS-for-AI.md +++ b/docs/Building-outside-of-VS-for-AI.md @@ -21,16 +21,10 @@ From a VS Developer Command Prompt or after putting `MSBuild.exe` on `PATH`: ```powershell # Debug, VS extension flavor (default) -eng\Scripts\CI-Build.ps1 -Configuration Debug -TargetPlatform vs - -# Debug, VS Code adapter flavor (also publishes OpenDebugAD7 + native deps to -# bin\DebugAdapterProtocolTests\Debug\extension\debugAdapters) -eng\Scripts\CI-Build.ps1 -Configuration Debug -TargetPlatform vscode +eng\Scripts\CI-Build.ps1 -Configuration Debug ``` -The script restores NuGet, builds `MIDebugEngine.sln` with `msbuild`, and (for `-TargetPlatform vscode`) `dotnet publish`es OpenDebugAD7 and stages the adapter under `bin\DebugAdapterProtocolTests\\extension\debugAdapters`. - -If `msbuild.exe` isn't on `PATH`, locate it with vswhere: +The script restores NuGet, builds `MIDebugEngine.sln` with `msbuild`. If `msbuild.exe` isn't on `PATH`, locate it with vswhere: ```powershell $msbuild = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -requires Microsoft.Component.MSBuild -find "MSBuild\**\Bin\MSBuild.exe" @@ -43,7 +37,7 @@ $env:Path = (Split-Path $msbuild) + ';' + $env:Path eng/Scripts/CI-Build.sh ``` -This runs `dotnet build src/MIDebugEngine-Unix.sln` and then `PublishOpenDebugAD7.sh -c Debug -o bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters`. +This runs `dotnet build src/MIDebugEngine-Unix.sln` ## Outputs diff --git a/docs/RunningCppTests-outside-of-VS-for-AI.md b/docs/RunningCppTests-outside-of-VS-for-AI.md index 8109de4ea..9f4da6529 100644 --- a/docs/RunningCppTests-outside-of-VS-for-AI.md +++ b/docs/RunningCppTests-outside-of-VS-for-AI.md @@ -9,11 +9,11 @@ 1. A VSCode-flavor build (see [Building-outside-of-VS-for-AI.md](Building-outside-of-VS-for-AI.md)): ```powershell - eng\Scripts\CI-Build.ps1 -Configuration Debug -TargetPlatform vscode # Windows + eng\Scripts\CI-Build.ps1 # Windows ``` ```bash - eng/Scripts/CI-Build.sh # Linux / macOS + eng/Scripts/CI-Build.sh # Linux / macOS ``` 2. A native toolchain for the test debuggees: @@ -35,7 +35,7 @@ - **macOS:** `lldb-mi` is downloaded by `tools/DownloadLldbMI.sh`; CI does this automatically inside `eng/Scripts/CI-Test.sh`. -3. A `config.xml` next to `CppTests.dll`. Pick the right template from `bin/DebugAdapterProtocolTests//CppTests/TestConfigurations/` and copy it as `config.xml`: +3. A `config.xml` next to `CppTests.csproj`. Pick the right template from `test\CppTests\TestConfigurations` and copy it as `config.xml`: | Platform / debugger | Template | | --- | --- | diff --git a/eng/Scripts/CI-Build.ps1 b/eng/Scripts/CI-Build.ps1 index 9c47c0293..f01aff583 100644 --- a/eng/Scripts/CI-Build.ps1 +++ b/eng/Scripts/CI-Build.ps1 @@ -1,15 +1,7 @@ param( [ValidateSet("Debug", "Release")] [Alias("c")] -[string]$Configuration="Debug", - -[ValidateSet("win-x86", "win-arm64")] -[Alias("r")] -[string]$RID="win-x86", - -[ValidateSet("vs", "vscode")] -[Alias("t")] -[string]$TargetPlatform="vs" +[string]$Configuration="Debug" ) $ErrorActionPreference="Stop" @@ -31,24 +23,4 @@ msbuild $RootPath\src\MIDebugEngine.sln /p:Configuration=$Configuration if ($lastexitcode -ne 0) { throw "Failed to build MIDebugEngine.sln" -} - - -if ($TargetPlatform -eq "vscode") -{ - $dotnetPath = (Get-Command dotnet.exe -ErrorAction Ignore).Path; - - if (!$dotnetPath) { - throw "Missing .NET SDK. Please install the SDK at https://dotnet.microsoft.com/download" - } - - dotnet publish $RootPath\src\OpenDebugAD7\OpenDebugAD7.csproj -c $Configuration -r $RID --self-contained -o $RootPath\bin\DebugAdapterProtocolTests\$Configuration\extension\debugAdapters - if ($lastexitcode -ne 0) - { - throw "Failed to publish OpenDebugAD7" - } - - Copy-Item $RootPath\bin\$Configuration\Microsoft.MIDebugEngine.dll $RootPath\bin\DebugAdapterProtocolTests\$Configuration\extension\debugAdapters/. - Copy-Item $RootPath\bin\$Configuration\Microsoft.MICore.dll $RootPath\bin\DebugAdapterProtocolTests\$Configuration\extension\debugAdapters\. - Copy-Item $RootPath\bin\$Configuration\vscode\WindowsDebugLauncher.exe $RootPath\bin\DebugAdapterProtocolTests\$Configuration\extension\debugAdapters\. } \ No newline at end of file diff --git a/eng/Scripts/CI-Build.sh b/eng/Scripts/CI-Build.sh index 6fb33d77e..2d69ea339 100755 --- a/eng/Scripts/CI-Build.sh +++ b/eng/Scripts/CI-Build.sh @@ -13,9 +13,4 @@ if ! dotnet build "$RootDir"/src/MIDebugEngine-Unix.sln; then exit 1 fi -if ! "$RootDir"/PublishOpenDebugAD7.sh -c Debug -o "$RootDir"/bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters; then - echo "ERROR: Failed to build MIDebugEngine-Unix.sln" - exit 1 -fi - exit 0 \ No newline at end of file diff --git a/src/MIDebugEngine-Unix.sln b/src/MIDebugEngine-Unix.sln index 21a53b902..8dfd0c2a1 100644 --- a/src/MIDebugEngine-Unix.sln +++ b/src/MIDebugEngine-Unix.sln @@ -36,9 +36,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DebugEngineHost.VSCode", "D EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MakePIAPortable", "MakePIAPortable\MakePIAPortable.csproj", "{114039A0-87B5-425B-90C9-6AFC1960A247}" - ProjectSection(ProjectDependencies) = postProject - {CC5BDD33-7EB1-4FB9-BC67-806773018989} = {CC5BDD33-7EB1-4FB9-BC67-806773018989} - EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DebugAdapterProtocolTests", "DebugAdapterProtocolTests", "{9D97EF1A-BCD5-4932-BBCC-98194CF8A841}" EndProject diff --git a/src/MIDebugEngine.sln b/src/MIDebugEngine.sln index 88e672933..7e1c4e476 100755 --- a/src/MIDebugEngine.sln +++ b/src/MIDebugEngine.sln @@ -64,9 +64,6 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsDebugLauncher", "WindowsDebugLauncher\WindowsDebugLauncher.csproj", "{AE7F97CA-DFD2-41BC-B581-98C91C83065C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MakePIAPortable", "MakePIAPortable\MakePIAPortable.csproj", "{114039A0-87B5-425B-90C9-6AFC1960A247}" - ProjectSection(ProjectDependencies) = postProject - {CC5BDD33-7EB1-4FB9-BC67-806773018989} = {CC5BDD33-7EB1-4FB9-BC67-806773018989} - EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MIDebugPackage", "MIDebugPackage\MIDebugPackage.csproj", "{A8D8E02F-4258-4F2E-88B6-A50FEBD5AD8C}" ProjectSection(ProjectDependencies) = postProject diff --git a/src/MakePIAPortable/MakePIAPortable.csproj b/src/MakePIAPortable/MakePIAPortable.csproj index 4c51828d1..da719912c 100644 --- a/src/MakePIAPortable/MakePIAPortable.csproj +++ b/src/MakePIAPortable/MakePIAPortable.csproj @@ -40,6 +40,11 @@ + + + + + diff --git a/test/CppTests/CppTests.csproj b/test/CppTests/CppTests.csproj index fa41fba4e..2d1e06551 100644 --- a/test/CppTests/CppTests.csproj +++ b/test/CppTests/CppTests.csproj @@ -1,4 +1,5 @@ - + + @@ -8,7 +9,16 @@ $(OutputPath)\CppTests - + + + + $(MIEngineRoot)bin\DebugAdapterProtocolTests\$(Configuration)\extension\debugAdapters\ + $(MIDefaultOutputPath)vscode\ + + <_ShouldDeployDebugAdapter>false + <_ShouldDeployDebugAdapter Condition="$(Configuration.Contains('Debug'))">true + + + @@ -42,8 +54,47 @@ + + + + + + + + + <_DebugAdapterSourceFiles Include="$(OpenDebugAD7OutputPath)*" /> + + + <_DebugAdapterDestFiles Include="@(_DebugAdapterSourceFiles->'$(DebugAdaptersDeployPath)%(Filename)%(Extension)')" /> + + + + + + + + + @@ -62,4 +113,43 @@ + + + + + + + + + + + + + + + + + + + + + + + +