Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Component (FPP) generation feature #125

Merged
merged 20 commits into from
Apr 15, 2023

Conversation

thomas-bc
Copy link
Contributor

Originating Project/Creator
Affected Component
Affected Architectures(s) fprime-util new
Related Issue(s) #37 nasa/fprime#1961
Has Unit Tests (y/n)
Builds Without Errors (y/n) y
Unit Tests Pass (y/n)
Documentation Included (y/n) y

Change Description

fprime-util new --component changed to generate FPP instead of XML.

Future work

Ports are much much easier to create in FPP than in XML and probably do not require a new --port functionality. Should we get rid of it? Michael you mentioned a new --module idea instead.

@thomas-bc thomas-bc added the enhancement New feature or request label Apr 14, 2023
@thomas-bc thomas-bc requested a review from LeStarch April 14, 2023 18:16
def add_to_cmake(list_file: Path, comp_path: Path):
"""Adds new component or port to CMakeLists.txt"""
print(f"[INFO] Found CMakeLists.txt at '{list_file}'")
def add_to_cmake(list_file: Path, comp_path: Path, project_root: Path = None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function doesn't look like it will work with arbitrary CMake structure.

e.g. it only works with the parent cmake list, not project.cmake nor if there are empty directories in between.

In other implementations of this we have recursed upward to project root looking for:

  1. If project.cmake then add to it
  2. Else if CMakeLists.txt then add to it
  3. Else, repeat on parent directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added my take at implementing this, let me know how that looks

src/fprime/util/cookiecutter_wrapper.py Show resolved Hide resolved
@thomas-bc thomas-bc requested a review from LeStarch April 14, 2023 22:46
@LeStarch LeStarch merged commit 05b5c5f into nasa:devel Apr 15, 2023
@thomas-bc thomas-bc deleted the feat/new-component branch October 11, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants