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

ApiContext, scons arguments, Modify command, and _build directory. #469

Merged
merged 22 commits into from
Nov 21, 2024

Conversation

zapta
Copy link
Collaborator

@zapta zapta commented Nov 20, 2024

This PR contains assorted commits, for the details description please see the individual commits.

The highlights of this PR:

  • Resources is now called ApiContext and it's the main object that is created once at the beginning of each command and is passed only. Access to resources, project, and so on is done via that object.

  • Refactored the scons argument logic. process_arguments now uses instances of a new class called Arg to hold the each argument. I plan to do another path of cleanup there once we apio.ini becomes required and we eliminate commands options such as --size and --fpga.

  • Marked the 'apio modify' command as deprecated, no change in functionality. With the upcoming elevation of apio.ini to a required source of truth and the planned additional configuration fields, users are expected to edit apio.ini manually, similar to platformio.ini.

  • Following the platformio's convention, all build and artifact files are now placed in a subdirectory called _build (platformio uses .build) under the project dir.

  • Split the apio boards command into apio boards that lists boards and apio fpgas that prints fpgas.

zapta added 17 commits November 18, 2024 06:39
…eration for

renaming resources to api_context. No change in behavior.
renamem resources.py in a follow up change.
…AGES_DIR

to have in its absolute path the word 'packages' (case insensitive).

The motivation is to avoid unintentional mass deletion by the
rmtree operation of the packges fixer.
From:
   Active env options ['APIO_HOME_DIR', 'APIO_PLATFORM']
To:
   Active env options [APIO_HOME_DIR, APIO_PLATFORM]
This is a convention only and should not affect functionality.
Motivation is code simplicity. Before they were created structued and
then flatten before passing to scons. Now they are flag from the
begining.
…ented

using 'smart args' represented by class instances (used to be simple strings).
Hopefully this make the code clearer and safer.

Will do another pass of cleanup once we make apio.ini mandatory and delete
the unnecessary flags.
is conditional on the project_scope arg. Some operations such as 'apio create'
do not need to load the project (which may not exist yet). Similar to setup
programs such as apio install and apio drivers.
a property to get the project info after a verification that it's loaded.
@zapta zapta changed the title ApiContext and scons arguments related changes. ApiContext, scons arguments, and Apio Modify command related changes. Nov 20, 2024
called _build, under the project dir. This follows platformio's
convention of seperating between sources and artifact files and simplifies
setting a simple and stable .gitignore file.

I tested it on darwin_arm64 but to test it on a windows box I need to
submit it first.
@zapta zapta changed the title ApiContext, scons arguments, and Apio Modify command related changes. ApiContext, scons arguments, Modify command, and _build directory. Nov 20, 2024
@Obijuan Obijuan merged commit ec63a6c into FPGAwars:develop Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants