From 450729e2d7f98ecb786640229452d3220d2f5772 Mon Sep 17 00:00:00 2001 From: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:37:04 -0700 Subject: [PATCH] Update cookiecutter templates and remove deprecated functionality ahead of v3.5.0 release (#221) * Remove deprecated `new --project` command (now fprime-bootstrap) * Update OSAL init and deployment-named namespaces * Fix spelling --- .../{{cookiecutter.deployment_name}}/Main.cpp | 5 +- ...cookiecutter.deployment_name}}Topology.cpp | 30 ++--- ...cookiecutter.deployment_name}}Topology.hpp | 2 +- ...iecutter.deployment_name}}TopologyDefs.hpp | 24 ++-- .../cookiecutter.json | 7 -- .../hooks/post_gen_project.py | 113 ------------------ .../hooks/pre_gen_project.py | 8 -- .../{{cookiecutter.project_name}}/.gitignore | 15 --- .../CMakeLists.txt | 19 --- .../Components/CMakeLists.txt | 3 - .../{{cookiecutter.project_name}}/README.md | 6 - .../project.cmake | 4 - .../settings.ini | 6 - src/fprime/util/cli.py | 9 -- src/fprime/util/commands.py | 3 - src/fprime/util/cookiecutter_wrapper.py | 44 ------- src/fprime/util/help_text.py | 3 - 17 files changed, 30 insertions(+), 271 deletions(-) delete mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-project/cookiecutter.json delete mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/post_gen_project.py delete mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/pre_gen_project.py delete mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/.gitignore delete mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/CMakeLists.txt delete mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/Components/CMakeLists.txt delete mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/README.md delete mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/project.cmake delete mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/settings.ini diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Main.cpp b/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Main.cpp index 182887f8..d1d053c5 100644 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Main.cpp +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Main.cpp @@ -5,6 +5,8 @@ // ====================================================================== // Used to access topology functions #include <{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}Topology.hpp> +// OSAL initialization +#include // Used for signal handling shutdown #include // Used for command line argument processing @@ -58,6 +60,7 @@ int main(int argc, char* argv[]) { CHAR* hostname = nullptr; U16 port_number = 0; {%- endif %} + Os::init(); // Loop while reading the getopt supplied options {%- if cookiecutter.com_driver_type == "UART" %} @@ -112,7 +115,7 @@ int main(int argc, char* argv[]) { // Setup, cycle, and teardown topology {{cookiecutter.deployment_name}}::setupTopology(inputs); - {{cookiecutter.deployment_name}}::startSimulatedCycle(Fw::Time(1,0)); // Program loop cycling rate groups at 1Hz + {{cookiecutter.deployment_name}}::startSimulatedCycle(Fw::TimeInterval(1,0)); // Program loop cycling rate groups at 1Hz {{cookiecutter.deployment_name}}::teardownTopology(inputs); (void)printf("Exiting...\n"); return 0; diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}Topology.cpp b/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}Topology.cpp index 8e236b65..57b1d6de 100644 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}Topology.cpp +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}Topology.cpp @@ -10,7 +10,6 @@ // Necessary project-specified types #include -#include #include // Used for 1Hz synthetic cycling @@ -19,9 +18,6 @@ // Allows easy reference to objects in FPP/autocoder required namespaces using namespace {{cookiecutter.deployment_name}}; -// Instantiate a system logger that will handle Fw::Logger::logMsg calls -Os::Log logger; - // The reference topology uses a malloc-based allocator for components that need to allocate memory during the // initialization phase. Fw::MallocAllocator mallocator; @@ -63,18 +59,18 @@ enum TopologyConstants { // Ping entries are autocoded, however; this code is not properly exported. Thus, it is copied here. Svc::Health::PingEntry pingEntries[] = { - {PingEntries::blockDrv::WARN, PingEntries::blockDrv::FATAL, "blockDrv"}, - {PingEntries::tlmSend::WARN, PingEntries::tlmSend::FATAL, "chanTlm"}, - {PingEntries::cmdDisp::WARN, PingEntries::cmdDisp::FATAL, "cmdDisp"}, - {PingEntries::cmdSeq::WARN, PingEntries::cmdSeq::FATAL, "cmdSeq"}, - {PingEntries::eventLogger::WARN, PingEntries::eventLogger::FATAL, "eventLogger"}, - {PingEntries::fileDownlink::WARN, PingEntries::fileDownlink::FATAL, "fileDownlink"}, - {PingEntries::fileManager::WARN, PingEntries::fileManager::FATAL, "fileManager"}, - {PingEntries::fileUplink::WARN, PingEntries::fileUplink::FATAL, "fileUplink"}, - {PingEntries::prmDb::WARN, PingEntries::prmDb::FATAL, "prmDb"}, - {PingEntries::rateGroup1::WARN, PingEntries::rateGroup1::FATAL, "rateGroup1"}, - {PingEntries::rateGroup2::WARN, PingEntries::rateGroup2::FATAL, "rateGroup2"}, - {PingEntries::rateGroup3::WARN, PingEntries::rateGroup3::FATAL, "rateGroup3"}, + {PingEntries::{{cookiecutter.deployment_name}}_blockDrv::WARN, PingEntries::{{cookiecutter.deployment_name}}_blockDrv::FATAL, "blockDrv"}, + {PingEntries::{{cookiecutter.deployment_name}}_tlmSend::WARN, PingEntries::{{cookiecutter.deployment_name}}_tlmSend::FATAL, "chanTlm"}, + {PingEntries::{{cookiecutter.deployment_name}}_cmdDisp::WARN, PingEntries::{{cookiecutter.deployment_name}}_cmdDisp::FATAL, "cmdDisp"}, + {PingEntries::{{cookiecutter.deployment_name}}_cmdSeq::WARN, PingEntries::{{cookiecutter.deployment_name}}_cmdSeq::FATAL, "cmdSeq"}, + {PingEntries::{{cookiecutter.deployment_name}}_eventLogger::WARN, PingEntries::{{cookiecutter.deployment_name}}_eventLogger::FATAL, "eventLogger"}, + {PingEntries::{{cookiecutter.deployment_name}}_fileDownlink::WARN, PingEntries::{{cookiecutter.deployment_name}}_fileDownlink::FATAL, "fileDownlink"}, + {PingEntries::{{cookiecutter.deployment_name}}_fileManager::WARN, PingEntries::{{cookiecutter.deployment_name}}_fileManager::FATAL, "fileManager"}, + {PingEntries::{{cookiecutter.deployment_name}}_fileUplink::WARN, PingEntries::{{cookiecutter.deployment_name}}_fileUplink::FATAL, "fileUplink"}, + {PingEntries::{{cookiecutter.deployment_name}}_prmDb::WARN, PingEntries::{{cookiecutter.deployment_name}}_prmDb::FATAL, "prmDb"}, + {PingEntries::{{cookiecutter.deployment_name}}_rateGroup1::WARN, PingEntries::{{cookiecutter.deployment_name}}_rateGroup1::FATAL, "rateGroup1"}, + {PingEntries::{{cookiecutter.deployment_name}}_rateGroup2::WARN, PingEntries::{{cookiecutter.deployment_name}}_rateGroup2::FATAL, "rateGroup2"}, + {PingEntries::{{cookiecutter.deployment_name}}_rateGroup3::WARN, PingEntries::{{cookiecutter.deployment_name}}_rateGroup3::FATAL, "rateGroup3"}, }; /** @@ -180,7 +176,7 @@ void setupTopology(const TopologyState& state) { Os::Mutex cycleLock; volatile bool cycleFlag = true; -void startSimulatedCycle(Fw::Time interval) { +void startSimulatedCycle(Fw::TimeInterval interval) { cycleLock.lock(); bool cycling = cycleFlag; cycleLock.unLock(); diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}Topology.hpp b/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}Topology.hpp index 32445d45..af929f8a 100644 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}Topology.hpp +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}Topology.hpp @@ -73,7 +73,7 @@ void teardownTopology(const TopologyState& state); * * \param milliseconds: milliseconds to delay for each cycle. Default: 1000 or 1Hz. */ -void startSimulatedCycle(Fw::Time interval = Fw::Time(1,0)); +void startSimulatedCycle(Fw::TimeInterval interval = Fw::TimeInterval(1,0)); /** * \brief stop the simulated cycle started by startSimulatedCycle diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}TopologyDefs.hpp b/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}TopologyDefs.hpp index 66d25b58..a49d3e8f 100644 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}TopologyDefs.hpp +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-deployment/{{cookiecutter.deployment_name}}/Top/{{cookiecutter.deployment_name}}TopologyDefs.hpp @@ -52,40 +52,40 @@ struct TopologyState { * ``` */ namespace PingEntries { -namespace blockDrv { +namespace {{cookiecutter.deployment_name}}_blockDrv { enum { WARN = 3, FATAL = 5 }; } -namespace tlmSend { +namespace {{cookiecutter.deployment_name}}_tlmSend { enum { WARN = 3, FATAL = 5 }; } -namespace cmdDisp { +namespace {{cookiecutter.deployment_name}}_cmdDisp { enum { WARN = 3, FATAL = 5 }; } -namespace cmdSeq { +namespace {{cookiecutter.deployment_name}}_cmdSeq { enum { WARN = 3, FATAL = 5 }; } -namespace eventLogger { +namespace {{cookiecutter.deployment_name}}_eventLogger { enum { WARN = 3, FATAL = 5 }; } -namespace fileDownlink { +namespace {{cookiecutter.deployment_name}}_fileDownlink { enum { WARN = 3, FATAL = 5 }; } -namespace fileManager { +namespace {{cookiecutter.deployment_name}}_fileManager { enum { WARN = 3, FATAL = 5 }; } -namespace fileUplink { +namespace {{cookiecutter.deployment_name}}_fileUplink { enum { WARN = 3, FATAL = 5 }; } -namespace prmDb { +namespace {{cookiecutter.deployment_name}}_prmDb { enum { WARN = 3, FATAL = 5 }; } -namespace rateGroup1 { +namespace {{cookiecutter.deployment_name}}_rateGroup1 { enum { WARN = 3, FATAL = 5 }; } -namespace rateGroup2 { +namespace {{cookiecutter.deployment_name}}_rateGroup2 { enum { WARN = 3, FATAL = 5 }; } -namespace rateGroup3 { +namespace {{cookiecutter.deployment_name}}_rateGroup3 { enum { WARN = 3, FATAL = 5 }; } } // namespace PingEntries diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/cookiecutter.json b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/cookiecutter.json deleted file mode 100644 index c215f395..00000000 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/cookiecutter.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "project_name": "MyProject", - "__install_venv": "yes", - "__prompts__": { - "project_name": "Project name" - } -} diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/post_gen_project.py b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/post_gen_project.py deleted file mode 100644 index ee029301..00000000 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/post_gen_project.py +++ /dev/null @@ -1,113 +0,0 @@ -""" -This script is run as a cookiecutter hook after the project is generated. - -It does the following: -- Initializes a git repository -- Adds F' as a submodule -- Checks out the latest release of F' -- Upgrades pip and installs the virtual environment if requested - -@author thomas-bc -""" - -import subprocess -import sys -import requests -from pathlib import Path - -response = requests.get("https://api.github.com/repos/nasa/fprime/releases/latest") -latest_tag_name = response.json()["tag_name"] - -PRINT_VENV_WARNING = False - -# Add F' as a submodule -subprocess.run(["git", "init"]) -print(f"[INFO] Checking out F' submodule at latest release: {latest_tag_name}") -subprocess.run( - [ - "git", - "submodule", - "add", - "--depth", - "1", - "https://github.com/nasa/fprime.git", - ] -) -# Checkout F´ submodules (e.g. googletest) -res = subprocess.run( - ["git", "submodule", "update", "--init", "--recursive"], - capture_output=True, -) -if res.returncode != 0: - print("[WARNING] Unable to initialize submodules. Functionality may be limited.") - -subprocess.run( - ["git", "fetch", "origin", "--depth", "1", "tag", latest_tag_name], - cwd="./fprime", - capture_output=True, -) - -# Checkout requested branch/tag -res = subprocess.run( - ["git", "checkout", latest_tag_name], - cwd="./fprime", - capture_output=True, -) -if res.returncode != 0: - print(f"[ERROR] Unable to checkout tag: {latest_tag_name}. Exit...") - sys.exit(1) # sys.exit(1) indicates failure to cookiecutter - - -# Install venv if requested -if "{{cookiecutter.__install_venv}}" == "yes": - if sys.prefix != sys.base_prefix: - # Upgrade pip - print("[INFO] Upgrading pip...") - subprocess.run( - [Path(sys.prefix) / "bin" / "pip", "install", "--upgrade", "pip"] - ) - # Install requirements.txt - print("[INFO] Installing F´ dependencies...") - subprocess.run( - [ - Path(sys.prefix) / "bin" / "pip", - "install", - "-Ur", - Path("fprime") / "requirements.txt", - ] - ) - else: - # Print warning after the following message so users do not miss it - PRINT_VENV_WARNING = True -else: - print( - "[INFO] requirements.txt has not been installed because you did not request it.", - "Install with `pip install -Ur fprime/requirements.txt`", - ) - -print( - """ -################################################################ - -Congratulations! You have successfully created a new F´ project. - -A git repository has been initialized and F´ has been added as a -submodule, you can now create your first commit. - -Get started with your F´ project: - --- Generate a new component -- -fprime-util new --component - --- Generate a new deployment -- -fprime-util new --deployment - -################################################################ -""" -) - -if PRINT_VENV_WARNING: - print( - "[WARNING] requirements.txt has not been installed because you are not running in a virtual environment.", - "Install with `pip install -Ur fprime/requirements.txt`", - ) diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/pre_gen_project.py b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/pre_gen_project.py deleted file mode 100644 index 9eb92453..00000000 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/pre_gen_project.py +++ /dev/null @@ -1,8 +0,0 @@ -from fprime.util.cookiecutter_wrapper import is_valid_name - -name = "{{ cookiecutter.project_name }}" - -if is_valid_name(name) != "valid": - raise ValueError( - f"Unacceptable project name: {name}. Do not use spaces or special characters" - ) diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/.gitignore b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/.gitignore deleted file mode 100644 index 62de17db..00000000 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# fprime items -logs/ -cmake-build-* -build-artifacts/ -build-fprime-* -*-template -*.template.cpp -*.template.hpp - -# Misc -/venv/ -/.idea/ -/.vscode/ -.DS_Store -*.gcov diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/CMakeLists.txt b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/CMakeLists.txt deleted file mode 100644 index 34cbb633..00000000 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -#### -# This sets up the build system for the '{{cookiecutter.project_name}}' project, including -# components and deployments from project.cmake. In addition, it imports the core F Prime components. -#### - -cmake_minimum_required(VERSION 3.13) -project({{cookiecutter.project_name}} C CXX) - -### -# F' Core Setup -# This includes all of the F prime core components, and imports the make-system. -### -include("${CMAKE_CURRENT_LIST_DIR}/fprime/cmake/FPrime.cmake") -# NOTE: register custom targets between these two lines -include("${FPRIME_FRAMEWORK_PATH}/cmake/FPrime-Code.cmake") - - -# This includes project-wide objects -include("${CMAKE_CURRENT_LIST_DIR}/project.cmake") diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/Components/CMakeLists.txt b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/Components/CMakeLists.txt deleted file mode 100644 index 5fa1a86d..00000000 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/Components/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Include project-wide components here - -# add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/MyComponent") diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/README.md b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/README.md deleted file mode 100644 index c762afd5..00000000 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# {{cookiecutter.project_name}} F' project - -This project was auto-generated by the F' utility tool. - -F´ (F Prime) is a component-driven framework that enables rapid development and deployment of spaceflight and other embedded software applications. -**Please Visit the F´ Website:** https://nasa.github.io/fprime/. diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/project.cmake b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/project.cmake deleted file mode 100644 index ba74208c..00000000 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/project.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# This CMake file is intended to register project-wide objects. -# This allows for reuse between deployments, or other projects. - -add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Components") diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/settings.ini b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/settings.ini deleted file mode 100644 index 7b336233..00000000 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/{{cookiecutter.project_name}}/settings.ini +++ /dev/null @@ -1,6 +0,0 @@ -[fprime] -project_root: . -framework_path: ./fprime - -default_cmake_options: FPRIME_ENABLE_FRAMEWORK_UTS=OFF - FPRIME_ENABLE_AUTOCODER_UTS=OFF \ No newline at end of file diff --git a/src/fprime/util/cli.py b/src/fprime/util/cli.py index 1c401011..48590007 100644 --- a/src/fprime/util/cli.py +++ b/src/fprime/util/cli.py @@ -61,8 +61,6 @@ def skip_build_loading(parsed): """Determines if the build load step should be skipped. Commands that do not require a build object should manually be added here by the developer. """ - if parsed.command == "new" and parsed.new_project: - return True if parsed.command == "version-check": return True return False @@ -174,13 +172,6 @@ def add_special_parsers( dest="new_module", help="Generate a new module", ) - new_exclusive.add_argument( - "--project", - default=False, - action="store_true", - dest="new_project", - help="Generate a new project", - ) new_exclusive.add_argument( "--subtopology", default=False, diff --git a/src/fprime/util/commands.py b/src/fprime/util/commands.py index 7d2700bf..f27b2dcc 100644 --- a/src/fprime/util/commands.py +++ b/src/fprime/util/commands.py @@ -23,7 +23,6 @@ new_component, new_deployment, new_module, - new_project, new_subtopology, ) @@ -137,8 +136,6 @@ def run_new( return new_deployment(build, parsed) if parsed.new_module: return new_module(build, parsed) - if parsed.new_project: - return new_project(parsed) if parsed.new_subtopology: return new_subtopology(build, parsed) raise NotImplementedError( diff --git a/src/fprime/util/cookiecutter_wrapper.py b/src/fprime/util/cookiecutter_wrapper.py index ed9a57ea..dc873b8c 100644 --- a/src/fprime/util/cookiecutter_wrapper.py +++ b/src/fprime/util/cookiecutter_wrapper.py @@ -267,50 +267,6 @@ def new_module(build: Build, parsed_args: "argparse.Namespace"): return 0 -def new_project(parsed_args: "argparse.Namespace"): - """Creates a new F' project""" - - print( - "[DEPRECATED] This command is deprecated and will be removed in a future release." - " Please use `fprime-bootstrap project` instead." - " Install fprime-bootstrap with `pip install fprime-bootstrap`," - " or refer to https://nasa.github.io/fprime/INSTALL.html" - ) - - # Check if Git is installed and available - needed for cloning F' as submodule - if not shutil.which("git"): - print( - "[ERROR] Git is not installed or in PATH. Please install Git and try again.", - file=sys.stderr, - ) - return 1 - - source = ( - os.path.dirname(__file__) - + "/../cookiecutter_templates/cookiecutter-fprime-project" - ) - try: - cookiecutter( - source, - overwrite_if_exists=parsed_args.overwrite, - output_dir=parsed_args.path, - extra_context={"__install_venv": "no" if parsed_args.no_venv else "yes"}, - ) - except OutputDirExistsException as out_directory_error: - print( - f"{out_directory_error}. Use --overwrite to overwrite (will not delete non-generated files).", - file=sys.stderr, - ) - return 1 - except FileNotFoundError as e: - print( - f"{e}. Permission denied to write to the directory.", - file=sys.stderr, - ) - return 1 - return 0 - - def register_with_cmake(gen_path: Path, proj_root: Path, cmake_root: Path): cmake_file = find_nearest_cmake_file(gen_path, cmake_root, proj_root) if cmake_file is None or not add_to_cmake( diff --git a/src/fprime/util/help_text.py b/src/fprime/util/help_text.py index 0cbc17d6..b600c562 100644 --- a/src/fprime/util/help_text.py +++ b/src/fprime/util/help_text.py @@ -282,9 +282,6 @@ '{EXECUTABLE} new' runs a wizard to create new objects in fprime (component, deployment, project). Usage: - -- New Project -- - Generating a new project is now available through the fprime-bootstrap package. Please see the F´ Install Guide - at https://nasa.github.io/fprime/INSTALL.html for instructions on how to install and use fprime-bootstrap. -- New Deployment -- Generate a new F' deployment within a F' project. The new deployment command is expected to be ran at the root of the project and will create a new deployment in the current directory. Using --overwrite will overwrite only the