tools: Remove build_project.py

Bug: 462485280
Change-Id: Ie331b60d98f4d9d38fd93667e9f3e6a49cb7b890
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/examples/+/347172
Reviewed-by: Armando Montanez <amontanez@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
GitOrigin-RevId: 44844bebcb195b3d51978a5af73383b33ed762af
diff --git a/README.md b/README.md
index 61be433..1e4edea 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
 first-time setup script **from cmd.exe**:
 
 ```bat
-curl https://pigweed.googlesource.com/pigweed/sample_project/+/main/tools/setup_windows_prerequisites.bat?format=TEXT > setup_pigweed_prerequisites.b64 && certutil -decode -f setup_pigweed_prerequisites.b64 setup_pigweed_prerequisites.bat && del setup_pigweed_prerequisites.b64
+curl https://pigweed.googlesource.com/pigweed/examples/+/main/tools/setup_windows_prerequisites.bat?format=TEXT > setup_pigweed_prerequisites.b64 && certutil -decode -f setup_pigweed_prerequisites.b64 setup_pigweed_prerequisites.bat && del setup_pigweed_prerequisites.b64
 ```
 
 Then you can run the script with the following command **in cmd.exe**:
@@ -34,7 +34,7 @@
 Once that is done, you can clone this project with the following command:
 
 ```sh
-git clone https://pigweed.googlesource.com/pigweed/sample_project
+git clone https://pigweed.googlesource.com/pigweed/examples
 ```
 
 ### Environment setup
diff --git a/docs/index.rst b/docs/index.rst
index ab049e3..361b66d 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -37,7 +37,7 @@
 
 .. code-block:: batch
 
-   curl https://pigweed.googlesource.com/pigweed/sample_project/+/main/tools/setup_windows_prerequisites.bat?format=TEXT > setup_pigweed_prerequisites.b64 && certutil -decode -f setup_pigweed_prerequisites.b64 setup_pigweed_prerequisites.bat && del setup_pigweed_prerequisites.b64
+   curl https://pigweed.googlesource.com/pigweed/examples/+/main/tools/setup_windows_prerequisites.bat?format=TEXT > setup_pigweed_prerequisites.b64 && certutil -decode -f setup_pigweed_prerequisites.b64 setup_pigweed_prerequisites.bat && del setup_pigweed_prerequisites.b64
 
 Then you can run the script with the following command **in cmd.exe**:
 
@@ -54,7 +54,7 @@
 
 .. code-block:: bash
 
-   git clone https://pigweed.googlesource.com/pigweed/sample_project
+   git clone https://pigweed.googlesource.com/pigweed/examples
 
 Environment setup
 =================
@@ -132,7 +132,7 @@
 
 .. code-block:: bash
 
-   pw build
+   ./pw build
 
 Automatically build on file save
 --------------------------------
diff --git a/pigweed.json b/pigweed.json
index 0b9ea2e..dac285e 100644
--- a/pigweed.json
+++ b/pigweed.json
@@ -34,10 +34,6 @@
     },
     "pw_cli": {
       "plugins": {
-        "build": {
-          "module": "sample_project_tools.build_project",
-          "function": "build_project"
-        },
         "console": {
           "module": "sample_project_tools.console",
           "function": "main"
@@ -46,10 +42,6 @@
           "module": "sample_project_tools.device_sim",
           "function": "main"
         },
-        "watch": {
-          "module": "sample_project_tools.build_project",
-          "function": "watch_project"
-        },
         "flash": {
           "module": "sample_project_tools.flash_device",
           "function": "main"
diff --git a/tools/BUILD.gn b/tools/BUILD.gn
index 4361b56..380c426 100644
--- a/tools/BUILD.gn
+++ b/tools/BUILD.gn
@@ -23,14 +23,12 @@
   ]
   sources = [
     "sample_project_tools/__init__.py",
-    "sample_project_tools/build_project.py",
     "sample_project_tools/console.py",
     "sample_project_tools/device_sim.py",
     "sample_project_tools/flash_device.py",
     "sample_project_tools/presubmit_checks.py",
   ]
   python_deps = [
-    "$dir_pw_build/py",
     "$dir_pw_cli/py",
     "$dir_pw_presubmit/py",
     "$dir_pw_protobuf:common_protos.python",
diff --git a/tools/sample_project_tools/build_project.py b/tools/sample_project_tools/build_project.py
deleted file mode 100644
index a5325a0..0000000
--- a/tools/sample_project_tools/build_project.py
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright 2023 The Pigweed Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-"""Implementation of `pw build` for this project."""
-
-import logging
-from pathlib import Path
-import sys
-
-from pw_build.build_recipe import (
-    BuildCommand,
-    BuildRecipe,
-)
-from pw_build.project_builder_presubmit_runner import (
-    should_gn_gen,
-    main,
-)
-
-
-_LOG = logging.getLogger('pw_build')
-
-
-def build_project(force_pw_watch: bool = False) -> int:
-    """Use pw_build to build this project.
-
-    Defines BuildRecipes and passes them to Pigweed's
-    project_builder_presubmit_runner.main to start a ``pw build`` invocation.
-
-    Returns:
-      An int representing the success or failure status of the build; 0 if
-      successful, 1 if failed.
-
-    Command line usage examples:
-
-    .. code-block:: bash
-       pw build --list
-       pw build --recipe default
-       pw build -C out --watch
-    """
-
-    default_gn_gen_command = [
-        'gn',
-        'gen',
-        '{build_dir}',
-        '--export-compile-commands',
-    ]
-
-    default_bazel_targets = ['//...:all']
-
-    build_recipes = [
-        BuildRecipe(
-            build_dir=Path('out/gn'),
-            title='default',
-            steps=[
-                BuildCommand(
-                    run_if=should_gn_gen,
-                    command=default_gn_gen_command,
-                ),
-                BuildCommand(
-                    build_system_command='ninja',
-                    targets=['default'],
-                ),
-                # Update the Python tooling in the activated environment as a
-                # serialized second step. Running this in parallel with other
-                # Python tasks can cause Python flakes.
-                BuildCommand(
-                    build_system_command='ninja',
-                    targets=['pip_install_sample_project_tools.install'],
-                ),
-            ],
-        ),
-        BuildRecipe(
-            build_dir=Path('out/bazel'),
-            title='bazel',
-            steps=[
-                BuildCommand(
-                    build_system_command='bazel',
-                    build_system_extra_args=[
-                        'build',
-                    ],
-                    targets=default_bazel_targets,
-                ),
-            ],
-        ),
-    ]
-
-    # This project doesn't pass forward presubmit steps as they introduce some
-    # clutter that is more likely to get in the way rather than help users.
-    # If more comprehensive presubmit programs are added, they should be added
-    # to `presubmit_programs` here.
-    return main(
-        build_recipes=build_recipes,
-        default_build_recipe_names=['default'],
-        default_root_logfile=Path('out/build.txt'),
-        force_pw_watch=force_pw_watch,
-    )
-
-
-def watch_project() -> int:
-    """Use ``pw watch`` to build this project."""
-    sys.exit(build_project(force_pw_watch=True))
-
-
-if __name__ == '__main__':
-    sys.exit(build_project())