Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/build_aaa_ansi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: aaa_ansi

on:
push:
branches: [ main, master ]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
uses: ./.github/workflows/build.yml
with:
crate: aaa_ansi
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ alire.lock
bin
lib
obj
**/tests/config/
**/config/
43 changes: 43 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
This repo hosts several nested Alire crates (aaa_base, aaa_texts,
aaa_ansi, ...), each buildable/testable independently with `alr` from
its own directory.

To build and test everything at once, run from the repo root:

alr -C dev test

This uses the `dev` crate (see dev/alire.toml), which aggregates all
the other crates' test suites via `[[test]]` entries.

## Crate layout

- Directory name and Alire crate `name` can differ: `aaa_base/`
hosts the crate named `aaa` (root package `AAA`, in
aaa_base/src/aaa.ads). Other crates depend on it as `aaa`, pinned
to `../aaa_base` (or `../../aaa_base` from a `tests/` subdir).
- Nested crates that add children to the shared `AAA` root package
(aaa_texts, aaa_ansi) each need: `aaa = "~0.3.0"` in
`[[depends-on]]`, a pin to `../aaa_base`, `with "aaa.gpr";` in
their own `.gpr`, and the same `aaa` pin repeated in
`tests/alire.toml`.
- `AAA.ANSI` (aaa_ansi crate) is the low-level ANSI escape-sequence
builder (ported from ~/prog/ansi-ada, package `AnsiAda` ->
`AAA.ANSI`), Pure, no external deps. `AAA.ANSI.Tools` (aaa_texts
crate) is a different, unrelated package: display-width
measurement (`Length`/`Count_Extra`) built on `Umwi`. Don't
conflate the two when grepping for "ANSI".

## Alire manifest gotchas

- A bare `[pins.foo]` table in `alire.toml` without a preceding
`[[pins]]` array-of-tables header makes `alr` fail with
`field pins: expected a TOML_ARRAY but got a TOML_TABLE`. Either
write pins inline right after `[[pins]]`
(`foo = { path = "../foo" }`) or put an empty `[[pins]]` line
before any `[pins.foo]` subtables (see aaa_texts/alire.toml).
- If `alr test` in a crate's `tests/` dir errors with an Alire
"bug box" (`No release visited in round 3`), the generated
`tests/config/*_config.gpr` is likely stale/missing (e.g. after
editing `[[depends-on]]`). Fix by running `alr build` (or
`alr update`) directly inside that `tests/` directory to
regenerate config, then retry `alr test` from wherever.
10 changes: 10 additions & 0 deletions aaa_ansi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/alire/
/bin/
/config/
/lib/
/obj/

*.a
*.ali
*.o
*.so
31 changes: 31 additions & 0 deletions aaa_ansi/aaa_ansi.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
with "config/aaa_ansi_config.gpr";
with "aaa.gpr";
project Aaa_Ansi is

for Library_Name use "Aaa_Ansi";
for Library_Version use
Project'Library_Name & ".so." & Aaa_Ansi_Config.Crate_Version;

for Source_Dirs use ("src/", "config/");
for Object_Dir use "obj/" & Aaa_Ansi_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Library_Dir use "lib";

type Library_Type_Type is ("relocatable", "static", "static-pic");
Library_Type : Library_Type_Type :=
external ("AAA_ANSI_LIBRARY_TYPE", external ("LIBRARY_TYPE", "static"));
for Library_Kind use Library_Type;

package Compiler is
for Default_Switches ("Ada") use Aaa_Ansi_Config.Ada_Compiler_Switches;
end Compiler;

package Binder is
for Switches ("Ada") use ("-Es"); -- Symbolic traceback
end Binder;

package Install is
for Artifacts (".") use ("share");
end Install;

end Aaa_Ansi;
19 changes: 19 additions & 0 deletions aaa_ansi/alire.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name = "aaa_ansi"
description = "ANSI escape sequences"
version = "0.1.0-dev"

authors = ["Alejandro R. Mosteo"]
maintainers = ["Alejandro R. Mosteo <amosteo@unizar.es>"]
maintainers-logins = ["mosteo"]
licenses = "MIT"
website = ""
tags = ["ansi", "terminal", "escape"]

[test]
runner = "alire"

[[depends-on]]
aaa = "~0.3.0"

[[pins]]
aaa = { path = "../aaa_base" }
Loading
Loading