asir66 commented on PR #263:
URL:
https://github.com/apache/teaclave-trustzone-sdk/pull/263#issuecomment-3729528363
This commit performs a structural refactor of cargo-optee to improve
consistency, readability, and long-term maintainability.
Key changes include:
- Extract CLI-related data structures from the main module into a dedicated
cli.rs module, clarifying responsibilities and improving modularity.
- Normalize cargo subcommand behavior by stripping the duplicated `optee`
argument at program entry, aligning with standard Cargo custom subcommand
conventions.
- Introduce `resolve_project_path` to properly resolve and normalize the
project path into an absolute path.
- Unify directory switching logic in both `ca_builder` and `ta_builder`
by using a shared `ChangeDirectoryGuard` from the common module.
- Centralize target configuration handling in the common.rs crate and replace
ad-hoc logic with a strongly-typed enum-based design. A unified
`get_target_and_cross_compile` function is introduced for target
resolution.
- Add a shared `get_target_directory_from_metadata` helper in the common
module to consistently derive the Cargo target directory.
- Introduce `join_and_check` and `join_format_and_check` helpers to safely
join and validate filesystem paths.
- Provide a unified `get_package_name` helper in the common module for
consistent package name resolution across modules.
- Replace boolean flags with a strongly-typed `ComponentType` enum to improve
clarity and extensibility.
- Reorganize functions across modules following a top-down (call-order)
layout to improve code readability.
- Fix CI failures in std mode by adjusting the Cargo.toml configuration of
std-only examples.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]