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

Enhance compile subcommand functionality for projects #2067

Closed
jonaprieto opened this issue May 10, 2023 · 1 comment
Closed

Enhance compile subcommand functionality for projects #2067

jonaprieto opened this issue May 10, 2023 · 1 comment
Labels
CLI enhancement New feature or request
Milestone

Comments

@jonaprieto
Copy link
Collaborator

jonaprieto commented May 10, 2023

Let us enhance the compile subcommand to work seamlessly with the main field in juvix.yaml as requested here,

but exhibiting a behavior similar to that described for the typecheck subcommand.

Expected behavior:

  • If no arguments are given, it should compile the entry file specified in the main field in
    juvix.yaml (fail if there is no main field in juvix.yaml with a useful error message like
    "No entry file specified in juvix.yaml" and if juvix.yaml does not exist, saying "No
    juvix.yaml found in current directory, maybe you want to run juvix init?")
$ juvix compile
  • If a path is provided, it should compile the project at that location (similarly to above)
$ juvix compile ./my-project

Note that one might tend to use . as the path to compile the current directory.

  • If a filepath is given, it should compile the specified file. (Nothing should be done here,
    as this is already implemented.)
$ juvix compile ./my-project/src/Main.juvix
@jonaprieto jonaprieto added CLI enhancement New feature or request labels May 10, 2023
@jonaprieto jonaprieto added this to the 0.4 - Prague milestone May 10, 2023
jonaprieto added a commit that referenced this issue May 24, 2023
- Closes #2067

This pr adds the field `main` to `juvix.yaml`. This field is optional
and should contain a path to a juvix file that is meant to be used for
the `compile` (and `dev compile`) command when no file is given as an
argument in the CLI. This makes it possible to simply run `juvix
compile` if the `main` is specified in the `jvuix.yaml`.

I have updated the `juvix.yaml` of the milestone examples.

---------

Co-authored-by: Paul Cadman <git@paulcadman.dev>
Co-authored-by: Jonathan Cubides <jonathan.cubides@uib.no>
@jonaprieto jonaprieto reopened this May 24, 2023
@jonaprieto
Copy link
Collaborator Author

Closed by

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant