From 1ad2d35fe9b97ea2d0f3d2752dc965dcd47b6b4f Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 4 Jun 2026 18:39:14 -0500 Subject: [PATCH 1/2] [build] Remove unused bin/configuration.mk `bin/configuration.mk` existed only to persist `CONFIGURATION=` between Unix `make` invocations. CI passes `CONFIGURATION=...` explicitly on every `make` call, and `build.sh` never sets it (so a fresh checkout always hit the `CONFIGURATION ?= Debug` default anyway). Dropping the include lets us delete the only meaningful contents of `Step_GenerateFiles.Unix.cs`, continuing the slow removal of xaprepare. - Drop `-include bin/configuration.mk` from the top of `Makefile`. The `CONFIGURATION ?= Debug` fallback is unchanged. - Delete `build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.Unix.cs` entirely. The `partial void AddUnixPostBuildSteps (...)` declaration in `Step_GenerateFiles.cs` is left as a no-op (legal C#); the call site becomes a zero-cost no-op. `Step_GenerateFiles.Windows.cs` implements a different partial (`AddOSSpecificSteps`) and is unaffected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Makefile | 2 -- .../Steps/Step_GenerateFiles.Unix.cs | 33 ------------------- 2 files changed, 35 deletions(-) delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.Unix.cs diff --git a/Makefile b/Makefile index 06c3078f549..85c28361c68 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ --include bin/configuration.mk - V ?= 0 prefix = /usr/local CONFIGURATION ?= Debug diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.Unix.cs b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.Unix.cs deleted file mode 100644 index 4389ac9e0b6..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.Unix.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - partial class Step_GenerateFiles - { - sealed class GeneratedConfigurationFile : GeneratedFile - { - public GeneratedConfigurationFile (string outputPath) : - base(outputPath) - {} - - public override void Generate (Context context) - { - if (context == null) - throw new ArgumentNullException (nameof (context)); - - using (StreamWriter sw = Utilities.OpenStreamWriter (OutputPath)) { - sw.WriteLine ("# This file is used by both Make and shell scripts"); - sw.WriteLine ($"CONFIGURATION={context.Configuration}"); - sw.Flush (); - } - } - } - - partial void AddUnixPostBuildSteps (Context context, List steps) - { - steps.Add (new GeneratedConfigurationFile (Path.Combine (Configurables.Paths.BinDirRoot, "configuration.mk"))); - } - } -} From 5a770f416c0b678e43022ff0c8e94488235cb362 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 4 Jun 2026 18:42:37 -0500 Subject: [PATCH 2/2] Drop now-dead AddUnixPostBuildSteps partial After deleting `Step_GenerateFiles.Unix.cs`, the `partial void AddUnixPostBuildSteps (...)` declaration and its call site in `Step_GenerateFiles.cs` were no-ops. Remove them so the file no longer references a vestige of the `bin/configuration.mk` generator. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs index b7f75ef39f1..255c181ee75 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs @@ -81,12 +81,10 @@ protected override async Task Execute (Context context) }; AddOSSpecificSteps (context, steps); - AddUnixPostBuildSteps (context, steps); return steps; } - partial void AddUnixPostBuildSteps (Context context, List steps); partial void AddOSSpecificSteps (Context context, List steps); GeneratedFile Get_Cmake_XA_Build_Configuration (Context context)