From 96cf2a58da4d7ca068c8a5b641da99fa1bfc2a89 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 11 Jun 2026 09:12:10 -0500 Subject: [PATCH 1/2] [build] Remove omnisharp.json generation from xaprepare The Get_Omnisharp_Json step in Step_GenerateFiles substituted two placeholders into build-tools/scripts/omnisharp.json.in and wrote an omnisharp.json file at the repo root for OmniSharp / VS Code C# extension users. The generated file was always .gitignored and nothing in the repo, build, or CI consumes it -- it was purely a local-dev convenience. Anyone who actually wants an omnisharp.json can keep their own local copy (it remains gitignored). Removing the generation slice is another small step in the slow xaprepare reduction, following the same pattern as PRs #11568, #11580, #11608, and #11613. Audit before / after: ``git grep -in omnisharp`` previously returned five hits and now returns only one -- the unrelated MSBuild context guard in xaprepare.csproj that prevents xaprepare''s targets from importing under OmniSharp''s MSBuild process. That guard is intentional and is left untouched. Changes: - Step_GenerateFiles.cs: drop the Get_Omnisharp_Json (context) entry from the generated-files list and delete the Get_Omnisharp_Json method. - Delete build-tools/scripts/omnisharp.json.in. - Remove /omnisharp.json from .gitignore (the file is no longer produced). The shared properties used by the deleted method (MicrosoftDotnetSdkInternalPackageVersion, DotNetPreviewPath) are still referenced by Step_InstallDotNetPreview and xaprepare.targets, so they remain. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .gitignore | 1 - build-tools/scripts/omnisharp.json.in | 17 ----------------- .../xaprepare/Steps/Step_GenerateFiles.cs | 17 ----------------- 3 files changed, 35 deletions(-) delete mode 100644 build-tools/scripts/omnisharp.json.in diff --git a/.gitignore b/.gitignore index 61bad7b5f60..fd24ee2b631 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,6 @@ tests/api-compatibility/reference/*/*.cs Novell *.patch *.keystore -/omnisharp.json src/native/CMakePresets.json src/native/clr/pinvoke-override/generate-pinvoke-tables src/native/clr/pinvoke-override/pinvoke-tables.include.generated diff --git a/build-tools/scripts/omnisharp.json.in b/build-tools/scripts/omnisharp.json.in deleted file mode 100644 index 78928630285..00000000000 --- a/build-tools/scripts/omnisharp.json.in +++ /dev/null @@ -1,17 +0,0 @@ -{ - "msbuild": { - "loadProjectsOnDemand": true, - "Configuration": "@CONFIGURATION@" - }, - - "RenameOptions": { - "RenameInComments": false, - "RenameOverloads": true, - "RenameInStrings": false - }, - - "sdk": { - "IncludePreleases": true, - "Path": "@DOTNET_SDK_PATH@" - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs index d3671362bc3..789268275d1 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs @@ -68,7 +68,6 @@ protected override async Task Execute (Context context) Get_Cmake_Presets (context), Get_Ndk_projitems (context), Get_XABuildConfig_cs (context), - Get_Omnisharp_Json (context), }; } } @@ -255,22 +254,6 @@ GeneratedFile Get_Ndk_projitems (Context context) ); } - public GeneratedFile Get_Omnisharp_Json (Context context) - { - const string OutputFileName = "omnisharp.json"; - - var replacements = new Dictionary (StringComparer.Ordinal) { - { "@CONFIGURATION@", context.Configuration }, - { "@DOTNET_SDK_PATH@", Path.Combine (Configurables.Paths.DotNetPreviewPath, "sdk", context.Properties.GetRequiredValue (KnownProperties.MicrosoftDotnetSdkInternalPackageVersion)) }, - }; - - return new GeneratedPlaceholdersFile ( - replacements, - Path.Combine (Configurables.Paths.BuildToolsScriptsDir, $"{OutputFileName}.in"), - Path.Combine (BuildPaths.XamarinAndroidSourceRoot, OutputFileName) - ); - } - public GeneratedFile Get_SourceLink_Json (Context context) { if (gitSubmodules == null || xaCommit == null) { From 88afb8dacfe730e0cb5362a9a54fab43af66e0e3 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Fri, 12 Jun 2026 08:21:40 -0500 Subject: [PATCH 2/2] Restore /omnisharp.json to .gitignore Keep the gitignore entry so contributors can drop their own local omnisharp.json without it showing up in `git status`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fd24ee2b631..61bad7b5f60 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ tests/api-compatibility/reference/*/*.cs Novell *.patch *.keystore +/omnisharp.json src/native/CMakePresets.json src/native/clr/pinvoke-override/generate-pinvoke-tables src/native/clr/pinvoke-override/pinvoke-tables.include.generated