alr
Manage Ada language projects
TLDR
Create a binary or library project
Add a dependency to the project
Run the compiled binary (no need to do build before)
Compile the project
SYNOPSIS
alr <command> [<args>...]
PARAMETERS
-h, --help
Display help message for alr or a subcommand.
-V, --version
Print alr version information.
-v, --verbose
Enable verbose output for more detailed execution information.
-q, --quiet
Suppress most output messages, showing only essential information.
-p <path>, --project-dir <path>
Specify the project root directory where the alr configuration is located.
DESCRIPTION
alr is the command-line interface for Alire, the Ada Language Repository. It serves as a comprehensive tool for managing Ada projects, similar to how cargo works for Rust or npm for JavaScript. Its primary functions include initializing new Ada projects, resolving and managing project dependencies, building executables and libraries, and running project-specific tasks such as tests or examples.
alr simplifies the development workflow by abstracting away complex build system configurations (like Makefiles) and ensuring reproducible builds across different environments. It integrates with the GNAT compiler collection and facilitates easy access to a wide range of Ada libraries and components available on Alire. Developers use alr to streamline project setup, manage versioning of dependencies, compile code, and execute their Ada applications. It aims to boost productivity by providing a consistent and intuitive interface for Ada development.
CAVEATS
alr is a build tool specific to the Ada programming language ecosystem and is not a general-purpose Linux command. Its functionality is entirely dependent on the presence of the GNAT (GNU Ada) compiler and the Alire repository for package management. Users without an interest in Ada development will find this command irrelevant. Proper setup of the Ada toolchain and environment variables is crucial for its correct operation.
SUBCOMMAND-DRIVEN INTERFACE
alr primarily operates through a series of subcommands, each performing a specific task. To get help on a specific subcommand, use alr <subcommand> --help.
Key Subcommands Overview:
init: Initializes a new Ada project in the current directory.
add: Adds a dependency to the current project.
build: Compiles the project and its dependencies.
run: Builds and executes the main program of the project.
search: Searches for available packages in the Alire repository.
install: Installs a specific package from Alire into the local cache.
HISTORY
alr is part of the Alire project, which was initiated to provide a modern, centralized package manager for Ada, addressing a long-standing need in the Ada community. Before Alire, Ada projects often relied on custom build scripts or direct invocation of gprbuild. Alire and alr were developed to simplify dependency management and project scaffolding, drawing inspiration from successful tools in other language ecosystems like Rust's cargo. Its development has been driven by the AdaCore company and the broader Ada community, with continuous updates focusing on improving user experience, adding more package management features, and integrating with newer Ada language features. It has rapidly become the de-facto standard for managing contemporary Ada projects.