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

Introduce the build command in the CLI #721

Merged
merged 8 commits into from
Aug 14, 2024

Conversation

saulecabrera
Copy link
Member

This commit introduces a build command in the CLI, which behaves exactly as the compile command and introduces a deprecation warning to the existing compile command.

Additionally, as a preparation for the CLI redesign discussed in #702, this commit introduces a small refactoring of the code generation process, by:

  • Introducing a code generator builder, to abstract and validate all the code generation option combinations.
  • Introducing proper static and dynamic code generator modules, making it easier to divide the responsibilities of each.

The main motivation for the refactoring is to:

  • Make it easier to finalize the CLI redesign.
  • Share code between the compile and build command while they must be equivalent.
  • Make it easier to keep the compile command frozen while it becomes deprecated and at the same time evolve the build command independently.

NB: Given that the compile and build command are exactly the same, and that this change is purely mechanical; this change doesn't introduce integration tests for the build command. The plan is to introduce tests once other options are added to the build command as part of the CLI redesign. Alternatively, tests can be added, however, it would require either duplicating the entire test suite or adding testing infrastructure to minimize duplication, which will increase the size of the change.

Checklist

  • I've updated the relevant CHANGELOG files if necessary. Changes to javy-cli and javy-core do not require updating CHANGELOG files.
  • I've updated the relevant crate versions if necessary. Versioning policy for library crates
  • I've updated documentation including crate documentation if necessary.

This commit introduces a `build` command in the CLI, which behaves
exactly as the compile command and introduces
a deprecation warning to the existing `compile` command.

Additionally, as a preparation for the CLI redesign discussed in
bytecodealliance#702, this commit
introduces a small refactoring of the code generation process, by:

* Introducing a code generator builder, to abstract and validate all the
  code generation option combinations.
* Introducing proper static and dynamic code generator modules, making
  it easier to divide the responsilibities of each.

  The main motivation for the refactoring is to:

  * Make it easier to finalize the CLI redesign.
  * Share code between the `compile` and `build` command while they must
    be equivalent.
  * Make it easier to keep the `compile` command frozen while it becomes
    deprecated and at the same time evolve the `build` command
    independently.

NB: Given that the `compile` and `build` command are exactly the same,
and that this change is purely mechanical; this change doesn't introduce
integration tests for the `build` command. The plan is to introduce
tests once other options are added to the `build` command as part of the
CLI redesign. Alternatively, tests can be added, however, it would
require either duplicating the entire test suite or adding testing
infrastructure to minimize duplication, which will increase the size of
the change.
Copy link
Collaborator

@jeffcharles jeffcharles left a comment

Choose a reason for hiding this comment

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

Looks good!

I think we should also update the help text for compile to indicate it's deprecated and update the README as well.

crates/cli/src/main.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@jeffcharles jeffcharles left a comment

Choose a reason for hiding this comment

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

🚀

@saulecabrera saulecabrera merged commit ff4be7e into bytecodealliance:main Aug 14, 2024
16 checks passed
@saulecabrera saulecabrera deleted the redesign-cli branch August 14, 2024 14:01
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