Using An AURA Package¶
The classic “hello world” example is pretty exciting the first time, but it gets old pretty quick. Let’s add a bit of flair by making the text more colorful and more bold.
To do that, we’ll use a third-party subsystem package called “CLI”, from ANNEXI-STRAYLINE’s ASAP repository.
Using a Third-Party Subsystem¶
Let’s modify hello.adb to use the CLI third-party subsystem package from ANNEXI-STRAYLINE’s ASAP repo. This package gives us a bunch of tools for making more effective CLI applications.
with CLI; use CLI;
procedure Hello is
begin
Put_Line ("Hello, world!", Style => Bold + Blue_FG);
end Hello;
If we run aura run hello
now, the AURA CLI will complain that it cannot find the missing subsystem for “cli”.
Lets fix this by adding the ASAP repository.
Adding a Repository¶
Note
Repository management is planned to be integrated into the AURA CLI in the future, but at the present time, repositories must be configured manually.
As we will see, that is really not difficult!
Repositories are defined by simple Ada package specifications. Repository 1 is a special repository that is automatically generated by the AURA CLI and basically refers to the project itself. Therefore we will need to create a repository configuration for Repository 2.
See also
To learn more about how AURA repositories work, and what is special about Repository 1, please see the repositories explainer.
Lets create the repository for AURA by creating the aura-repository_2.ads package spec:
package AURA.Repository_2 with Pure is
Format : constant Repository_Format := git;
Location : constant String := "https://github.com/annexi-strayline/ASAP.git";
Tracking_Branch: constant String := "stable-0.1";
end AURA.Repository_2;
Now lets re-run aura:
aura run hello
AURA will register the new repository, notice the new subsystem dependency on cli
, and search the repositories for a match, and will copy the subsystem into a subdirectory in the project root.
Once it has satisfied all the dependencies, it compiles our modified hello, world program: