libequivalence Developer Guide

libequivalence is the core D programming library that parses SDL-driven adaptation rules and evaluates code-transform pathways. It powers the official CLI compiler, but is also available as a standalone D dependency for custom tool builders.

CLI install catalog

equivalence.cli loads catalog/tools.sdl.

  • resolveCliInstall(path, context, toolId) — pick one method (exact context, then parent, then fallback).

  • listCliInstalls(path, toolId, HostCaps) — every method this host can run. Filter by family, package managers, formats, and runtime. Do not put a shell in the context path.

A method may carry format, runtime (argv default), argv, and expand (other intent ids). See equivalence-rules-cli/docs/SDL-CONVENTIONS.adoc.

Adding libequivalence to Your D Project

DUB 1.41 and newer require a commit hash along with your repository definition to guarantee clean reproducible builds:

Example dub.sdl Configuration
dependency "libequivalence" version="6e1706e6fd2db5e1fcd6b29106d92566af1bff95" repository="git+https://github.com/dev-centr/libequivalence.git"

Alternatively, once registered on the global registry, you can pull it as a standard package:

Example Standard Registry Dependency
dependency "libequivalence" version="~>1.0.0"

DUB Registry Registration Protocol

To make the library consumable as a standard dependency without git links:

  1. Create Registry Account: Register an account at code.dlang.org.

  2. Register Repository: Submit the project under your user account (dev-centr/libequivalence).

  3. Release Tags: DUB aggregates package versions directly from Git release tags (like v1.0.0 or v1.2.3). When you tag a release, the registry automatically picks it up within 30 minutes.

  4. Publishing Guidelines: For detailed publication policies, consult the DUB Publishing Manual.