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
get gpr file from alire.toml via command line #1151
Comments
Is this |
It's not standard. Another possible implementation would be a separate command "alr list-project-files" or similar. I don't need the closure of project files, which I assume to mean the list of all project files included by "with", transitively; just the top project file. Alire supports more than one top project file, so it's still a list, so the name should be GPR_PROJECT_FILES. I have not considered how to support that in Emacs ada-mode. One of my crates has two project files; one for a library and another for the executables. So I'll have to figure this out. |
Your assumptions are correct. Alright, so a list of the top-level project files, with relative paths from the crate root. |
Ideally, we could export all properties in a parsable format (JSON?), including implicit ones, to achieve maximum generality. Although this would require quite some internal refactoring. That could be a long-term goal though, what you need is much simpler. |
Could this be part of |
That's where I'd put it, yes. |
I just discovered the -P option to "alr exec". So this gives me the project file: $ alr exec -P -- echo This does raise the question of which project file does "alr exec -P" use if there is more than one? Testing in my crate with more than one: $ alr exec -P -- echo So that doesn't work. Perhaps "alr exec -P" needs a mechanism to select the project file as well? That means the user would have to be aware of the multiple project files, and what they are for, so they can just as easily specify the project file directly in their command. Similarly, it is convenient in my Emacs application to allow the user to choose which top level gpr file to use, so having the user read the toml file and pick one is not a big problem. |
Yes that's something we can add to exec at some point. |
|
I'm writing an interface to Alire for Emacs. One thing I need to do is use 'gnat ls' to get the source path from the gpr file; to do that I need the name of the gpr file. Currently I'd have to parse the toml file myself to get that.
One possible implementation is to add GPR_PROJECT_FILE to the output of 'alr printenv'.
The text was updated successfully, but these errors were encountered: