Skip to content

Commit

Permalink
Remove deprecated new --project command (now fprime-bootstrap)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-bc committed Oct 14, 2024
1 parent 439c38c commit 0ba8036
Show file tree
Hide file tree
Showing 16 changed files with 3 additions and 243 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions src/fprime/util/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions src/fprime/util/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
new_component,
new_deployment,
new_module,
new_project,
new_subtopology,
)

Expand Down Expand Up @@ -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(
Expand Down
44 changes: 0 additions & 44 deletions src/fprime/util/cookiecutter_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 0 additions & 3 deletions src/fprime/util/help_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ba8036

Please sign in to comment.